Question:
I’m using the startPayment function for a payment dialog on my website.
My implementaion is as explained in these instructions.
The issue i’m having is that some users complain they can’t select number of installments, i.e. the installments selection field is not showing:
Its flaky, some users see it and are able to pay with installments and some not.
It can happen in the same session for the same user, after refresh.
I could not reproduce this issue and I suspect it’s a bug.
The installments option is enabled in my payment provider.
Did someone encounter this?
Any ideas?
Product:
Wix Editor
What are you trying to achieve:
Always show the installments selection field
Additional information:
Can you share the code that is not working? Will help with debugging if this is a Wix or code issue.
Thank you Anthony for reaching out!!!
- I also noticed that sometimes the dialog asks for ID, sometimes it doesn’t.
- If the user does not fill their phone on the first step of the dialog, sometimes it asks for their phone on the second step.
So I think the second step of the payment dialog has a bug…
My implementaion is as explained in these instructions.
Here is my code:
This is on the client side (in the OnClick handler of the payment button):
let payment = await createPayment(product, registration_item._id);
return wixPayFrontend.startPayment(payment.id)
.then((result) => {
if (result.status === "Successful" || result.status === "Pending") {
wixLocation.to("https://www.my-domain.com/successpage");
}
return false;
});
This is on my backend code in pay.jsw:
export async function createPayment(product, registrationId) {
let payment = await wixPayBackend.createPayment({
items: [{
name: product["name"],
price: product["price"]
}],
amount: product["price"],
});
var item = {
"payment_id": payment.id,
"registration_id": registrationId,
};
await wixData.insert("pendingPayments2024", item);
return payment;
}
Replied below, accidently instead of directly to you!
Thank you for reaching out!
Hrmm not much in this code to go wrong. Since this might be a bug or specific limitations as to when the installment option appears for users the best place to get more clarity on why this happens is customer care: Contact Wix
Sorry I can’t be of more help.
I did contact WIX support, they say they don’t support custom code 
I tried to explain that it’s probably a bug in WIX code, but they did not help.
Thanks for letting me know. I’ll ask internally. Did they give you a ticket #?
You have a new response from the Wix Team (Request 9760203)