mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add basic card payment flow
This commit is contained in:
parent
e3ac190849
commit
aec32512ce
2 changed files with 47 additions and 61 deletions
|
@ -7,21 +7,11 @@ export const CheckoutHandler = ({onPaymentSetup, responseTypes}) => {
|
|||
useEffect(() => {
|
||||
const unsubscribe = onPaymentSetup(async () => {
|
||||
|
||||
cardFieldsForm.submit()
|
||||
.then(() => {
|
||||
return {
|
||||
type: responseTypes.SUCCESS,
|
||||
meta: {
|
||||
paymentMethodData: {
|
||||
foo: 'bar',
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
.catch((err) => {
|
||||
await cardFieldsForm.submit()
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
return {
|
||||
type: responseTypes.ERROR,
|
||||
message: err
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue