Skip to content
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 Venmo as payment option #138

Merged

Conversation

RyanofWoods
Copy link
Contributor

Resolves issues/tickets:

Setting the preference enable_venmo to true will now show a Venmo button
on checkout for customers whom it is available to.

For testing purposes, the string preference force_buyer_country was
added. You can use this to mock what country the buyer is from, allowing
you to see what funding sources are shown to customers in various
countries.

This preference does not affect checkout on production, environment.
Instead, PayPal will get this information from their ip geolocation.

More information:
https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#buyer-country

@RyanofWoods RyanofWoods force-pushed the add-venmo-as-payment-option branch 2 times, most recently from 7b3fe5c to 4b234dd Compare November 23, 2021 16:14
@RyanofWoods RyanofWoods force-pushed the add-venmo-as-payment-option branch 3 times, most recently from 5d2595b to 1454bc5 Compare December 1, 2021 08:55
@RyanofWoods RyanofWoods changed the title Add Venmo as payment option on checkout Add Venmo as payment option Dec 1, 2021
To reduce having unnecessary information on tests that do not explicitly
involve Spree::Order checkout steps.
@RyanofWoods RyanofWoods force-pushed the add-venmo-as-payment-option branch from 1454bc5 to cc2e8cd Compare December 2, 2021 10:03
Copy link
Contributor

@DanielePalombo DanielePalombo left a comment

Choose a reason for hiding this comment

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

LGTM 🥳

@RyanofWoods RyanofWoods marked this pull request as draft December 2, 2021 15:04
Resolves issue/ticket:
- solidusio#136

If a transaction meets Venmo prerequisites [1], then Venmo button
should appear already on checkout, cart and product page depending
on payment method preferences.

These changes is to give more control to the developer so that they can
disable Venmo by setting the `enable_venmo` to false.
https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#disable-funding

As it Venmo may have already been showing for developers, the default
was set to true.

The enable-funding option is now also sent over to ensure that the Venmo
button gets rendered if eligible:
https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#enable-funding
https://developer.paypal.com/docs/business/checkout/pay-with-venmo/integrate-pay-with-venmo/#always-request-venmo

[1] https://developer.paypal.com/docs/business/checkout/pay-with-venmo/#eligibility
Resolves issue/ticket:
- solidusio#137

Usually on checkout, PayPal will look at the buyer's location by their
ip and determine which funding sources are available to them. For
example, allow Venmo as an option for US buyers, but not for others.

With this new preference, you can set a country to override the buyer
location. Allowing you on non-production environments to see the
different funding sources for different customers and its integration.

This preference is still available on production but has no effect.
It was kept on production to not have differences between the
environments. Otherwise, errors could easily occur on production if
for example, preferred_force_buyer_country method was incorrectly
called.

More information:
https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#buyer-country
@RyanofWoods RyanofWoods force-pushed the add-venmo-as-payment-option branch from cc2e8cd to 2498c7e Compare December 2, 2021 16:21
@RyanofWoods RyanofWoods marked this pull request as ready for review December 7, 2021 11:12
@DanielePalombo DanielePalombo self-requested a review December 7, 2021 12:00
Copy link
Contributor

@DanielePalombo DanielePalombo left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielePalombo DanielePalombo merged commit 1984054 into solidusio:master Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants