I’m having trouble with
wixPayBackend.createPayment.
Creating a custom form where users filling details and sending a request to my backend where im trying to produce a paymentId and send it back to my frontend in order to open a payment dialog with startPayment()
the problem is that i cant create paymentId using the createPayment method duo to the fact it is returning an error saying: can’t create payment, details: invalid response status.
i have tried sending several paymentInfo objects cause i thought maybe something is wrong with the object structure but nothing worked and i think my object is ok.
here is my test object:
const paymentInfo = {
amount: 100,
currency: 'ILS',
items: [{
name: 'Gift Card',
price: 100,
quantity: 1
}],
userInfo: {
countryCode: "IL",
email: "test@gmail.com",
firstName: "testFirst",
lastName: "testLast",
phone: "0509959595"
},
};
and here is my full code on backend:
console.log("The paymentInfo before popup:", paymentInfo);
**try** {
**const** payment = **await** wixPayBackend.createPayment(paymentInfo);
console.log(payment);
**return** payment;
} **catch** (error) {
console.log("error on wixPayBackend.createPayment", error);
}
Working in
Wix Editor
What I’m trying to do
Im trying to integrate with wixPayBackend.createPayment in order to get a paymentId and pop the wix default window for payments.
Strange thing happend: 4 days ago when i tested it it worked fine for me but now i get this annoying error: can’t create payment, details: invalid response status, all the time on my logs.