Skip to content

Commit

Permalink
Improve Bacs token manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran committed Jan 29, 2025
1 parent 8ae932a commit 0300b7f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/stripe-utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const PAYMENT_METHOD_STRIPE_AFTERPAY_CLEARPAY =
'stripe_afterpay_clearpay';
export const PAYMENT_METHOD_STRIPE_WECHAT_PAY = 'stripe_wechat_pay';
export const PAYMENT_METHOD_STRIPE_CASHAPP = 'stripe_cashapp';
export const PAYMENT_METHOD_STRIPE_BACS = 'stripe_bacs_debit';
export const PAYMENT_METHOD_STRIPE_BACS_DEBIT = 'stripe_bacs_debit';

export function getPaymentMethodsConstants() {
return {
Expand All @@ -64,7 +64,7 @@ export function getPaymentMethodsConstants() {
afterpay_clearpay: PAYMENT_METHOD_STRIPE_AFTERPAY_CLEARPAY,
wechat_pay: PAYMENT_METHOD_STRIPE_WECHAT_PAY,
cashapp: PAYMENT_METHOD_STRIPE_CASHAPP,
bacs_debit: PAYMENT_METHOD_STRIPE_BACS,
bacs_debit: PAYMENT_METHOD_STRIPE_BACS_DEBIT,
};
}

Expand Down
1 change: 1 addition & 0 deletions includes/class-wc-stripe-customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class WC_Stripe_Customer {
WC_Stripe_UPE_Payment_Method_LINK::STRIPE_ID,
WC_Stripe_UPE_Payment_Method_Sepa::STRIPE_ID,
WC_Stripe_UPE_Payment_Method_Cash_App_Pay::STRIPE_ID,
WC_Stripe_UPE_Payment_Method_Bacs_Debit::STRIPE_ID,
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct() {
$this->accept_only_domestic_payment = true;
$this->label = __( 'Bacs Direct Debit', 'woocommerce-gateway-stripe' );
$this->description = __( 'Bacs Direct Debit enables customers in the UK to pay by providing their bank account details.', 'woocommerce-gateway-stripe' );
$this->supports[] = 'tokenization';
}

/**
Expand Down
1 change: 0 additions & 1 deletion includes/payment-tokens/class-wc-stripe-payment-tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ private function add_token_to_user( $payment_method, WC_Stripe_Customer $custome
break;
case WC_Stripe_UPE_Payment_Method_Bacs_Debit::STRIPE_ID:
$token = new WC_Payment_Token_Bacs_Debit();
$token->set_token( $payment_method->id );
$token->set_last4( $payment_method->bacs_debit->last4 );
$token->set_fingerprint( $payment_method->bacs_debit->fingerprint );
$token->set_payment_method_type( $payment_method_type );
Expand Down

0 comments on commit 0300b7f

Please sign in to comment.