mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Update only allowed cards
This commit is contained in:
parent
8f7c7b2eb2
commit
78da47a505
2 changed files with 29 additions and 2 deletions
|
@ -25,6 +25,13 @@ class RealTimeAccountUpdaterHelper {
|
|||
* @return void
|
||||
*/
|
||||
public function update_wc_token_from_paypal_response( stdClass $order, WC_Payment_Token $token ): void {
|
||||
if (
|
||||
$token->get_type() !== 'CC'
|
||||
|| ! in_array( $token->get_card_type(), array( 'VISA', 'MASTERCARD' ), true )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
$expiry = $order->payment_source->card->expiry ?? '';
|
||||
$wc_expiry = $token->get_expiry_month() . '-' . $token->get_expiry_year();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue