Stripe: fill payment card details

This commit is contained in:
Francisco Ferreira 2019-06-03 17:41:20 +01:00
parent 8e8414ab49
commit cee4652b7c
No known key found for this signature in database
GPG Key ID: F63C20A6773E787E

View File

@ -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;