add onApprove endpoint to store order in session

This commit is contained in:
David Remer 2020-04-08 16:23:33 +03:00
parent 7c2bc5a8da
commit 5824a40a08
10 changed files with 128 additions and 13 deletions

View file

@ -1,4 +1,4 @@
import onApprove from "./onApprove";
class CartConfig {
@ -26,12 +26,9 @@ class CartConfig {
return data.data.id;
});
}
const onApprove = (data, actions) => {
return actions.redirect(this.config.redirect);
}
return {
createOrder,
onApprove,
onApprove:onApprove(this),
onError: (error) => {
this.errorHandler.message(error);
}