mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
🔊 Improve logging for “initiatePaymentRequest”
This commit is contained in:
parent
7035e1edbc
commit
83d6998cd5
1 changed files with 13 additions and 3 deletions
|
@ -533,7 +533,7 @@ class GooglepayButton extends PaymentButton {
|
||||||
* Show Google Pay payment sheet when Google Pay payment button is clicked
|
* Show Google Pay payment sheet when Google Pay payment button is clicked
|
||||||
*/
|
*/
|
||||||
onButtonClick() {
|
onButtonClick() {
|
||||||
this.log( 'onButtonClick' );
|
this.logGroup( 'onButtonClick' );
|
||||||
|
|
||||||
const initiatePaymentRequest = async () => {
|
const initiatePaymentRequest = async () => {
|
||||||
window.ppcpFundingSource = 'googlepay';
|
window.ppcpFundingSource = 'googlepay';
|
||||||
|
@ -545,7 +545,16 @@ class GooglepayButton extends PaymentButton {
|
||||||
this.context
|
this.context
|
||||||
);
|
);
|
||||||
|
|
||||||
return this.paymentsClient.loadPaymentData( paymentDataRequest );
|
return this.paymentsClient
|
||||||
|
.loadPaymentData( paymentDataRequest )
|
||||||
|
.then( ( paymentData ) => {
|
||||||
|
this.log( 'loadPaymentData response:', paymentData );
|
||||||
|
return paymentData;
|
||||||
|
} )
|
||||||
|
.catch( ( error ) => {
|
||||||
|
this.error( 'loadPaymentData failed:', error );
|
||||||
|
throw error;
|
||||||
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateForm = async () => {
|
const validateForm = async () => {
|
||||||
|
@ -577,7 +586,8 @@ class GooglepayButton extends PaymentButton {
|
||||||
|
|
||||||
validateForm()
|
validateForm()
|
||||||
.then( getTransactionInfo )
|
.then( getTransactionInfo )
|
||||||
.then( initiatePaymentRequest );
|
.then( initiatePaymentRequest )
|
||||||
|
.finally( () => this.logGroup() )
|
||||||
}
|
}
|
||||||
|
|
||||||
paymentDataRequest() {
|
paymentDataRequest() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue