This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
This file contains 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
These functions will dynamically add a paypal button, fetch a client token, and submit the transaction to solidus upon completion.
This view only gets rendered if the payment method is active, and the payment method gets passed to it as a local variable already.
luukveenis
force-pushed
the
paypal_one_touch
branch
2 times, most recently
from
November 11, 2016 00:09
e3e21a1
to
111687f
Compare
This is good by me if we can green. |
luukveenis
force-pushed
the
paypal_one_touch
branch
from
November 11, 2016 00:33
111687f
to
a66aad7
Compare
adammathys
reviewed
Nov 11, 2016
end | ||
end | ||
|
||
describe "#apple_pay??" do |
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.
#apple_pay??
With the current implementation we essentially "swallow" JS errors and don't allow the user to do anything with them. Specifying callback function allows users to determine what they do in both the error and success cases.
This tries to simplify what was happening before. I created an instantiable PayPal object that encapsulates most of the logic for creating the button. Instead of hardcoding the options passed to the paypal tokenize call in initializePaypal and initializePaypalCredit, I just use one function that allows the user to pass in the configuration options.
luukveenis
force-pushed
the
paypal_one_touch
branch
from
November 11, 2016 00:52
a66aad7
to
00bf8c4
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR is based entirely of #34 , with some additional refactoring. It adds PayPal as a payment option through the regular checkout flow if we set the payment method to display on the frontend, and also adds a PayPal OneTouch button on the cart page.
In the refactoring I tried to make it easy to create a PayPal button, but flexible enough that users can specify what type of button they want (checkout, vault, and other options). For example: