Contents

PayPal - Plugixa Car Rental

PayPal PRO is a payment method that sends the customer to PayPal to pay, with their PayPal balance or a card, and brings them back to their booking once they have approved the payment. Customers see it as PayPal: “Pay now with PayPal. Your booking is confirmed as soon as the payment goes through.”

Set it up under Plugixa Car Rental -> Settings -> PayPal. Everything on Payments about the payments ledger, refunds and payment statuses applies to PayPal payments too.

PayPal is an app, on by default in Pro. If the PayPal section is missing from Settings, switch it on in the App manager.

The PayPal settings: the Offer PayPal and Sandbox switches, the client ID and secret, then the webhook card with its address, events and webhook ID

Setting it up

1. Create a REST API app at PayPal

In the PayPal Developer dashboard, create a REST API app. It gives you a Client ID and a Secret. A sandbox app and a live app have different credentials.

2. Enter the credentials

The first card is Payments by PayPal: “The customer pays on PayPal and is brought back to their booking, which is confirmed as soon as the payment goes through.”

Field Default Notes
Offer PayPal Off The switch that offers PayPal to customers. Saved with the page’s Save button.
Sandbox (test) account Off “Switch on while testing with sandbox credentials. No real money moves.” On, every call goes to PayPal’s sandbox; off, to the live PayPal. Saved with the page’s Save button.
Client ID “From a REST API app in the PayPal Developer dashboard.”
Secret The app’s secret.

Press Save keys under the two credentials. Both are needed. With the switch on and either missing, the screen warns: “PayPal is switched on but its client ID or secret is missing, so customers are not offered it yet.”

The Sandbox switch must match the credentials. Sandbox credentials with the switch off (or live ones with it on) are refused by PayPal, and customers see “The PayPal payment could not be started. Please try again, or choose another way to pay.”

3. Add the webhook

The second card is Webhook: “Lets PayPal confirm a payment even when the customer never comes back, and tells the site about refunds made at PayPal and disputes.”

  1. Copy the Webhook address shown on the card with the copy button beside it. It is built from your site’s own address and ends in /payment/webhook/paypal. Always copy it from this screen rather than typing it.

  2. In your PayPal app, add a webhook with that address.

  3. Subscribe it to the events listed under Events to send:

    Event What the plugin does
    CHECKOUT.ORDER.APPROVED The customer approved but never came back: the plugin captures the payment itself and records it
    PAYMENT.CAPTURE.COMPLETED Records the payment, including one that was pending at first
    PAYMENT.CAPTURE.DENIED Records a Failed row
    PAYMENT.CAPTURE.PENDING Nothing recorded; announced as processing
    PAYMENT.CAPTURE.REFUNDED, PAYMENT.CAPTURE.REVERSED Records a refund made at PayPal once it has completed
    CUSTOMER.DISPUTE.CREATED, CUSTOMER.DISPUTE.RESOLVED Nothing recorded; announced

    “Announced” means the action plugixa_car_rental_payment_notice fires with payment_processing, refund_failed, dispute_opened or dispute_closed. See Hooks.

  4. PayPal shows the new webhook’s ID. Paste it into Webhook ID and press Save keys.

Do this once in the sandbox app and once in the live app: each has its own webhook and its own ID.

4. Test

With Sandbox (test) account on and sandbox credentials saved, make a booking through the booking form and pay with a sandbox buyer account. Then switch the sandbox off and replace the credentials and the webhook ID with the live ones.

How the keys are kept

The client ID, the secret and the webhook ID are encrypted before they are stored and are never sent back to the browser. A saved one shows a “Stored” placeholder and a Remove button. Type into the field and press Save keys to replace it.

What the customer sees

  1. On the details step of the booking form the customer chooses PayPal among the payment methods you offer, and, if Pay part now PRO is on, how much to pay now.
  2. The booking is saved as Pending and the car is held for 35 minutes. Then the customer is sent to PayPal.
  3. PayPal shows “Car rental” followed by the booking reference, for the amount due now, with a Pay Now button.
  4. Back on your site, the payment is captured and the customer sees “Thank you. Your payment for booking ADR-2026-0001 was received; the confirmation is on its way by email.”

If the customer cancels at PayPal, they return to “You left the payment page, so nothing was charged and booking ADR-2026-0001 is not confirmed.”

How a payment is confirmed

With PayPal, the customer approves the payment and your site then captures it, which is the moment the money moves. That happens in one of two ways:

Route What happens
The customer’s return PayPal sends the browser back with the order’s id. The plugin captures the order and records the payment if PayPal reports the capture completed.
The webhook If the customer never comes back, CHECKOUT.ORDER.APPROVED arrives and the plugin captures the order then.

Capturing twice is safe: if the order was already captured, the plugin reads it instead. The payment is recorded once, under PayPal’s capture id, with the amount PayPal reports. Once it is recorded, a pending booking is Confirmed.

A capture that is still pending at PayPal (an eCheck, or a payment under review) is not recorded on return. It is recorded when PAYMENT.CAPTURE.COMPLETED arrives, so for those payments the webhook is required.

If the car was booked by somebody else while the customer was at PayPal, the money is still recorded, and the booking is left for you to refund or rebook. The action plugixa_car_rental_payment_unplaced fires.

Without a webhook ID

Every webhook is checked with PayPal before it is believed, and that check needs the webhook ID. Without it, every webhook is ignored, and payments are recorded only when the customer comes back to your site. Set the webhook ID.

Refunds

A refund of a PayPal payment made from the booking’s payments panel is sent to PayPal against the capture and recorded with PayPal’s refund id. If PayPal refuses it, nothing is recorded and PayPal’s message is shown, or “PayPal did not make the refund.” A refund made at PayPal arrives by webhook and is recorded against the booking once it has completed.

Amounts and currencies

  • The currency is the booking’s own: your store currency, or the customer’s chosen one if Currencies PRO charges in it. It must be a currency PayPal supports.
  • Amounts are sent with two decimals, except HUF, JPY and TWD, which are sent as whole numbers.

What is sent to PayPal

The plugin talks to PayPal’s API (its sandbox in test mode) from your server, when a payment starts, when it is captured, when a webhook is checked and when you refund.

When a payment starts
Amount and currency The amount due now
Booking reference In the description and the invoice id
Booking id and payment type As the custom id, so the payment can be matched to its booking
Return and cancel addresses On your site

A refund sends the capture’s id and the amount. No customer name, email, phone, address or licence is sent by the plugin. What the customer enters at PayPal goes to PayPal directly. See Privacy and uninstall.

Quick Links