mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Check if Stripe card is set
This commit is contained in:
parent
3510f749c8
commit
47137e60df
@ -151,14 +151,17 @@ class StripePaymentDriver extends BasePaymentDriver
|
||||
protected function creatingPaymentMethod($paymentMethod)
|
||||
{
|
||||
$data = $this->tokenResponse;
|
||||
$source = false;
|
||||
|
||||
if (!empty($data['object']) && ($data['object'] == 'card' || $data['object'] == 'bank_account')) {
|
||||
$source = $data;
|
||||
} elseif (!empty($data['object']) && $data['object'] == 'customer') {
|
||||
$sources = !empty($data['sources']) ? $data['sources'] : $data['cards'];
|
||||
$source = reset($sources['data']);
|
||||
} else {
|
||||
$source = !empty($data['source']) ? $data['source'] : $data['card'];
|
||||
} elseif (!empty($data['source'])) {
|
||||
$source = $data['source'];
|
||||
} elseif (!empty($data['card'])) {
|
||||
$source = $data['card'];
|
||||
}
|
||||
|
||||
if ( ! $source) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user