Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Enable PayPal as a payment method #42

Merged
merged 16 commits into from
Nov 11, 2016
Merged

Enable PayPal as a payment method #42

merged 16 commits into from
Nov 11, 2016

Conversation

luukveenis
Copy link
Contributor

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:

<script>
  var button = new PaypalButton(document.querySelector("#paypal-button");
  button.setTokenizeCallback(myCallbackFunction);
  button.initialize({
    flow: 'fault',
    enableShippingAddress: true
   });
</script>

Graham Bouvier and others added 9 commits November 3, 2016 11:17
@luukveenis luukveenis force-pushed the paypal_one_touch branch 2 times, most recently from e3e21a1 to 111687f Compare November 11, 2016 00:09
@cbrunsdon
Copy link
Contributor

This is good by me if we can green.

end
end

describe "#apple_pay??" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#apple_pay??

Luuk Veenis added 7 commits November 10, 2016 16:51
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants