On master page:

Use the following events to monitor the cart

onCartChange()

getCurrentCart()

One other thing to investigate is the onOrderPaid( ) backend event process to capture and purchase and update user account. This may be the solution to quickly update the user's account.

There may be a way to also change an account from Free to Gold using the onPlanPurchased( ) backend event handler

 

Also there is a onPaymentUpdate( ) backend event. With all pricing different this may be a single solution to account status other than paid membership.

Using the onCartChanged() event it may be possible to catch what items in the cart and make the adjustments to the users account as to membership, credit, and matchmaking. MAYBE

// Place this code in the events.js file
// of your site's Backend section.

export function wixPay_onPaymentUpdate(event) {
  let paymentId = event.payment.id;
  let newTransactionStatus = event.status;
}

/*  Full event object:
*  {
*    "payment": {
*      "id": "8b3c1a90-c09e-4cd7-ae9d-9801151d8ad9",
*      "amount": 15.99,
*      "currency": "USD",
*      "items": [
*        {
*          "name": "Baseball Bat",
*          "quantity": 1,
*          "price": 15.99
*        }
*      ]
*    },
*    "userInfo": {
*      "firstName": "Mike",
*      "lastName": "Trout",
*      "countryCode": "USA",
*      "phone": null,
*      "email": "mike.trout@email.com"
*    },
*    "status": "Successful",
*    "transactionId": "83f1830a-c74e-4abe-894d-3ee388b7e985"
*  }
*/

No product

cart id

Find Order

THANK YOU PAGE

Next

items in cart

total of cart

item purchased

do not forget:

onPlanPurchased( ) found in the backent process