Hi @GeneDrea , I have configured many PayHere flows before and there are multiple options for you here. For your question first, you don’t need a Google Sheet to use a webhook in Glide since we have the Glide API now (providing you’re on Pro).
The key with the API for Glide Tables is that you must know the rowID of the user in advance, and this is a bit tricky with the PayHere API itself.
PayHere sends two payloads on the first payment of the user, subscription.created and payment.success. We can add the rowID of the user as a parameter in the payment link, but it ONLY gets sent in the payment.success payload. For the next payments, only the payment.success payloads are sent.
The payment.success payload doesn’t get sent in payments that the user uses a discount code that brings the total to under the Stripe’s minimum limit (I believe that’s 0.5 USD). Only the subscription.created payload gets sent in that case. If the code is active forever for that subscription, I believe the payment.success payload never gets sent to the webhook.
So, here are your options:
When a new user is created, add a webhook to Make to create a new row in a data store. Your data store just needs to contain the user’s email and the rowID. Then, when any PayHere payloads come in, you can lookup the user’s rowID and make a HTTP call to Glide Tables to update the row’s info. This is assuming you’re storing the payment info in the same row as the user’s Profiles table row.
You can connect a Google Sheet to help with this case, creating a new table to store the user’s email, the PayHere subscription status and the last payment timestamp.
When the payload comes from PayHere, you can use a Google Sheets search to search the PayHere’s customer email in the Google Sheet table. If that exists, you update the info of that row with the info from PayHere. Else, you create a new row in that table.
If you want to reduce the sync time between Google Sheets and Glide, you can utilize the Glide API on that Sheet, but I would advise getting used to the API first before approaching that.