This is fresh out of the oven, and boy is it smelling good!
You can use Wix Code Pay API to collect payments from your site's visitors outside the context of a Wix App (like Wix Stores). The API allows you to collect a payment when triggered by any user interaction on any page.
Here are some examples:
Example site:https://code-examples.wixsite.com/wix-pay-demo
Open example in the editor: http://editor.wix.com/html/editor/web/renderer/new?siteId=42a94205-0783-42a8-9b71-3d75745141dc&metaSiteId=4b3c177f-b87c-4a17-bee2-045115c95749
Warning: Before starting with payments, it is important that you fully understand the security concerns that arise when collecting payments. For more details, see the article linked below.
Also: Due to the nature of the API, the API requires the site to be saved and published, to have a payment method setup for the site (in site settings -> accept payments), and to have currency selected for the site (in the site settings > general info).
How does it work?
The Pay API consists of three parts:
createPayment() - A backend function for securely creating a payment.
startPayment() - A client-side function for prompting your users to enter their payment information.
onPaymentUpdate() - A backend event for handling payment status updates.
A typical payment lifecycle looks something like this:
A site visitor clicks a button to start the payment process.
The click triggers a call to a backend function that securely creates the payment and its corresponding unique payment ID.
The payment ID is used client-side to open a payment popup.
The site visitor enters the payment information, such as credit card number.
Optionally, you can react to updates in the payments status that trigger a backend event.
Learn More
To learn more about the payment process, security concerns, and for code examples see:
Why there is no option to add discount to the checkout list???
@Moran (Wix) Is it possible with wix-pay to create a payment with a total amount of $0.00 ? and use the manual payment to further process that offline? Thanks!
We need the checkout to be in Portuguese. How can I set that?
Hi, I am using the wix-pay-backend with Paypal, but the onPaymentUpdate( ) does not works.
createPayment( ) works fine and the payment process starts with no problem including PayPal.
The following code is on the event.jsw file on the Backend Section, but it does not get fired:
export function wixPay_onPaymentUpdate(event) { // Step 8 - Handle additional status updates using // the onPaymentUpdate() event. let paymentId = event.payment.id; let newTransactionStatus = event.status; let userInfo = event.userInfo; console.log('event'+ JSON.stringify(event)); // also console.log does not works
Can you help, I am stucked with a integration project for my most important client.
Hello ! I would like to do some tests with Wix-pay API, and as I am connected with my Paypal account, I would like to know if there is a way to use it with a sandbox Paypal account ?
Is there a plan to allow customisation of the checkout?
It's a great feature and really easy to implement but it is a little incongruous to have the page users need to trust the most (the one where card and personal details are added) to look completely different from the rest of the site.
Even if it could inherit fonts and colours from standard Wix Stores pages it would be great.
Dear Brett Haralson,
Thank you for the nice article and explanations.
Can I ask though ?
Is it possible you use the API, or any other WixCode ability to trigger a checkout and accept payments from non supported payment providers ? Another payment provider than the predefined list of partners offered by WIX Store ?
Thank you for making it clear .
Regards,
Vitalie
Whats up,
I'm building a marketplace and want each seller to be able to pay for her/his ad using the pay API. Is there a way to pre-populate the fields in the pay API and directly redirect to the "choose payment option" page?
Hi guys,
is there a way how to customize (change labels, fields, etc.) the checkout window?
Thanks,
R
What is the importance of Pay Api?
Hi
couple questions:
1. Is there an order management somewhere on the dashboard? for example in your sample page, I cannot see an order tab, as normal wix store has one.
2. is there a way to combine the "submit" button for a form with the Pay API "buy now" button?
thank you very much
Hi, is this functionality capable of working if the payment option is 'Payment Offline'? Thanks
to enable the customer to purchase a qunatity of their choosing? what would i need to do?
What would I do differently in the code to be able to enter a custom dollar amount? I'm using the Wix Pay API on the admin side of our site where we can take orders and process payment through a custom form and I just want to be able to enter the amount to charge. Help?
And when a true Payment Provider Gateway will be added that will support payment providers like Klarna Payments all my US clients will scream hurray....
good questions! Let me see what I can find. :)
Where do we edit/translate/create the Payment Details PopUp and where do we edit/create the confirmation email?
Can we define Currency ourselves ? in the future ?
Is it possible to use the pay API to process purchases of plans from the Paid Plans app ? Or does it only work with products in WIX Store ?
You guys Rock!!!