mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ Send payer details with order approval request
First step to integrate payer details in the payment flow without final confirmation.
This commit is contained in:
parent
c39a623de9
commit
97379628d4
3 changed files with 42 additions and 11 deletions
|
@ -583,6 +583,8 @@ class GooglepayButton extends PaymentButton {
|
|||
async processPayment( paymentData ) {
|
||||
this.logGroup( 'processPayment' );
|
||||
|
||||
const payer = payerDataFromPaymentResponse( paymentData );
|
||||
|
||||
const paymentError = ( reason ) => {
|
||||
this.error( reason );
|
||||
|
||||
|
@ -622,7 +624,7 @@ class GooglepayButton extends PaymentButton {
|
|||
this.log( 'approveOrder', orderID );
|
||||
|
||||
await this.contextHandler.approveOrder(
|
||||
{ orderID },
|
||||
{ orderID, payer },
|
||||
{
|
||||
restart: () =>
|
||||
new Promise( ( resolve ) => {
|
||||
|
@ -665,8 +667,6 @@ class GooglepayButton extends PaymentButton {
|
|||
};
|
||||
|
||||
const addBillingDataToSession = () => {
|
||||
const payer = payerDataFromPaymentResponse( paymentData );
|
||||
|
||||
moduleStorage.setPayer( payer );
|
||||
setPayerData( payer );
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue