Skip to main content
Question

Transaction ID capacitor purchasePackage response

  • December 15, 2024
  • 2 replies
  • 26 views

Forum|alt.badge.img+4

Hello. We’ve integrated webhooks (Django rest). Basically what the user sees on frontend once they click is a spinner. Meanwhile we fire purchasePackage which in no time upon finishing should fire a webhook to our backend.. on the backend we create a Payment object with the transaction id from the webhook. On frontend as the spinner is spinning, after the purchasePackage request goes through, we wanted to begin verifying whether the backend has synced already (aka created the payment object). We wanted to call in a loop payment/<payment_id>/state … but for that we need transaction_id that was send in the webhook which is what we assumed will be returned from purchasePackage as part of the response … but as we understood, we’re not going to receive the transaction ID in the response of purchasePackage at all? … so what is the best way with capacitor to proceed to get the correct transaction id? Or do we have to completely change this logic ..thank you

This post has been closed for comments

2 replies

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 365 replies
  • December 18, 2024

Hi ​@nagram,

`purchasePackage` should return an updated `customerInfo` object as well as some information about the transaction, and this should include the transaction ID: https://www.npmjs.com/package/@revenuecat/purchases-capacitor#makepurchaseresult

Does that not seem to be your experience with this method?


Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • December 20, 2024
kaitlin wrote:

Hi ​@nagram,

`purchasePackage` should return an updated `customerInfo` object as well as some information about the transaction, and this should include the transaction ID: https://www.npmjs.com/package/@revenuecat/purchases-capacitor#makepurchaseresult

Does that not seem to be your experience with this method?

Hello Kaitlin, all good in the end, I was relaying solely on the documentation and completely missed the “along with some details about the transaction` part, I was just looking at the customerInfo trying to find it there. https://www.revenuecat.com/docs/getting-started/making-purchases . But then I actually tested and found it.

Anyway, maybe I am again being stupid and blind but is there a way for me to determine on the frontend whether a Transfer or Product change is taking place? it all seems to be returning just the same purchasePackage response which makes it hard to take proper action on frontend to correspond with what webhook is being processed on the backend.

 

Thank you


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings