Instamojo / ios-sdk

Instamojo Payment Integration for iOS
https://docs.instamojo.com/page/ios-sdk
GNU Lesser General Public License v3.0
6 stars 13 forks source link

After payment successfully completed not getting transaction_id or order_id from Instamojo server side #8

Open kiraninfogird opened 7 years ago

kiraninfogird commented 7 years ago
I have done the integration of Instamojo with my app by using steps are you given on the website. [https://docs.instamojo.com/v1.1/page/ios-sdk]

But I stuck on one place where I can’t know what should I do so please help me on below point which I can share with you.

func paymentCompletionCallBack() { if UserDefaults.standard.value(forKey: "USER-CANCELLED") != nil { //Transaction cancelled by user, back button was pressed } if UserDefaults.standard.value(forKey: "ON-REDIRECT-URL") != nil { // Check the payment status with the transaction_id // HERE THE PROBLEM // HOW I CAN FETCH ORDER_ID / TRUNCATION_ID OF USER WHO COMPLETED PAYMENT SUCCESSFULLY. } if UserDefaults.standard.value(forKey: "USER-CANCELLED-ON-VERIFY") != nil { //Transaction canceled by user when trying to verify UPI payment } }

For above function how I get that value from Instamojo payment server, it will give me the response as 1

Help me to resolve the above issue?

UISameer commented 4 years ago

Yes, facing same issue. Can someone from Instamojo team look into it.

Shruti2208 commented 4 years ago

Any answer to this?

Shruti2208 commented 4 years ago

Yes, facing same issue. Can someone from Instamojo team look into it.

Did you find an ans to this?

UISameer commented 4 years ago

Yes, facing same issue. Can someone from Instamojo team look into it.

Did you find an ans to this?

No, no reply from instamojo team, I've sent an email also.

Shruti2208 commented 4 years ago

I think i managed to crack it.I made the order a global variable in the class.After successful payment the control reaches the callback method "paymentCompletionCallBack". Try printing the order.id!. That should give you the paymentId.

UISameer commented 4 years ago

No, that's not the paymentID. paymentID will be something like "MOJO7726005A06926769". Yo can check the Get payment Details API. "https://docs.instamojo.com/v2/docs/get-payment-details-1"