PCP-13 // add payer information to mini-cart, cart and single product

This commit is contained in:
David Remer 2020-04-28 09:14:05 +03:00
parent 05aac334e7
commit a9e0cc0cf7
9 changed files with 77 additions and 29 deletions

View file

@ -1,4 +1,5 @@
import onApprove from './onApproveForContinue.js';
import {payerData} from "./Payer";
class CartActionHandler {
@ -9,11 +10,13 @@ class CartActionHandler {
configuration() {
const createOrder = (data, actions) => {
const payer = payerData();
return fetch(this.config.ajax.create_order.endpoint, {
method: 'POST',
body: JSON.stringify({
nonce: this.config.ajax.create_order.nonce,
purchase_units: [],
payer
}),
}).then(function(res) {
return res.json();