PayPal

paypal-gateway

The PayPal gateway is quick and easy to set up and as is available in a wide range of countries. You simply need a PayPal account.

If you don’t yet have one you can sign up for an account at https://www.paypal.com. You can opt for a personal or business account, depending on your needs. If you do choose the personal PayPal account it is recommended that you upgrade (free of charge) to the Premier account. PayPal provides this summary of PayPal account types.

Options

  • Live Switch – This option allows you to enable or disable this gateway, or for the purposes of testing, setting it to ‘Sandbox mode’. If you select sandbox mode you must provide sandbox credentials.

  • Email – This is the e-mail associated with your PayPal account. If you have set the gateway to ‘Sandbox mode’ this should be a sandbox PayPal account e-mail.

  • Page Style – PayPal allows you to customise the checkout page to better fit your site. From your PayPal account you can create a ‘page style’which sets various colours and images used on the checkout page. Provide the unique identifier for the style to use it in event booking checkouts. See [this tutorial][2] for more details.

  • Local site – The locale of the checkout page,

FAQ

I have pending bookings, but no payment was received.

If the customer submits a booking but abandons the order in PayPal, the order shows as ‘Pending’. If you are using the PayPal gateway it is recommended that you do not reserve pending bookings (see Settings > Event Organiser > Bookings).

Do I need an SSL certificate?

Payment data is collected an processed by PayPal and not your website. Installing an SSL certificate is not necessary, but strongly recommended.

Why are bookings not auto-confirming?

In this case, the PayPal Instant Payment Notifications (IPN) is failing. Please see the Debugging IPN issues section below.

Do customers need a PayPal account?

PayPal has an option that allows customers to check out without creating an account. The setting can be found inside of your PayPal account in the My Profile section. Go to My selling tools > Website Preferences, and turn on PayPal Account Optional. To learn more, see: PayPal’s Website.

Debugging PayPal Instant Payment Notifications (IPN)

PayPal are updating their live services on June 17, 2016 June 30, 2017 to improve security (Their sandbox service has already been updated). What you should do: Ensure your server supports HTTPS connections through CURL/fsockopen using TLS 1.2 or newer certificates. If you need help doing this please read this post.

After a booking has been paid for PayPal sends your site an IPN to confirm this. You can check the IPN history page for more information on IPN deliverability here: https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history

When Event Organiser receives an IPN it validates and verifies it with PayPal before processing the IPN. Typically the IPN will confirm the transaction, and the booking will be confirmed. If this does not happen there is could be due to one of a number of reasons:

  1. The IPN did not reach Event Organiser – this could be due to a block on traffic to the front-end of the site for logged out users (e.g. some ‘coming soon’ plugins) or any firewalls in place
  2. The IPN could not be authenticated – this means Event Organiser could not communicate with PayPal to verify the IPN. You should check your server’s outgoing port 443 open. You should also be aware of the changes PayPal is making on June 17, 2016 June 30, 2017 and the implication that has for you (see above).
  3. The IPN did not confirm the transaction – If the currency you have set in Event Organiser does not match your PayPal currency than PayPal will request you manually approve the purchase. Event Organiser will not confirm the booking until you do. It is recommend to make sure the currency you set matches your PayPal account (and this may be different depending whether you’re in sandbox or live mode).

Debugging steps

1. Are you testing locally? If you are testing locally, on MAMP for example, PayPal is unable to send an IPN to your site. This is normal.

2. Do you get the message “There’s a problem with the merchant’s PayPal account” This occurs if the PayPal e-mail you provided does not match a PayPal account. Please check the e-mail provided.

3. Can your site communicate securely with PayPal? To check this please follow the advice on this post.

4. Are you using any plugins to block incoming traffic, e.g. a ‘coming soon plugin’ This plug-in may be preventing PayPal’s IPN from reaching the Event Organiser.

5. Does the booking have a transaction number? If the booking has a transaction number next to the booking ID in the booking admin screen as shown here, then this means an IPN was received, validated and acted on. paypal-transaction-idIf the booking is still pending this could be because PayPal requires approval from you to complete the transaction. Typically this occurs when the currency you have selected in Event Organiser does not match that of your PayPal account.

6. Enable logging Set WP_DEBUG to true in your wp-config.php:

define( 'WP_DEBUG', 'true' );

(WP_DEBUG will typically already be defined in your configuration file, but set to false). You should then check your error logs.