@@ -691,20 +691,24 @@ public function process_payment( $order_id ) {
691
691
$ can_do_async = true ;
692
692
}
693
693
694
+ $ payload = array (
695
+ 'paymentDetails ' => array (
696
+ 'paymentIntent ' => $ payment_intent , // TODO: Check Authorize, and Confirm flows.
697
+ 'canHandlePendingAuthorization ' => $ can_do_async ,
698
+ // "softDescriptor" => "Descriptor", // TODO: Implement setting, if empty, don't set this. ONLY FOR AuthorizeWithCapture
699
+ 'chargeAmount ' => array (
700
+ 'amount ' => $ order_total ,
701
+ 'currencyCode ' => $ currency ,
702
+ ),
703
+ ),
704
+ 'merchantMetadata ' => WC_Amazon_Payments_Advanced_API::get_merchant_metadata ( $ order_id ),
705
+ );
706
+
707
+ wc_apa ()->log ( __METHOD__ , "Updating checkout session data for # {$ order_id }. Checkout Session ID: {$ checkout_session_id }. \n" . wp_json_encode ( $ payload , JSON_PRETTY_PRINT ) );
708
+
694
709
$ response = WC_Amazon_Payments_Advanced_API::update_checkout_session_data (
695
710
$ checkout_session_id ,
696
- array (
697
- 'paymentDetails ' => array (
698
- 'paymentIntent ' => $ payment_intent , // TODO: Check Authorize, and Confirm flows.
699
- 'canHandlePendingAuthorization ' => $ can_do_async ,
700
- // "softDescriptor" => "Descriptor", // TODO: Implement setting, if empty, don't set this. ONLY FOR AuthorizeWithCapture
701
- 'chargeAmount ' => array (
702
- 'amount ' => $ order_total ,
703
- 'currencyCode ' => $ currency ,
704
- ),
705
- ),
706
- 'merchantMetadata ' => WC_Amazon_Payments_Advanced_API::get_merchant_metadata ( $ order_id ),
707
- )
711
+ $ payload
708
712
);
709
713
710
714
if ( is_wp_error ( $ response ) ) {
0 commit comments