Question:
Given a paymentID, is there a programmatic way to get the payment details? In particular, I’m looking for the payment method (Credit Card or Paypal). The event object from wixPay_onPaymentUpdate(event) does not have this info.
I’m open to solving this on the frontend as well. If there’s a way to capture the payment method on the frontend. Also, when the paypal transactions is complete, an e-mail is generated. Is there also an event that gets generated on the backend? Thanks.
The “event” object from wixPay_onPaymentUpdate(event) in events.js does have the orderId and transactionId. The title of this post should really refer to transactionId instead of paymentID.
{
"payment": {
"id": "d20e8128-8fc3-449d-80f0-f66bdd69521f",
...
},
"status": "Successful",
"transactionId": "5bd92a9f-bbc7-4065-a30c-1e6a112a8bdb",
...
}
The payments-dashboard does accept a transactionId and does show payment details and payment method. It would mean screen scraping, which I’m not even sure can be done from events.js.
https://manage.wix.com/dashboard/.../payments-dashboard/payment/<transactionId>?referralInfo=list
Any other suggestions on solving this?
Alright, with some help from ChatGPT I ended up creating a webhook in Wix via HTTP Functions. I added the webhook to Paypal. Whenever there’s a “Payment Capture Completed” event, Paypal sends it to my webhook with the payload below which contains the Wix transactionId (sent as custom_id), which I can use to update the database. It’s a lot of work for something very basic, but at least it meets the requirement.
{
"event_type": "PAYMENT.CAPTURE.COMPLETED",
"summary": "Payment completed for $ 2.0 USD",
...
"custom_id": "ff727d4c-a8bc-43d4-8738-134af17d5749",
"status": "COMPLETED",
...
}