Skip to main content

The PayPal payment plugin lets guests pay for their booking on your site, through PayPal's buttons. With the PayPal button, the guest signs in to PayPal in a PayPal window and approves the payment. With the Debit or Credit Card button, they pay by card in PayPal's own form below the buttons, without a PayPal account. The payment is then taken and the booking is confirmed. Each property has its own PayPal settings, so each property can be paid into its own PayPal account. From PayPal 2.2.0 with Solidres 4.9.0, PayPal can also save the guest's card or PayPal account to secure the booking instead of charging it, and you charge it later: see How the card guarantee works.

PREREQUISITES:

  • Solidres 4.3.0 or later. This article describes Solidres 4.6.0 and later, where the settings are on the property's Pricing & payments tab.
  • The PayPal plugin, version 2.0 or later, available to Solidres subscribers. It is a download of its own, not part of the Solidres package. This article describes version 2.1.0, which shows PayPal's buttons on your site, and says what was different before it.
  • A PayPal Business account. A personal account cannot create the API credentials the plugin needs.
  • A server that may open HTTPS connections to PayPal (api-m.paypal.com, and api-m.sandbox.paypal.com for testing).

On this page:

  1. Get your PayPal API credentials
  2. Install and enable the plugin
  3. Set up PayPal for a property
  4. If your site sends security headers
  5. Test with the sandbox, then go live
  6. What happens when a guest pays
  7. Troubleshooting
  8. Upgrading from an earlier version

UPGRADING: Up to version 2.0.2, the plugin sent guests to PayPal's site to pay. Version 2.1.0 shows PayPal's buttons on your site instead, with the same PayPal settings; a site that sends a Content Security Policy must allow PayPal in it. Version 1.x used PayPal Payments Standard with your PayPal e-mail address, where version 2.0 and later need a Client ID and a Secret. See Upgrading from an earlier version.

1. Get your PayPal API credentials

The plugin talks to PayPal through an app in your PayPal developer account. An app has a Client ID and a Secret, and you need one pair for live payments and one for testing in the sandbox.

  1. Go to the PayPal Developer Dashboard and log in with your PayPal Business account.
  2. Open Apps & Credentials. The switch at the top chooses between Sandbox and Live: each has its own apps and credentials.
  3. With Sandbox chosen, use the default app PayPal created for you, or click Create App, give it a name (your site's, for example), choose the type Merchant and create it.
  4. Copy the app's Client ID and its Secret (PayPal may call it Secret key 1). These are your sandbox credentials.
  5. Switch to Live and do the same to get your live credentials.

Keep the Secret private: with the Client ID, it lets anyone take and refund payments on your PayPal account. If it leaks, generate a new one for the app in the dashboard and enter it in Solidres. The Client ID alone is not secret: PayPal's buttons need it, so it is part of your payment page.

2. Install and enable the plugin

If PayPal is already listed under Payment methods on your property, the plugin is installed and enabled; go to the next step.

  1. Download the PayPal plugin from your account on solidres.com.
  2. In your Joomla administrator, go to System → Install → Extensions and upload the zip file.
  3. Go to System → Manage → Plugins, search for PayPal and make sure Solidres - PayPal plugin (REST Orders API) is enabled.

From PayPal 2.0.1, later versions are listed in System → Update and install from there, using the Download ID in Solidres Options.

3. Set up PayPal for a property

Open the property in Solidres → Properties, go to its Pricing & payments tab and open the PayPal panel under Payment methods, beside the other payment methods installed on your site. The settings are:

SettingWhat it does
Enable PayPalOffers PayPal to guests booking this property.
DefaultMakes PayPal the payment method that is already chosen on the booking form. One method that is turned on must be the default.
Payment actionFrom PayPal 2.2.0. Charge now, the default, takes the payment when the guest books, as this article describes. Save the card or account, charge later, with Solidres 4.9.0, saves the guest's card or PayPal account at PayPal and charges nothing, or only the deposit: you charge it later from the booking. PayPal must have approved your account for it, and saving the settings asks PayPal and says what it answered. See How the card guarantee works.
Front end messageThe text guests see when they click the question mark beside PayPal in the list of payment methods. From PayPal 2.1.0 the default is Pay with your PayPal account or with a debit or credit card on the next page. A property saved with an earlier version keeps its text: if it says the guest is sent to PayPal, change it.
Client ID and Secret IDYour live app's Client ID and Secret.
Enable sandboxSends payments to PayPal's sandbox, where no real money moves. It is on by default: turn it off when you go live.
Sandbox Client ID and Secret IDYour sandbox app's Client ID and Secret. Shown while Enable sandbox is on.
Cancel redirect pageThe menu item a guest is sent to when they cancel the booking on the payment page or at PayPal. Leave it empty to send them to your home page.
Cancel messageThe message shown to a guest who cancelled. Leave it empty for the default: Your reservation number … at … has been successfully cancelled. You can use placeholders such as [CODE], [CUSTOMER_FIRSTNAME] and [RESERVATION_ASSET_NAME].

Only the credentials of the mode the property is in are used: the sandbox pair while Enable sandbox is on, the live pair while it is off. Save the property, and drag the payment method panels if you want PayPal shown higher or lower in the list guests see.

NOTE: From PayPal 2.1.0 with Solidres 4.8.0, PayPal is not offered to guests, on the booking form or through the public booking API, until the property has a Client ID and a Secret for the mode it is in. Before that, guests could choose PayPal on a property that was not set up, and then could not pay.

There is nothing to choose about the buttons: PayPal shows each guest the ways to pay it offers in their country, as described in step 6. Cards are paid through PayPal, in PayPal's form, so no card details reach your site.

With the Hub: partners set up PayPal for their own properties, with their own PayPal accounts, from the property form on the front end, as long as Front end payment method manage is on in Solidres Options, tab Hub (it is by default). Turn it off if only you should manage payment methods, from the administrator.

Tours: the Experience add-on has its own PayPal payment plugin, set up on each experience's Payments tab with the PayPal e-mail address of your business account. See How to configure Experience. This article is about bookings of rooms.

4. If your site sends security headers

Most sites can skip this step. It is for a site that sends a Content Security Policy or a Cross-Origin-Opener-Policy, from Joomla's System - HTTP Headers plugin, the web server or a CDN. PayPal's buttons are PayPal's script and frames on your page, and these headers decide whether the page may load them and keep in touch with PayPal's window.

  • Content Security Policy: allow *.paypal.com, *.paypalobjects.com and *.venmo.com in script-src, style-src, connect-src, frame-src, child-src and img-src, as PayPal's guide for its buttons lists them. PayPal's card fields, on the page of a booking secured with the card guarantee (PayPal 2.2.0), need the same sources. With the HTTP Headers plugin's nonce on, the PayPal plugin gives PayPal's script the nonce too. Without these sources, guests see only a Continue to PayPal button and pay on PayPal's site, as with earlier versions: payments still work, but not on your page.
  • Cross-Origin-Opener-Policy: PayPal's window needs same-origin-allow-popups, or no policy. The HTTP Headers plugin sends same-origin by default, so on the payment page PayPal 2.1.0 turns it into same-origin-allow-popups, and the rest of your site keeps same-origin. A policy your web server or CDN sends itself is out of the plugin's reach: if it is same-origin, change it to same-origin-allow-popups. Otherwise guests see PayPal over the page with an empty window beside it, and must close that window to pay.

5. Test with the sandbox, then go live

  1. With Enable sandbox on and the sandbox credentials entered, make a booking on your site and choose PayPal. The next page shows PayPal's buttons, which in the sandbox take only test accounts and test cards.
  2. The PayPal button: click it, and in PayPal's window log in with a sandbox personal account. PayPal creates one for you: find its e-mail address and password in the Developer Dashboard under Testing Tools → Sandbox Accounts. Approve the payment. The page says Confirming your payment…, then shows the booking's confirmation, and the booking is confirmed in Solidres → Reservations, with the payment in its payment history.
  3. The card button: make another booking, click Debit or Credit Card, and pay with a test card from PayPal's Card testing page, such as the Visa 4012 0000 3333 0026, with any future expiry date and any three-digit security code. The booking is confirmed the same way.
  4. Closing and cancelling: start a third booking, click the PayPal button and close PayPal's window. The page says you closed PayPal before paying, and the buttons are still there. Then click Cancel this booking: the booking is cancelled and you see the cancel message.
  5. The card guarantee (from PayPal 2.2.0, with Payment action set to Save the card or account, charge later, on a sandbox business account PayPal lets save cards): book, tick the box under the terms, and on Secure your booking save the test Visa in PayPal's card fields with Save the card. The booking is confirmed, nothing is charged, and its Payment history tab shows the card. See How the card guarantee works.
  6. When everything works, enter the live Client ID and Secret ID, turn Enable sandbox off and save the property.

If PayPal opens over the page with an empty window beside it, see step 4.

6. What happens when a guest pays

  1. The guest completes the booking form with PayPal chosen. The booking is saved with the Default reservation status from Solidres Options, and the next page, Pay for your booking, shows the booking's code, the amount to pay now, PayPal's buttons and a Cancel this booking link.
  2. The amount is what the guest pays online: the deposit when the property takes one, otherwise the booking total, with the payment method's surcharge or discount. The tourist tax collected at the property is not included.
  3. PayPal chooses the buttons for each guest, by their country and device: the PayPal button, the Debit or Credit Card button, and other ways to pay that PayPal offers there, such as Pay Later.
    • PayPal: PayPal opens in a window of its own, where the guest signs in and approves the payment. Where the browser does not allow the window, PayPal opens over the page instead.
    • Debit or Credit Card: PayPal's card form opens below the buttons, filled in with the guest's name, e-mail address and address from the booking. The guest needs no PayPal account.
    PayPal shows your property's name as the one being paid, with the booking's code, and asks for no shipping address. The payment carries the same description in your PayPal account.
  4. Once the guest has approved, the page says Confirming your payment…. Only then does Solidres ask PayPal to take the money, and check that PayPal's answer is for this booking and for the right amount.
  5. When the payment is complete, the booking gets the Confirmation reservation status and the Confirmation payment status from Solidres Options (tab Reservation), the payment is added to its payment history, and the guest lands on the booking's final page, from which the booking e-mails are sent.

Other outcomes:

  • The guest closes PayPal's window without paying: they stay on the page, which says You closed PayPal before paying. Your booking is saved but not paid yet: choose a way to pay to complete it. They can pay again with any of the buttons. Until they do, the booking keeps its default status, unpaid.
  • PayPal reports an error, for example when the page was left open for hours: the page says PayPal could not take the payment. Start it again, or continue on PayPal's site. Start the payment again opens the page again with a new payment (with Solidres 4.6.0 or later), and Continue to PayPal takes the guest to PayPal's site.
  • PayPal's buttons cannot be shown, because the guest's browser blocks PayPal's script or your site's Content Security Policy does not allow it: the page shows a Continue to PayPal button instead. The guest pays on PayPal's site, with PayPal or by card, and comes back to your site, where the payment is taken as above.
  • The guest cancels: with Cancel this booking on the payment page, or by cancelling on PayPal's site, the booking gets the Cancellation reservation status and Cancellation payment status, and the guest goes to the Cancel redirect page with the Cancel message. Cancelling on PayPal's site works from Solidres 4.8.0; before it, the booking stayed with its default status, unpaid, and the guest landed on your home page.
  • Payment held for review by PayPal: the booking gets the Pending reservation status and Pending payment status, and no payment is recorded, because the money is not in your account yet. PayPal does not tell your site when it is released: check your PayPal account, and when the money arrives, confirm the booking and add the payment to its payment history yourself.
  • Less than the amount due: the payment is recorded, and the booking stays pending until you settle it with the guest.
  • With Payment action set to Save the card or account, charge later (from PayPal 2.2.0 with Solidres 4.9.0): the guest agrees to the terms on the booking form, and the next page, Secure your booking, has PayPal's button, to save their PayPal account, and PayPal's card fields, to save a card. Nothing is charged, or only the deposit. Once PayPal has saved it, the booking is confirmed and holds its room, and the confirmation e-mail repeats the terms. A booking PayPal saved nothing for stays unconfirmed, holding no room. You charge it later from the booking. See How the card guarantee works.
  • The guest leaves after approving, before your site has taken the payment (they close the page at once, or never come back from PayPal's site): PayPal does not take the money, because it is taken only when the guest's browser reaches your site. The booking stays with its default status and unpaid.

With the Invoice add-on, a guest paying one of their invoices online can pay it with PayPal too. An invoice is paid on PayPal's site rather than with the buttons, and the guest comes back to the invoice. From PayPal 2.1.0 the payment is taken and added to what the booking was paid before, the booking is confirmed once its total is paid, and you receive the payment e-mail; with PayPal 2.0 to 2.0.2 the guest approved the payment at PayPal, but it was never taken. Refunds are made in your PayPal account: the plugin does not send them.

7. Troubleshooting

The plugin writes what it sends to and receives from PayPal to solidres_paypal.php in your site's log folder (administrator/logs by default), with PayPal's reason when something is refused. Look there first. For the payment page itself, the browser's console (F12) says what it could not load.

  • PayPal is not offered on the booking form: check that the plugin is enabled, that Enable PayPal is on for the property, and, from PayPal 2.1.0 with Solidres 4.8.0, that the property has a Client ID and Secret for the mode it is in.
  • After booking, the guest lands on the booking's final page, told the payment is not complete: PayPal could not be reached, refused the credentials, or refused the payment, for example in a currency it does not take. Check that the credentials match the mode (sandbox credentials work only with Enable sandbox on, live ones only with it off) and that the property's currency is one of the currencies PayPal supports. The booking is kept unpaid. Before PayPal 2.1.0, the guest saw an error page.
  • The payment page shows only a Continue to PayPal button: the guest's browser could not load PayPal's script from www.paypal.com. Your site's Content Security Policy may not allow PayPal (see step 4), or the guest's browser blocks it, with an ad or script blocker for example. Guests can still pay with the button, on PayPal's site.
  • PayPal opens over the page, with an empty window beside it: your site sends Cross-Origin-Opener-Policy: same-origin from the web server or a CDN. Change it to same-origin-allow-popups, as in step 4.
  • The Debit or Credit Card button is missing: PayPal decides for each guest whether to offer it, by their country and its own checks, so not every guest sees it. If none of your guests ever does, check in your PayPal Business account that PayPal account optional is on, under Account Settings → Website payments → Website preferences.
  • PayPal refuses an amount with too many decimals: a booking total can come out with more than two decimals, from an extra priced at 7.065 for example. From PayPal 2.1.0, the amount is rounded to the cent, or to the whole unit in the Hungarian forint, Japanese yen and New Taiwan dollar, which PayPal takes only that way. Update the plugin.
  • Saving the property says PayPal does not let this account save cards, or PayPal accounts (PayPal 2.2.0, with Save the card or account, charge later): PayPal has not approved your account for it, and says why. Guests are offered only what PayPal allows, and while it allows neither, PayPal charges guests when they book. See What to ask PayPal for, then save the property again.
  • The log has lines with access_token: PayPal 2.0.1 and earlier wrote the access token PayPal gives your site to the log. Update to 2.0.2 or later, then delete solidres_paypal.php or remove those lines from it.

8. Upgrading from an earlier version

From PayPal 2.0.x: update the plugin from System → Update. Your PayPal settings and credentials stay as they are, and guests pay on your site from then on. Three things to check:

  1. The Front end message of each property that takes PayPal: if it says the guest is sent to PayPal, change it, to the new default for example (step 3).
  2. If your site sends a Content Security Policy or a Cross-Origin-Opener-Policy, follow step 4.
  3. Make a booking in the sandbox, or a small live one, and pay it with the buttons.

From PayPal 1.x: PayPal 1.x sent guests to PayPal Payments Standard with your PayPal e-mail address and was told about payments through PayPal's IPN messages. PayPal 2.0 and later replace that with the REST API, so after installing over 1.x:

  1. Get a Client ID and Secret for live and sandbox, as in step 1.
  2. Enter them in every property that takes PayPal, and check Enable sandbox: turn it off for properties that take live payments.
  3. Optionally, turn off Auto Return and the IPN notification URL you set up in your PayPal account for 1.x: version 2.0 and later do not use them. Leave them on if another application on the same PayPal account needs them.

From PayPal Pro: the PayPal Pro plugin, which took card details on your site, is no longer offered or developed. Move to this plugin: its Debit or Credit Card button takes cards on your page, in PayPal's own form, so card details never reach your site. Set PayPal up for each property as in step 3, turn PayPal Pro off in each property's payment methods, then disable the PayPal Pro plugin.

All the things you need to make your work easier. Did you like Solidres?