#wixcode #corvid #payment #multilingue
I created a payment flow with code, it works well.
But there are 2 problems:
- the payment window is displayed in English despite my French site.
-The visitor can not choose to pay in cash but only by credit card.
What I am trying to do is:
-Add a place where the visitor can add a personal message during the payment process.
-Let the visitor choose to pay in cash if he wishes.
In my settings, I add manual payment and payment CB (stripe) and the currency is well set to €, but during the process of payment there is only possibility to pay in CB.
-Change the language of the payment window.
My site is well tuned in French but as you can see in the screenshot, some info is written in English and others are translated into French.
Thank’s you for help
I have read all the related documentation but I can not find a concrete solution.
https://support.wix.com/en/article/accepting-payments-on-your-wix-site-7014346
https://support.wix.com/en/article/setting-your-currency-for-accepting-payments
https://www.wix.com/corvid/reference/wix-pay.html
https://www.wix.com/corvid/reference/wix-pay-backend.html#createPayment
https://www.wix.com/corvid/reference/wix-pay-backend.html
https://www.wix.com/corvid/reference/wix-window.multilingual.html
Code page
import wixPay from 'wix-pay';
import { createPaymentForProduct } from 'backend/BE_Collection';
import { session } from 'wix-storage';
export function repeater1_itemReady($w, itemData, index) {
let itemId = itemData._id;
$w('#button1').onClick(async () => {
let payment = await createPaymentForProduct(itemId, );
await wixPay.startPayment((payment.id), { "termsAndConditionsLink": "https://" });
});
}
Code Backend
import wixPay from 'wix-pay-backend';
import wixData from 'wix-data';
export async function createPaymentForProduct(productId) {
let product = await wixData.get('Stores/Products', productId);
return wixPay.createPayment({
amount: product.price,
items: [
{ name: product.name, price: product.price }
]
});
}