-
Notifications
You must be signed in to change notification settings - Fork 553
feat: Add paypal #2223
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
feat: Add paypal #2223
Conversation
PR is the same as #1813 What about the server-side confirmation? |
@liveHarshit still looking for documentation, this is an example for server-side integration but it is not fully enough for me: https://gist.github.com/tomwhipple/62075b4eb9abca1129cf
|
Here I can see that -
payer id is from server side response. But we want is to charge the payment according to our server implementation.
|
Actually I just found a better documentation. We'll handle all the payment in the client side by the SDK and then only send the payment confirmation to the server, the server will check whether payment is confirmed or not like here: https://github.com/paypal/PayPal-Python-SDK/tree/master/samples/mobile_backend
|
What information do we need to send on the server? |
only the payment id and then the server will search for that payment based on the payment ID. After that, server will check whether payment is already successful, if it is then it will send OK response to the Android so that Android app can proceed finishing order |
I think verify_payment function in here https://github.com/paypal/PayPal-Python-SDK/blob/master/samples/mobile_backend/paypal_client.py#L37 is what I have been looking for
|
Oh, that's nice. So for this server-side configuration is required. ✌️ |
Okay, so this configuration is required for issue fossasia/open-event-server#5961
|
Let's wait for the server PR to be merged, so that I can also test it. |
sandbox @liveHarshit |
@iamareebjamal Can I get PayPal live client id to test it? |
Test with sandbox first. |
Live won't even work as it is not gone to production |
Then it needs to enable on dev instance with the same sandbox client id as stripe. |
@iamareebjamal I got 404 HTTP error for https://open-event-api-dev.herokuapp.com/v1/orders/e185e6d1-0d63-4a03-8dad-440fe6b8063d/verify-mobile-paypal-payment . Before that, the server PR was working fine locally for me on Postman. It is already in the debug server right? |
@liveHarshit You can try client ID: "AXrRge-gN1E5WHMYsu0FsftPOWBjTu3Sqj0pKfpq7mPKwv6w_ikiqWrka_06lAWZW5_WxL9CwaMiTVsc" and Paypal email is letrananhduc0311-facilitator@gmail.com |
But it needs to unable on the server with the same client id, i think. |
Try now @anhanh11001 |
@iamareebjamal Got this error |
Give the keys to me in private channel or you want keys from FOSSASIA sandbox? |
We can use
|
Give me the client secret for that in private chat |
Also please share its password with me. |
Please enable PayPal for debug instance |
I asked a question to Duc about sandbox or live 2 days ago. Got the reply today |
Added |
I still have the same problem of |
Yes, it is set up in sandbox mode. If you want, I can change it to live mode but I doubt it'll work |
Here is the log
|
I have changed it to live credentials. Test now. If not working, please raise issue on server |
Yes, it is not working as well and doesn't provide any logs. What should be the problem raised in the server? |
Does not give any log? What's the response? |
I have restarted the server. Try one time more |
oh I think I got the problem, I didn't put the function to configPaypal() in the verifyPayment() method. But when I test, I didn't know where to put the CLIENT_ID and SECRET so I put it directly to the path where the path logs direct me, that's probably why. Opening server issue and solving now. Sorry |
Is it working now? |
@liveHarshit still having some small mistake, sorry, it is so annoying, I forgot to push the change |
In Order, when formatting to Json, isBillingEnabled turn into "billing_enabled", not "is_billing_enabled". How should I fix this? |
Add @JsonProperty annotation |
Use |
Fixes: #333
tested and working for normal payment. This is just a general implementation, I will open more issues on different currency problems like billing address in US requires state location or Japanese,.. currency should not contain fractional part |
@anhanh11001 how to check PayPal integration in debug mode? |
Fixes #333
Fixes #1813
Screenshots


Additional Context
Waiting for fossasia/open-event-server#6297 to be merged, another PR will be made and open to send verification to the server before confirming orders