diff --git a/app/Ninja/PaymentDrivers/StripePaymentDriver.php b/app/Ninja/PaymentDrivers/StripePaymentDriver.php index f83ffc8c63d8..d1e83620b9b9 100644 --- a/app/Ninja/PaymentDrivers/StripePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/StripePaymentDriver.php @@ -273,6 +273,11 @@ class StripePaymentDriver extends BasePaymentDriver } elseif ($isBitcoin) { $payment->payment_type_id = PAYMENT_TYPE_BITCOIN; } + } else if (! $paymentMethod && $this->isGatewayType(GATEWAY_TYPE_CREDIT_CARD) && ! strcmp($this->purchaseResponse['payment_method_details']['type'], "card")) { + $card = $this->purchaseResponse['payment_method_details']['card']; + $payment->last4 = $card['last4']; + $payment->expiration = $card['exp_year'] . '-' . $card['exp_month'] . '-01'; + $payment->payment_type_id = PaymentType::parseCardType($card['brand']); } return $payment; diff --git a/resources/views/payments/credit_card.blade.php b/resources/views/payments/credit_card.blade.php index 149d8a3d4ff8..b72736315cdb 100644 --- a/resources/views/payments/credit_card.blade.php +++ b/resources/views/payments/credit_card.blade.php @@ -154,11 +154,12 @@ @if ($client) {{ Former::populate($client) }} + {{ Former::populateField('country_id', (string) $client->country_id) }} {{ Former::populateField('first_name', $contact->first_name) }} {{ Former::populateField('last_name', $contact->last_name) }} {{ Former::populateField('email', $contact->email) }} @if (!$client->country_id && $client->account->country_id) - {{ Former::populateField('country_id', $client->account->country_id) }} + {{ Former::populateField('country_id', (string) $client->account->country_id) }} {{ Former::populateField('shipping_country_id', $client->account->country_id) }} @endif @endif @@ -170,7 +171,7 @@ {{ Former::populateField('city', 'New York') }} {{ Former::populateField('state', 'NY') }} {{ Former::populateField('postal_code', '10118') }} - {{ Former::populateField('country_id', 840) }} + {{ Former::populateField('country_id', (string) 840) }}