@@ -1415,7 +1415,7 @@ public function save_payment_method_to_order( $order, $payment_method ) {
1415
1415
/**
1416
1416
* Retries the payment process once an error occured.
1417
1417
*
1418
- * @param object $intent The Payment Intent response from the Stripe API.
1418
+ * @param object $response The response from the Stripe API.
1419
1419
* @param WC_Order $order An order that is being paid for.
1420
1420
* @param bool $retry A flag that indicates whether another retry should be attempted.
1421
1421
* @param bool $force_save_source Force save the payment source.
@@ -1424,7 +1424,7 @@ public function save_payment_method_to_order( $order, $payment_method ) {
1424
1424
* @throws WC_Stripe_Exception If the payment is not accepted.
1425
1425
* @return array|void
1426
1426
*/
1427
- public function retry_after_error ( $ intent , $ order , $ retry , $ force_save_source = false , $ previous_error = false , $ use_order_source = false ) {
1427
+ public function retry_after_error ( $ response , $ order , $ retry , $ force_save_source = false , $ previous_error = false , $ use_order_source = false ) {
1428
1428
if ( ! $ retry ) {
1429
1429
$ localized_message = __ ( 'Sorry, we are unable to process your payment at this time. Please retry later. ' , 'woocommerce-gateway-stripe ' );
1430
1430
$ order ->add_order_note ( $ localized_message );
@@ -1433,13 +1433,13 @@ public function retry_after_error( $intent, $order, $retry, $force_save_source =
1433
1433
1434
1434
// Don't do anymore retries after this.
1435
1435
if ( 5 <= $ this ->retry_interval ) {
1436
- return $ this ->process_payment_with_saved_payment_method ( $ order ->get_id (), false );
1436
+ return $ this ->process_payment ( $ order ->get_id (), false , $ force_save_source , $ response -> error , $ previous_error );
1437
1437
}
1438
1438
1439
1439
sleep ( $ this ->retry_interval );
1440
1440
$ this ->retry_interval ++;
1441
1441
1442
- return $ this ->process_payment_with_saved_payment_method ( $ order ->get_id (), true );
1442
+ return $ this ->process_payment ( $ order ->get_id (), true , $ force_save_source , $ response -> error , $ previous_error );
1443
1443
}
1444
1444
1445
1445
/**
0 commit comments