Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Get transaction id from paypal sdk 2.15.+ when PayPal Confirmation #402

Closed
stoichoandreev opened this issue May 10, 2017 · 11 comments
Closed

Comments

@stoichoandreev
Copy link

stoichoandreev commented May 10, 2017

General information

I have problem with sending transaction id to our backend when PaymentActivity return result to my Activity.

  • SDK/Library version: 2.15.3
  • Environment: Sandbox
  • Android Version and Device: Nexus 5 with Android 5.1

Issue description

My issue is when I need to send (make a request) to our backend the transaction id after PaymentActivity return result to my Activity. Like your example app shows I need to do

PaymentConfirmation confirm = data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);

and then from this confirm object I need to get the data like json

{ "client": { "environment": "sandbox", "paypal_sdk_version": "2.15.3", "platform": "Android", "product_name": "PayPal-Android-SDK" }, "response": { "create_time": "2017-05-09T10:46:13Z", "id": "PAY-0S1319267Y964945XLEIZ35I", "intent": "sale", "state": "created" }, "response_type": "payment" }

At the end I need to pick up response -> id and send it to our backend.

When I do this on Sandbox environment our backend return error 500 and it tells me that transaction id is not valid ( PAY-0S1319267Y964945XLEIZ35I ). I have tried to find some info about this problem and it seems that , this one paypal/PayPal-iOS-SDK#125 is similar to my problem, but it is iOS issue and it seems to be resolved a long time ago.
Paypal implementation in our backend is working with transaction ids not starting with "PAY" prefix , so that is why I am not sure is "id": "PAY-0S1319267Y964945XLEIZ35I" a transition id or some other id. Can you help me guys what is wrong with the id that I am sending back to our server.

@randstraw
Copy link

If you created a sale for example then you pass the Payment ID to https://developer.paypal.com/docs/api/payments/#payment_get

You will find the transaction ids in transactions related_resources, if it was a sale you would have a sale object and its id is the transaction id.

image

@stoichoandreev
Copy link
Author

stoichoandreev commented May 10, 2017

Yes we are making sale payment (PayPalPayment.PAYMENT_INTENT_SALE), but we are not using your backend SDK.
Currently we are trying to migrate from Android WebView to Android native (with your Android SDK), without changing our backend to much.
BTW our backend is using NVP API not your Rest API.
With the WebView we extracted transaction id from web url when PayPal web form finish its job but now with Android SDK the transaction id does not come back and we can't use our existing backend.

@randstraw
Copy link

I don't see why you couldn't still use your NVP API backed; however, you would need to use the REST API to lookup the Payment first then pass the transaction id for the sale to your existing NVP API backend.

@stoichoandreev
Copy link
Author

stoichoandreev commented May 10, 2017

No, of course we can use our NVP API backend, but we need to develop new service specially for getting this transaction id from your Rest API (based on the sale id) and then call again our NVP API backend and pass created transaction id. Instate of that it will be much easy if we have transaction id when paypal confirmation returns in Android SDK, like it is described inside the iOS ticket mentioned above and like the paypal webview is working all the time. Is there any chance to get the transaction id inside Android client using Paypal Android SDK?

@randstraw
Copy link

I will follow up further internally on the request and update you when I have more information.

@stoichoandreev
Copy link
Author

Thank you about your help. Really appreciate it.

@randstraw
Copy link

I am still following up on this issue. I do not have an update at this time. I will see if the priority can be increased since iOS SDK offers this feature.

@stoichoandreev
Copy link
Author

Thank you @pp-randy about this update. I hope PayPal will be able to fix it, and provide transactionID inside the Android SDK, because for our company this is really important and becomes urgent since we need to update our Android app with the latest PayPal requirements about TLS 1.2 and HTTP 1.1 until the end of the next month.

@randstraw
Copy link

I am still following up on this issue and will continue to do so. However, if your deadline is coming up for next month then you still have the option of doing a payment lookup then passing the transaction id to your existing processes.

@braebot
Copy link
Contributor

braebot commented May 18, 2018

I believe this was addressed in the most recent release. Closing.

@braebot braebot closed this as completed May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
@braebot @randstraw @stoichoandreev and others