-
Notifications
You must be signed in to change notification settings - Fork 553
[WIP] feat: Add PayPal payment configuration #1813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (paymentConfirmation != null) { | ||
val paymentInfo = paymentConfirmation.toJSONObject() | ||
Timber.d(paymentInfo.toString(4)) | ||
// TODO: Send token to server and redirect to tickets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal I need help here. I'm getting following response -
{
"client": {
"environment": "sandbox",
"paypal_sdk_version": "2.16.0",
"platform": "Android",
"product_name": "PayPal-Android-SDK"
},
"response": {
"create_time": "2018-12-30T19:59:20Z",
"id": "PAY-0JW58086WS3706240LQUSHEQ",
"intent": "sale",
"state": "approved"
},
"response_type": "payment"
}
And according to api documentation for paypal payment request -
Request
Body
{
"data": {
"attributes": {
"return_url": "https://localhost:5000/return_url",
"cancel_url": "https://localhost:5000/cancel_url"
},
"type": "paypal-payment"
}
}
How to send confirmation token to the server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using Braintree SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, It's PayPal Android SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liveHarshit from what I understand, the server already implements everything it needs, for now, For a Paypal payment, 2 things are needed: A Payer ID and A Payment ID. The Payment ID is generated by the server and I can see that you can get it from PaymentConfirmation above. For Payer ID, please check if you can generate it with the Paypal SDK, probably there should be a Paypal button for the user to log in or some similar method. After you have the Payer ID and the Payment ID, send a Charge object to the server. I think it should work, I will try Paypal SDK for Android to see if I understand it correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is the ID of who pay the payment, and it is unchanged while for PayPal user email or relevant information can be changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should Braintree. As PayPal andorid SDK is already Deprecated and suggesting for Braintree.
Read comments in this question: https://stackoverflow.com/questions/38229929/getting-the-payerid-from-paypal-android-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is configured on the server, I don't think we can use it on Android. It is configured to accept approval url.
https://github.com/paypal/PayPal-node-SDK/issues/24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's me spend a bit more time on this and then we can discuss what solution should we go on this tomorrow meeting, besides, I also think Braintree is better as the old documentation is deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think Braintree is better as the old documentation is deleted
Exactly, that is the problem. PayPal has deleted the documentation related to that and archive the sdk repo.
I just found a blog which writes about PayPal server authentication with android. |
Fixes #333