Skip to content

Commit 1bfffe1

Browse files
authored
fixed bug that would not allow a customer to add new payment methods in WooPay (#5156)
1 parent 60c82e3 commit 1bfffe1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
fixed bug that would not allow customers to add new payment methods to WooPay

includes/class-wc-payment-gateway-wcpay.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,12 @@ public function create_intent( WC_Order $order, array $payment_methods, string $
26352635
*/
26362636
public function create_and_confirm_setup_intent() {
26372637
$payment_information = Payment_Information::from_payment_request( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification
2638-
$should_save_in_platform_account = $this->platform_checkout_util->should_save_platform_customer();
2638+
$should_save_in_platform_account = false;
2639+
2640+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
2641+
if ( ! empty( $_POST['save_payment_method_in_platform_account'] ) && filter_var( wp_unslash( $_POST['save_payment_method_in_platform_account'] ), FILTER_VALIDATE_BOOLEAN ) ) {
2642+
$should_save_in_platform_account = true;
2643+
}
26392644

26402645
// Determine the customer adding the payment method, create one if we don't have one already.
26412646
$user = wp_get_current_user();

0 commit comments

Comments
 (0)