Coder Social home page Coder Social logo

strangerstudios / pmpro-add-paypal-express Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 19.0 48 KB

Appeal to the highest number of potential customers by offering PayPal as a payment option in addition to your onsite credit card payment gateway.

Home Page: https://www.paidmembershipspro.com/add-ons/plus-add-ons/pmpro-add-paypal-express-option-checkout/

PHP 97.55% CSS 2.45%
strangerstudios-product paid-memberships-pro wordpress wordpress-plugin

pmpro-add-paypal-express's Introduction

== Paid Memberships Pro - Add PayPal Express Add On ==
Contributors: strangerstudios
Tags: pmpro, paid memberships pro, gateway, paypal, checkout, registration
Requires at least: 4.0
Tested up to: 5.2.4
Stable tag: .6

Appeal to the highest number of potential customers by offering PayPal as a payment option in addition to your onsite credit card payment gateway.

== Description ==

This plugin enables a radio select on the membership checkout page, allowing a user to select their preferred payment method for purchase. PayPal offers peace of mind to buyers that have concerns paying you directly by giving them a layer of protection when making purchases online.

== Installation ==

1. Upload the 'pmpro-add-paypal-express' directory to the '/wp-content/plugins/' directory of your site.
1. Activate the plugin through the 'Plugins' menu in WordPress.

== Setup ==
1. Navigate to the Memberships > Payment Settings admin page.
1. Select the 'PayPal Express' gateway from the 'Payment Gateway' dropdown list.
1. Enter your PayPal Express API key, username, and password set in the appropriate fields [docs].
1. Click 'Save Settings'.
1. Now (after inputting your PayPal Express settings and clicking save), switch back to your primary gateway by selecting your gateway from the 'Payment Gateway' dropdown list.
1. Click 'Save Settings'.
1. The PayPal Express settings will be remembered 'in the background'.

Navigate to your Memberships Checkout page and preview the new 'Choose Your Payment Method' box. We also advise testing checkout via PayPal to ensure that the connection is working.

== Important Notes ==

You do not need to activate this plugin with PayPal Website Payments Pro. PayPal Express is automatically an option at checkout with that gateway.

This plugin will only work when the primary gateway is an onsite gateway. At this time, this includes:
* Stripe
* Braintree
* Authorize.net
* PayPal Payflow Pro
* Cybersource

== Frequently Asked Questions ==

= I found a bug in the plugin. =

Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/strangerstudios/pmpro-add-paypal-express/issues

== Changelog ==
= .6
* ENHANCEMENT: Reading for localization.
* ENHANCEMENT: Added French translation.
* BUG FIX: Fixed issues where the billing address fields or payment info fields wouldn't show up if you switched back to the default gateway after getting an error with PayPal.

= .5.3 =
* BUG FIX: Fixed bug where a second PayPal button was shown if the Pay by Check add-on was also active and there were errors on checkout submission.

= .5.2 =
* ENHANCEMENT: Improved fields display on membership checkout page to use no tables for compatibility with Paid Memberships Pro v1.9.4.

= .5.1 =
* ENHANCEMENT: Added stylesheet to improve the layout of the frontend checkout form.
* ENHANCEMENT: Improved setup instructions.

= .5 =
* BUG: Fixed bug where the Choose Payment Method box would disappear after submitting.
* BUG/ENHANCEMENT: Updated to better support using this addon along with the Pay by Check addon. Make sure both are up to date.

= .4.1 =
* BUG: Updated the pmproappe_using_paypal function to not consider Payflow Pro a PayPal gateway. We want to show PayPal Express as a second option if the main gateway is Payflow.

= .4 =
* BUG: Added pmpro_btn-submit-checkout class to the PayPal checkout button. When paired with PMPro core updates, this fixes issues where the PayPal button remained disabled after trying to checkout via the default gateway first.
* ENHANCEMENT: Changed "payment method" section to use div formatting instead of tables.
* ENHANCEMENT: Fixed cases where the plugin was active and the primary gateway was also set to PayPal or PayPal Express. Now shows a message to change the gateway setting or deasctivate the plugin.

= .3 =
* Fixed bug where payment fields could show up on the review page when checking out with PayPal Express.

= .2.2.1 =
* Fixed bug where PayPal button was sometimes showing up for free levels.

= .2.2 =
* Now checking if a discount code makes a level free when applied and adjusting the billing fields/etc.

= .2.1 =
* Now checking the pmpro_require_billing JS var to make sure we don't show the credit card fields when using other addons like pmpro-address-free-levels.

= .2 =
* Using different hook to add gateway option to checkout page.

= .1 =
* This is the initial version of the plugin.

pmpro-add-paypal-express's People

Contributors

andrewlimaza avatar github-actions[bot] avatar ideadude avatar ipokkel avatar kimcoleman avatar mircobabini avatar mjulian87 avatar sjolshagen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pmpro-add-paypal-express's Issues

PayPal requires Credit Card

After add pmpro-add-paypal-express plugin and select PayPal for pay the subscription the form requires Stripe form data, any idea?

Thanks!

Asterisk next to address fields disappear after clicking on PayPal button

Here’s how to reproduce the problem.

  1. Go to the page and click on the radio button for Check Out with PayPal
  2. Click on the button all the way at the bottom that says PayPal Check out (The safer, easier way to pay)
  3. Click on the radio button that says Check Out with a Credit Card

Now you will see all the asterisks are gone.

Related ticket: https://www.paidmembershipspro.com/forums/topic/asterisk-next-to-address-fields-disappear-after-clicking-on-paypal-button/

ENHANCEMENT: Reset to primary gateway when saving Paypal Express Option add-on settings

A user requested that when the PayPal Express Option add-on is active and configured on the system, any Payment Settings save operations always resets back to the primary/master payment gateway settings (the one selected/saved/active prior to navigating to the PayPal Express gateway in the "Payment Settings").

This is to avoid situations where they forget to (re)save the master/primary gateway on the Payment Settings page as the gateway to use after editing PayPal Express settings.

PayPal Express option is not showing for a donation only level.

Describe the bug
When a free level is set to accept donations, (PMPro Donations Add On), and the user selects to make a donation the option to select PayPal Express as a payment method is not displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Memberships > Settings > Levels and create a free level and enable accepting donations for this level.
  2. Go to the membership checkout page and select or enter a donation amount greater than 0
  3. Scroll down to notice that the "Choose Your Payment Method" section is not displayed and that only the default payment gateway is shown on the page in the "Payment Information" section

Screenshots

2023-10-04_06-45-23
2023-10-04_06-49-30

Expected behavior
PayPal Express is available as an optional payment gateway for donation-only levels.

Isolating the problem (mark completed items with an [x]):

  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

Paid Memberships Pro v2.12.3,
Add PayPal Express Add On v.6,
Donations v1.1.3

PayPal button disable bug

If you click the "Submit and Checkout" button with incorrect info, it correctly removed the "disabled" flag on the check out button, but it doesn't remove the "disabled" flag for the PayPal button. This needs to be changed in the main PM Pro plugin.

In preheaders/checkout.php, add this line to function stripeResponseHandler():
jQuery('input[type="image"]').removeAttr("disabled"); //Removes disabled from PayPal button

Additionally, I have problems with the "Billing Address" appearing with Stripe after you try to purchase with PayPal unsuccessfully. When you switch back to the Pay with credit card here" option the billing address shows even though it's set not to. I had to manually remove the jQuery.show() billing field.

Use with paypal standard.

Can it work with paypal standard? Some of my customers don't want to register for a paypal account, just want to pay via visa card.

pmpro_requirebilling

The radio fields are still showing when the pmpro_requirebilling fitler is false.

It works in the basic checkout.php when I don't have this enabled.

So, when I use a discount code that brings the total to $0, the "Choose Payment Method" with radio button options are still visible and they shouldn't be.

I've been messing around for a bit, but I can't figure it out.

PayPal Express vanished from PMPro Payment Settings page

I had installed “Add PayPal Express as an Alternate Payment Option at Checkout” and it was working fine. But after recent update it vanished. I tried removing the plugin and re-installing but though the plugin is active in plugins list…I don’t see PayPal Express settings in the PMPro Payment Settings page.

PayPal Express Checkout issue

Hello, some issues when paid with PayPal Express Checkout

== Paid Memberships Pro - Add PayPal Express Add On ==
Contributors: strangerstudios
Tags: pmpro, paid memberships pro, gateway, paypal, checkout, registration
Requires at least: 3.6
Tested up to: 4.7.2
Stable tag: .5.1

Warning: Creating default object from empty value in /home/my-domain/public_html/wp-content/plugins/pmpro-register-helper-fields/pmpro-register-helper-fields.php on line 482

Warning: Attempt to assign property of non-object in /home/my-domain/public_html/wp-content/plugins/pmpro-register-helper-fields/pmpro-register-helper-fields.php on line 483


Warning: strlen() expects parameter 1 to be string, object given in /home/my-domain/public_html/wp-content/plugins/paid-memberships-pro/includes/functions.php on line 691

Warning: substr() expects parameter 1 to be string, object given in /home/my-domain/public_html/wp-content/plugins/paid-memberships-pro/includes/functions.php on line 691

Warning: Cannot modify header information - headers already sent by (output started at /home/my-domain/public_html/wp-content/plugins/pmpro-register-helper-fields/pmpro-register-helper-fields.php:482) in /home/my-domain/public_html/wp-includes/pluggable.php on line 1210

	if($gateway == 'paypalexpress')
	{
		$AccountNumber->required = false;
		$ExpirationMonth->required = false;
	}

Should be possible to define which payment method use as default

To overcome this missing feature I had to manually edit the code.

But there is a weird case:

  1. Manually switch to Credit Card (which is not the default option anymore in my case)
  2. Use a valid card not enabled for online payments (wise.com virtual cards for testing purposes)
  3. Checkout -- page reloads with error "Your card was declined."
  4. Now the default payment method is selected and credit card filled data is lost.

Cancelling current subscriptions too early

If a user has an active subscription (paying with Stripe, most likely other gateways but I'm unable to test) and they go to change level, select 'Checkout with Paypal' but fail to complete payment, their Stripe subscription is cancelled regardless of whether the Paypal payment is completed or not.

Should the current subscription not be cancelled after confirmation of the new payment?

This obviously only happens with this plugin, as it requires multiple gateways, but the issue appears to come from the pmpro core code.

Payment button not re-enabled (fix included!)

When a user submits incorrect payment info with Stripe and the transaction fails, the "Submit" button is re-enabled but the PayPal button is not. This issue occurs when Stripe and PayPal are both allowed as checkout options.

The button is not enabled because the code found in stripeResponseHandler() does not not re-enable image type buttons. The current code is:

if (response.error) {
 // re-enable the submit button
jQuery('.pmpro_btn-submit-checkout,.pmpro_btn-submit').removeAttr("disabled");
…

This can be fixed by simply adding the image type to the attributes to enable with jQuery:

if (response.error) 
{
// re-enable the submit button and PayPal button
jQuery('.pmpro_btn-submit-checkout,.pmpro_btn-submit,input[type="image"]').removeAttr("disabled");
…

Bad card data still goes through

We've had some customers setting up accounts without actually being charged due to what we think is a bug in this add-on. We use the stripe gateway along with this paypal option. Customers will receive the account created email from PMPro but no confirmation of payment. This has happened multiple times and we think it is because users who have out-dated/bad card data in paypal are still able to proceed with checkout. See below for a comment from a user who kindly explained what happens:

"Ok no problem. I just noticed that there was a problem with the card in my paypal account.
Think there is a glitch when you sign up with paypal and the card information is out of date. Paypal sends an error but only after your website receives an ok so it seems."

Billing Information section hidden when switching gateway after checkout error

There is a bug where the "Billing Information" and "Payment Information" sections do not show on the screen when the user tried checkout via PayPal and then had checkout errors.

To recreate:

  • Partially complete checkout page
  • Select "Check out with PayPal
  • Click the button to submit / pay at PayPal
  • Error message appears that required fields are missing
  • Swap selection back to "Check Out with a Credit Card Here"
  • Billing and Payment Information fields do not display.

Invoice email not being sent

We have Stripe and this PayPal Express add-on for accepting payments on our site. Our members that pay with a credit card via Stripe all receive Invoice emails. However, all our members that pay with PayPal DO NOT have outgoing Invoice emails sent to them.

We also have the Email Templates addon to help manage the emails and the Invoice template is not disabled.

Can the PMP team please review this asap? We have received multiple disputes from members stating they never received an Invoice email which has resulted in us refunding them.

To help us verify this, we use the WordPress plugin MailPoet and SendGrid as our email gateway that logs all outgoing emails from our WordPress site.

Original payment method is submitted after entering a discount code

If a discount code is entered after selecting 'Check Out with PayPal', the payment is submitted to the original payment method.

Have only confirmed this with Stripe as the original payment method.

To recreate:

  • Select 'Check Out with PayPal'
  • Enter a discount code
  • Click the PayPal image
  • Response from Stripe: Could not find payment information

Discount code makes a level free

Applied this add-on and get it working with Paypal. After testing, it shows a payment has come through in the amount of agreed checkout price, but with $0 received. And the Paypal I used to make the payment shows no log history of the payment (probably because it was for $0).

This was from a discount code. What is the fix for the discount code problem. Thanks!

RESOLVED: it appears that Paypal takes a little while to actually pull the funds. Though my Paypal account showed a recurring payment of x amount, it still had a $0 transaction. Then the transaction for the x amount went through a little while later. So, if you run across the same issue, be patient and wait for Paypal to mosey on down the road to fulfill the payment. It won't work as fast as Authorize.net. But it will work.
High Five for this add-on!

Causes checkout to freeze

Installed plugin, set Paypal Express email and hit save. Then switched back to Stripe and hit Save. Went to Membership Levels, selected level that took me to checkout. I see two two radios for credit card and for paypal. However, the page is just "loading" and neither radio link works.

PMPRO: Version 1.8.8.3
Wordpress: 4.4.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.