-
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
app/src/main/java/org/fossasia/openevent/general/paypal/PaypalApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package org.fossasia.openevent.general.paypal | ||
|
||
import io.reactivex.Single | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
import retrofit2.http.Path | ||
|
||
interface PaypalApi { | ||
|
||
@POST("orders/{orderIdentifier}/create-paypal-payment") | ||
fun createPaypalPayment(@Path("orderIdentifier") orderIdentifier: String, @Body paypal: Paypal) | ||
fun createPaypalPayment(@Path("orderIdentifier") orderIdentifier: String, @Body paypal: Paypal): | ||
Single<CreatePaypalPaymentResponse> | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 -
And according to api documentation for paypal payment request -
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
Uh oh!
There was an error while loading. Please reload this page.
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.
Exactly, that is the problem. PayPal has deleted the documentation related to that and archive the sdk repo.