Loading src/Plugin/Commerce/PaymentGateway/Omise.php +10 −6 Original line number Diff line number Diff line Loading @@ -352,9 +352,13 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { $payment_method->card_number = $remote_payment_method['last_digits']; $payment_method->card_exp_month = $remote_payment_method['expiration_month']; $payment_method->card_exp_year = $remote_payment_method['expiration_year']; $remote_id = $remote_payment_method['id']; $expires = CreditCard::calculateExpirationTimestamp($remote_payment_method['expiration_month'], $remote_payment_method['expiration_year']); $payment_method->setRemoteId($remote_id); $payment_method->setRemoteId($remote_payment_method['id']); if (isset($remote_payment_method['token'])) { // Handle one-time / non-reusable card. $payment_method->setRemoteId($remote_payment_method['token']); $payment_method->setReusable(FALSE); } $payment_method->setExpiresTime($expires); $payment_method->save(); } Loading Loading @@ -442,8 +446,9 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { * * @return array * The payment method information returned by the gateway. Notable keys: * - id: The remote ID. This could be either one-time token (for anonymous) * or the stored card ID. * - id: The remote card ID. This is a remote REUSABLE card object ID which * should be only used for authorized users. * - token: The ONE TIME card token. * Credit card specific keys: * - card_type: The card type. * - last4: The last 4 digits of the credit card number. Loading Loading @@ -528,8 +533,7 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { $this->configuration['secret_key'] ); $cardByToken = $existingCard['card']; // TODO: Pass token instead of card ID? $cardByToken['id'] = $payment_details['omise_token']; $cardByToken['token'] = $payment_details['omise_token']; return $cardByToken; } Loading Loading
src/Plugin/Commerce/PaymentGateway/Omise.php +10 −6 Original line number Diff line number Diff line Loading @@ -352,9 +352,13 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { $payment_method->card_number = $remote_payment_method['last_digits']; $payment_method->card_exp_month = $remote_payment_method['expiration_month']; $payment_method->card_exp_year = $remote_payment_method['expiration_year']; $remote_id = $remote_payment_method['id']; $expires = CreditCard::calculateExpirationTimestamp($remote_payment_method['expiration_month'], $remote_payment_method['expiration_year']); $payment_method->setRemoteId($remote_id); $payment_method->setRemoteId($remote_payment_method['id']); if (isset($remote_payment_method['token'])) { // Handle one-time / non-reusable card. $payment_method->setRemoteId($remote_payment_method['token']); $payment_method->setReusable(FALSE); } $payment_method->setExpiresTime($expires); $payment_method->save(); } Loading Loading @@ -442,8 +446,9 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { * * @return array * The payment method information returned by the gateway. Notable keys: * - id: The remote ID. This could be either one-time token (for anonymous) * or the stored card ID. * - id: The remote card ID. This is a remote REUSABLE card object ID which * should be only used for authorized users. * - token: The ONE TIME card token. * Credit card specific keys: * - card_type: The card type. * - last4: The last 4 digits of the credit card number. Loading Loading @@ -528,8 +533,7 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface { $this->configuration['secret_key'] ); $cardByToken = $existingCard['card']; // TODO: Pass token instead of card ID? $cardByToken['id'] = $payment_details['omise_token']; $cardByToken['token'] = $payment_details['omise_token']; return $cardByToken; } Loading