Hello!
I create custom Cart/Store for my site where customer can buy many products at once.
After adding several products to the shopping cart, the customer can go to it.
All data from the order summary is updated when you increase the amount of product or delete one. I’d like to connect the wix-payments to this.
I know I have to create my payment in backend code (pay.jsw)
import wixPay from 'wix-pay-backend';
export function createMyPayment() {
return wixPay.createPayment({
items: [{
name: "Product Name",
price: 9.99
}],
amount: 19.98
} );
}
My questions: Can I somehow connect the data from my “Total Cost” basket as “amount” in this backend code?
I’d get this cart data from the database collection.
Is “Item->name/price” required here? Can I replace it with cart data in my case?
Is that allowed? Will the payment run smoothly?
Thank you for all your answers!