Solved

How can I get the transaction or order ID in Flutter?

  • 18 October 2021
  • 5 replies
  • 314 views

Badge +4

How can ı. get order id in flutter for android 

icon

Best answer by cody 18 October 2021, 19:42

View original

5 replies

Userlevel 5
Badge +8

Hey @seyhmus gumus!

We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.

If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.

Badge +4

Thank you so much for letting me know this

Badge +1

Hey @seyhmus gumus!

We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.

If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.


Please add the order ID to the response, setting up webhook to save server side and then reading from there complicates what should be a pretty simple transaction. (Make an order -> get your order id in the success response)

Badge +1

HI, there is some way to identify the purchase?

I understand that I can validate the purchase with a webhook, but if i dont have any ID (like order ID o transaction ID) How i can verify if the purchase is the same that the webhook send to my server?

please, can you helpme?

Badge +1

Hey @seyhmus gumus!

We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.

If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.

I review your code in the library purchases-hybrid-common you can add the order Id, but you filter that in this line

 

https://github.com/RevenueCat/purchases-hybrid-common/blob/1f0c0fdff9803299644891dd6e8b5c913b75e91a/android/src/main/java/com/revenuecat/purchases/hybridcommon/common.kt#L322

Reply