Good day sirs/mas, please I am trying to use WIX API to collect payment. I want this option to create a new order for logged in user and also ask for shipping details + shipping method as setup in my WIX settings. When I tried to test it, the payment went through. But no order was created and no shipping details requested. I want the payment API to work like physical product checkout works.
Here is my Backend code pls help:
/* Backend Code for WIX Pay (payment.jsw) [Backend]*/
Can you share the rest of the code (i.e your frontend code)? After you create the payment you’ll need to call startPayment() from the frontend with the payment ID returned by createPayment.
Here is it Sir I have call the required startPayment(). Pls I also notice the image is not attached along with the input arrays added. It just says “Image Uploaded: object” without quote. I am using this option because I can’t integrate the calculator to a WIX store product. A preview is shown at https://bit.ly/3RJoMm7
import { createMyPayment } from ‘backend/payment’;
import wixPay from ‘wix-pay’;
import wixData from ‘wix-data’;
Now I use site Event logs from Wix Developer tools and no error shows. But a log says below when i cancelled the payment. I think the WIX API only works as guest checkout instead of creating order and allowing shipping options.
"jsonPayload":{"message":"{"status":"Cancelled","payment":{"id":"092ab47b-f877-4fa2-a01e-41fee6395bcb","amount":43.09,"currency":"GBP","items":[{"id":"c3c04f60-7c0d-4c8c-9e21-1e7a5303a296","name":"🕛 Order Summary 🧾Length: 500 mm 🧾Width: 491 mm Measurment: mm 🧾qty: 5 🧾Image Uploaded: [object Object]","quantity":1,"price":43.09,"description":"🕛 Order Summary 🧾Length: 500 mm 🧾Width: 491 mm Measurment: mm 🧾qty: 5 🧾Image Uploaded: [object Object]"}]},"userInfo":{"firstName":null,"lastName":null,"email":null,"phone":null,"country":null}}"
}
"receiveTimestamp":"2022-09-12T20:48:13.192Z"
No sir. I choose to cancel when no error comes up. So I saw the report that payment was cancelled. I manually cancelled it myself just to see if any error will comeup. The cancel error I sent doesn’t have anything to do with the create order and allow shipping that we are debugging.
After going through https://www.wix.com/velo/reference/wix-pay/startpayment once again I only see transactionId and i can’t even find anything like create order or order number. I guess this feature only work for guest checkout.
Pls kindly help in adding option for creating order numbers for this and adding shipping details.
Sir pls I want to change the payment button to add to cart button. How can I connect a button to a product as reference and then use the value from my calculator as price??