Skip to content

Commit

Permalink
Merge branch 'develop' into dev/updating-min-required-versions-constants
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrosa authored Feb 26, 2025
2 parents 8bf826b + bec91d3 commit 08aa7c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 9.3.0 - xxxx-xx-xx =
* Fix - Fixes a fatal error that might happen when a payment method ID cannot be retrieved during the processing of an order (new checkout experience).
* Dev - Generates a code coverage report for PHP Unit tests as a comment on PRs.
* Add - Adds Stripe specific information to the System Status Report data.
* Fix - Fixes a fatal error that might happen during extension install due to missing Amazon Pay default settings data, when registering the settings route.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,10 @@ protected function prepare_payment_information_from_request( WC_Order $order ) {
'return_url' => $this->get_return_url_for_redirect( $order, $save_payment_method_to_store ),
'use_stripe_sdk' => 'true', // We want to use the SDK to handle next actions via the client payment elements. See https://docs.stripe.com/api/setup_intents/create#create_setup_intent-use_stripe_sdk
'has_subscription' => $this->has_subscription( $order->get_id() ),
'payment_method' => '',
'payment_method_details' => [],
'payment_type' => 'single', // single | recurring.
'capture_method' => $capture_method,
];

if ( 'us_bank_account' === $selected_payment_type ) {
Expand All @@ -2227,18 +2231,15 @@ protected function prepare_payment_information_from_request( WC_Order $order ) {
$payment_method_details = WC_Stripe_API::get_payment_method( $payment_method_id );
$payment_information['payment_method'] = $payment_method_id;
$payment_information['payment_method_details'] = $payment_method_details;
$payment_information['payment_type'] = 'single'; // single | recurring.
$payment_information['save_payment_method_to_store'] = $save_payment_method_to_store;
$payment_information['payment_method_options'] = $this->get_payment_method_options(
$selected_payment_type,
$order,
$payment_method_details
);
$payment_information['capture_method'] = $capture_method;
} else {
$confirmation_token_id = sanitize_text_field( wp_unslash( $_POST['wc-stripe-confirmation-token'] ?? '' ) );
$payment_information['confirmation_token'] = $confirmation_token_id;
$payment_information['payment_type'] = 'single'; // single | recurring.
$payment_information['save_payment_method_to_store'] = false;

// When using confirmation tokens with manual capture, we need to
Expand All @@ -2249,8 +2250,6 @@ protected function prepare_payment_information_from_request( WC_Order $order ) {
'capture_method' => 'manual',
],
];
} else {
$payment_information['capture_method'] = $capture_method;
}

// When using confirmation tokens for subscriptions, we need to set the setup_future_usage parameter under payment method options.
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
== Changelog ==

= 9.3.0 - xxxx-xx-xx =
* Fix - Fixes a fatal error that might happen when a payment method ID cannot be retrieved during the processing of an order (new checkout experience).
* Dev - Generates a code coverage report for PHP Unit tests as a comment on PRs.
* Add - Adds Stripe specific information to the System Status Report data.
* Fix - Fixes a fatal error that might happen during extension install due to missing Amazon Pay default settings data, when registering the settings route.
Expand Down

0 comments on commit 08aa7c4

Please sign in to comment.