diff --git a/examples/angular/src/app/app.component.html b/examples/angular/src/app/app.component.html index ad440ed..66b18c5 100644 --- a/examples/angular/src/app/app.component.html +++ b/examples/angular/src/app/app.component.html @@ -90,7 +90,8 @@ totalPrice: amount, currencyCode: 'USD', countryCode: 'US' - } + }, + callbackIntents: ['PAYMENT_AUTHORIZATION'] }" (loadpaymentdata)="onLoadPaymentData($event)" (error)="onError($event)" @@ -131,7 +132,8 @@ totalPrice: amount, currencyCode: 'USD', countryCode: 'US' - } + }, + callbackIntents: ['PAYMENT_AUTHORIZATION'] }" (loadpaymentdata)="onLoadPaymentData($event)" (error)="onError($event)" @@ -158,7 +160,8 @@ currencyCode: 'USD', countryCode: 'US' }, - shippingAddressRequired: true + shippingAddressRequired: true, + callbackIntents: ['PAYMENT_AUTHORIZATION'] }" (loadpaymentdata)="onLoadPaymentData($event)" (error)="onError($event)" diff --git a/examples/html/app.js b/examples/html/app.js index 19a54f8..fde4361 100644 --- a/examples/html/app.js +++ b/examples/html/app.js @@ -132,6 +132,7 @@ const googlePayButtons = [ }, }, existingPaymentRequired: controls.existingPaymentRequired.value === 'true', + callbackIntents: ['PAYMENT_AUTHORIZATION'], onLoadPaymentData, onPaymentAuthorized, }; @@ -151,6 +152,7 @@ const googlePayButtons = [ }, }, existingPaymentRequired: controls.existingPaymentRequired.value === 'true', + callbackIntents: ['PAYMENT_AUTHORIZATION'], onLoadPaymentData, onPaymentAuthorized, }; @@ -171,6 +173,7 @@ const googlePayButtons = [ }, existingPaymentRequired: controls.existingPaymentRequired.value === 'true', shippingAddressRequired: true, + callbackIntents: ['PAYMENT_AUTHORIZATION'], onLoadPaymentData, onPaymentAuthorized, }; diff --git a/examples/react/src/examples/DisplayItemsExample.tsx b/examples/react/src/examples/DisplayItemsExample.tsx index 1479fa0..43399a1 100644 --- a/examples/react/src/examples/DisplayItemsExample.tsx +++ b/examples/react/src/examples/DisplayItemsExample.tsx @@ -70,6 +70,7 @@ export default (props: any) => { }, ], }, + callbackIntents: ['PAYMENT_AUTHORIZATION'], }} onLoadPaymentData={paymentRequest => { console.log('Success', paymentRequest); diff --git a/examples/react/src/examples/DynamicPriceUpdateExample.tsx b/examples/react/src/examples/DynamicPriceUpdateExample.tsx index f79ce04..fd4af07 100644 --- a/examples/react/src/examples/DynamicPriceUpdateExample.tsx +++ b/examples/react/src/examples/DynamicPriceUpdateExample.tsx @@ -90,6 +90,7 @@ const paymentRequest: google.payments.api.PaymentDataRequest = { description: o.description, })), }, + callbackIntents: ['SHIPPING_ADDRESS', 'SHIPPING_OPTION'], }; export default (props: any) => { diff --git a/examples/react/src/examples/PaymentDataChangedErrorExample.tsx b/examples/react/src/examples/PaymentDataChangedErrorExample.tsx index 9d7453f..f1861b0 100644 --- a/examples/react/src/examples/PaymentDataChangedErrorExample.tsx +++ b/examples/react/src/examples/PaymentDataChangedErrorExample.tsx @@ -53,6 +53,7 @@ export default (props: any) => { countryCode: 'US', }, shippingAddressRequired: true, + callbackIntents: ['SHIPPING_ADDRESS'], }} onLoadPaymentData={paymentRequest => { console.log('Success', paymentRequest); diff --git a/examples/react/src/examples/PaymentDataChangedExample.tsx b/examples/react/src/examples/PaymentDataChangedExample.tsx index ebfdba2..4feb3ad 100644 --- a/examples/react/src/examples/PaymentDataChangedExample.tsx +++ b/examples/react/src/examples/PaymentDataChangedExample.tsx @@ -53,6 +53,7 @@ export default (props: any) => { countryCode: 'US', }, shippingAddressRequired: true, + callbackIntents: ['SHIPPING_ADDRESS'], }} onLoadPaymentData={paymentRequest => { console.log('Success', paymentRequest); diff --git a/examples/vue/src/components/Examples.vue b/examples/vue/src/components/Examples.vue index e0cca6f..ca86b05 100644 --- a/examples/vue/src/components/Examples.vue +++ b/examples/vue/src/components/Examples.vue @@ -131,6 +131,7 @@ currencyCode: 'USD', countryCode: 'US', }, + callbackIntents: ['PAYMENT_AUTHORIZATION'], }" v-on:loadpaymentdata="onLoadPaymentData" v-on:error="onError" @@ -158,6 +159,7 @@ countryCode: 'US', }, shippingAddressRequired: true, + callbackIntents: ['PAYMENT_AUTHORIZATION'], }" v-on:loadpaymentdata="onLoadPaymentData" v-on:error="onError" diff --git a/src/button-element/README.md b/src/button-element/README.md index eea4eb3..ef54763 100644 --- a/src/button-element/README.md +++ b/src/button-element/README.md @@ -233,6 +233,7 @@ integrating Google Pay into your website.
Invoked when a user chooses a payment method. This callback should be used to validate whether or not the payment method can be used to complete a payment.
This would be typically used to perform pre-authorization to ensure that the card is valid and has sufficient funds.
+Note that in order to use this callback paymentRequest.callbackIntents
must include PAYMENT_AUTHORIZATION
.
See payment authorization reference for more information.
Invoked when payment the user changes payment data options including payment method, shipping details, and contact details. This callback can be used to dynamically update transactionInfo
when payment details, shipping address, or shipping options change.
Note that in order to use this callback paymentRequest.callbackIntents
must include either SHIPPING_ADDRESS
or SHIPPING_OPTION
.
See payment data changed reference for more information.
Invoked when a user chooses a payment method. This callback should be used to validate whether or not the payment method can be used to complete a payment.
This would be typically used to perform pre-authorization to ensure that the card is valid and has sufficient funds.
+Note that in order to use this callback paymentRequest.callbackIntents
must include PAYMENT_AUTHORIZATION
.
See payment authorization reference for more information.
onPaymentDataChanged
Invoked when payment the user changes payment data options including payment method, shipping details, and contact details. This callback can be used to dynamically update transactionInfo
when payment details, shipping address, or shipping options change.
Note that in order to use this callback paymentRequest.callbackIntents
must include either SHIPPING_ADDRESS
or SHIPPING_OPTION
.
See payment data changed reference for more information.