Skip to content

Commit b556e0d

Browse files
authored
Merge pull request #47 from saucal/hotfix/alpha4
Release alpha4
2 parents f43eeee + 469ba6e commit b556e0d

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

includes/class-wc-gateway-amazon-payments-advanced.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -691,20 +691,24 @@ public function process_payment( $order_id ) {
691691
$can_do_async = true;
692692
}
693693

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+
694709
$response = WC_Amazon_Payments_Advanced_API::update_checkout_session_data(
695710
$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
708712
);
709713

710714
if ( is_wp_error( $response ) ) {

woocommerce-gateway-amazon-payments-advanced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin Name: WooCommerce Amazon Pay
1010
* Plugin URI: https://woocommerce.com/products/pay-with-amazon/
1111
* Description: Amazon Pay is embedded directly into your existing web site, and all the buyer interactions with Amazon Pay and Login with Amazon take place in embedded widgets so that the buyer never leaves your site. Buyers can log in using their Amazon account, select a shipping address and payment method, and then confirm their order. Requires an Amazon Pay seller account and supports USA, UK, Germany, France, Italy, Spain, Luxembourg, the Netherlands, Sweden, Portugal, Hungary, Denmark, and Japan.
12-
* Version: 2.0.0-alpha3
12+
* Version: 2.0.0-alpha4
1313
* Author: WooCommerce
1414
* Author URI: https://woocommerce.com
1515
*

0 commit comments

Comments
 (0)