Stripe improvements (port #2863 to master) (#2903)

* View credit card: send more billing data to Stripe when available

As commit 8e8414ab498a6fcfee423a81294789769b68305f shows, this commit had more code that was wrongly commited in ff064367d6f64ce6c05249459ca8ea88c846c99a by another author

* Stripe: fill payment card details
This commit is contained in:
Francisco Ferreira 2019-07-18 07:26:08 +01:00 committed by David Bomba
parent 989f114154
commit b0e680ee5c
2 changed files with 6 additions and 1 deletions

View File

@ -437,6 +437,11 @@ class StripePaymentDriver extends BasePaymentDriver
} elseif ($isBitcoin) { } elseif ($isBitcoin) {
$payment->payment_type_id = PAYMENT_TYPE_BITCOIN; $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; return $payment;

View File

@ -254,7 +254,7 @@
<div class="col-md-6"> <div class="col-md-6">
{!! Former::select('country_id') {!! Former::select('country_id')
->placeholder(trans('texts.country_id')) ->placeholder(trans('texts.country_id'))
->fromQuery($countries, 'name', 'id') ->fromQuery($countries, 'name', ['value' => 'id', 'data-iso_3166_2' => 'iso_3166_2'])
->addGroupClass('country-select') ->addGroupClass('country-select')
->label('') !!} ->label('') !!}
</div> </div>