-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add PayPal buttons to frontend checkout flow #10
Conversation
4d787e3
to
0345788
Compare
Gotcha, I guess we'll have to survive without this! 😄😅 I'll update this PR right away 🚀 |
Just as reference, still need to do the following:
|
55444b8
to
abcbf81
Compare
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.
just some nits about the indentation, I'll have another look after it's fixed to avoid having my eyes crossed after I finish 😅
abcbf81
to
d77f2b1
Compare
d77f2b1
to
fd93284
Compare
@elia I've split this PR into 3 separate commits, I hope they make sense! The first commit is new models/helpers that the rest depend on, the second is adding functionality to the gateway, and the third creates the controllers and frontend view that use that added functionality. |
fd93284
to
cc70de5
Compare
app/helpers/solidus_paypal_commerce_platform/order_format_helper.rb
Outdated
Show resolved
Hide resolved
app/helpers/solidus_paypal_commerce_platform/order_format_helper.rb
Outdated
Show resolved
Hide resolved
app/helpers/solidus_paypal_commerce_platform/order_format_helper.rb
Outdated
Show resolved
Hide resolved
Payment source has paypal_order_id - to connect it to the order on PayPals side - and an authorization_id - which is how you reference the order when the store is set to not auto-capture. Also adds a class to format the orders data to something usable by PayPals API.
Adds basic purchase/authorize/refund/etc. ability to the gateway. Only purchase, authorize, and capture have been implemented, the rest simply returns false - we'll build that out when we handle the admin side. Also adds methods that make it easier to trigger a request. On the request file, I've added methods for triggering authorize, purchase, and capture events on PayPal. I've also added "paypal_order_id" and "authorization_id" to source attributes.
cc70de5
to
4b8959c
Compare
Adds routes for orders_controller - which allows the creation of orders on PayPals side. This is called when the paypal button is first clicked, to send the order info to PayPal so they know how to build the order and how much is going to be charged. Also adds a route for payments_controller, which handles the creation of the source/payment for the order. en.yml was updated to display nothing for validation errors for paypal_order_id - the reason is that when you try to proceed without having created a payment on PayPal, the error message "Payments Source #{en.yml entry} Can't Be Blank" appears, with whatever you've set in the paypal_order_id entry appearing in the middle of the string. We may want to adjust the entire error message, but I think it's clearer with nothing in the middle - so just "Payments Source Can't Be Blank", instead of "Payments Source Paypal Order Id Can't Be Blank". Also adds tests for the frontend! 🎉
4b8959c
to
ff692c0
Compare
@elia I update the PR to reflect your suggestions, and I also moved the inline javascript from the checkout page to a javascript file, let me know how it looks! |
🎉💯great job! |
Adds paypal buttons and associated javascripts to allow customers to
checkout using PayPal.
Also: This is not a draft PR, it looks like draft PRs aren't available on this repo for some reason. This link seems to indicate that we need a Github Team account for it? https://github.community/t5/How-to-use-Git-and-GitHub/Draft-Pull-Requests-not-available/m-p/19212#M5733