mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
🔊 More descriptive error message
New error reason when tokenization fails due to missing paymentComponent
This commit is contained in:
parent
1548e1dba7
commit
78e0da27a1
1 changed files with 8 additions and 6 deletions
|
@ -17,9 +17,15 @@ const useHandlePaymentSetup = (
|
|||
}
|
||||
|
||||
if ( ! cardToken ) {
|
||||
let reason = 'tokenization error';
|
||||
|
||||
if ( ! paymentComponent ) {
|
||||
reason = 'initialization error';
|
||||
}
|
||||
|
||||
return {
|
||||
type: emitResponse.responseTypes.ERROR,
|
||||
message: 'Could not process the payment (tokenization error)',
|
||||
message: `Could not process the payment (${ reason })`,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,11 +38,7 @@ const useHandlePaymentSetup = (
|
|||
},
|
||||
},
|
||||
};
|
||||
}, [
|
||||
card,
|
||||
paymentComponent,
|
||||
tokenizedCustomerData,
|
||||
] );
|
||||
}, [ card, paymentComponent, tokenizedCustomerData ] );
|
||||
};
|
||||
|
||||
export default useHandlePaymentSetup;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue