@jacofda I kept getting the following error myself, too Error: Expected a promise for a string order id to be passed to createOrder This got me for a minute, too, but I realized what the issue is, at least in my case. I was pretty much just following the example documentation paypal has except I'm making a server side call to create an order object. The example js that paypal says you should use in that case is this: createOrder: function() {
return fetch('/my-server/create-paypal-transaction')
.then(function(res) {
return res.json();
}).then(function(data) {
return data.orderID;
});
} What paypal returns is a node called "id" for the order id. This example code is expecting a node called "orderID". All I basically did was just update the node to this createOrder: function() {
return fetch('/my-server/create-paypal-transaction')
.then(function(res) {
return res.json();
}).then(function(data) {
return data.id;
});
} and server side for the create order response, I'm just outputting { id: "<order id>", ... } and now its working. Hope that helps!
... View more