Example: Accept Payments with Wix Pay API

We’ve added two new examples to our resources page to show you how to use the Wix-pay API .

Check out how to accept payments on a single predefined item here and learn how to accept payments for a product from your database collection here .

2 Likes

Hey very good thank you for this - I’ll be building this out very shortly on my new project as I plan to document the whole development in a Youtube series. My project is called AutomotiveMarket.ca

Is there a way to integrate with the Wix Art Store Payment process? Reason being is so that I can display a gallery from a collection tied to a ID in Wix Database .

Imagine being able to connect your art from a collection or database.
If this isn’t possible right now, please let me know so I can make this a Feature Request.

Also if this doesn’t make sense I would like to explain more just let me know.

Hi Nino,
I’m not quite sure what you mean, but with the Pay API you can accept payments for basically anything!
Also, as I’ve mentioned, there is an example of getting product information from the database for the Pay API here .
If that is not what you need, please elaborate further

-Lior

Hi Lior,

I want to know if it is possible to connect a database to the wix art store and use the pay api (without having stores).

Wix Art Store Video


Please let me know if this makes sense. I am trying to code in a way without having to use wix stores because then I would have to pay for that plan in order for me to collect payments.

Can I add wix stores to my site and use it just for wix pay api and not buy into wix store or is that the only way for now? Will there be a separate payment option where it is just linked to a database or wix art store?

Please let me know if you need further explanation I don’t mind it at all.

Hi Lior,

onPaymentUpdate() is not being fired on Payment:

The following code is placed in event.jsw file but it does not working.

export function wixpPay_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));

}

Can you Help?

Hi jcampos,
It’s likely that the event is being fired but you are unable to see it in the console.log from the event.jsw.
try checking with http://webhook.site to see if it is fired.

update me with your results!

Thanks for your fast reply.

To use http:webhook.site do I have to use fetch, inside the event.js ?

export function wixPay_onPaymentUpdate(event) …is this the correct event handler for the wixPay ?

Hey man did you made any progress on this? Seems like this event is not being fired anywhere