PayPal

Payments through PayPal Checkout: the customer approves the payment on PayPal's page, and the shop captures it at once. Refunds go through PayPal, and the shop sets up the webhook itself.

Setup

  1. Install the package, update the database and enter the licence key under System → Licences.
  2. Log in at developer.paypal.com with your business account, create an app of the type Merchant under Sandbox → Apps & Credentials, and copy the client ID and secret. Testing Tools → Sandbox Accounts lists a buyer account for test payments.
  3. Under Payment methods, create a method of the type PayPal: mode (sandbox or live, matching the app), client ID and secret. Assign it to the shop and publish it.

The secret is not shown again after saving; leave the field empty to keep it. Which ways to pay PayPal shows on its page – balance, card, bank account, pay later – is PayPal's decision.

The webhook

Through the webhook, PayPal reports payments, refunds and reversals. Saving the payment method sets it up, under the domain of a start point that offers the method; the edit mask shows whether it is set up and, if not, why.

  • The start point needs a domain, and the shop must be reachable from the internet.
  • One app may serve several shops and domains of the same installation; it takes up to ten webhooks. When it is full, saving says so.
  • After a domain change, save the payment method again; the start page warns until you do. Delete the old webhook in the PayPal dashboard unless another installation uses it.
  • A copy of the shop (staging) may use the same app, provided no start point of the copy keeps a domain of the original – otherwise it would capture the original's payments too. Safest: a sandbox app of its own for the copy.

Going live

Create a live app, then set the payment method to mode Live with the live app's client ID and secret and save it – that sets up the webhook for the live app. Before you open the shop, make a small real payment and refund it.

Change the app only when no PayPal payment is open: the shop then speaks to the new app only, so refunds of earlier orders are made in the PayPal account and marked Settled by hand.

What happens with a payment

  • The customer approves at PayPal and comes back to the order page; the shop captures the payment and books it once PayPal confirms – through the webhook or when the shop asks.
  • If the customer does not come back, the webhook captures the payment all the same. PayPal takes the money once.
  • Cancelling at PayPal leads back to the choice of payment method.

Follow-up orders of subscriptions paid with PayPal are always billed “on account”; automatic charging is planned.

Refunds and reversals

  • Refund at a received payment pays back through PayPal, in full or in part; withdrawals offer the same. The shop asks about a pending refund every hour.
  • If PayPal does not answer, nothing is sent twice: check the PayPal account and mark it Settled by hand.
  • Refunds made directly in the PayPal account arrive through the webhook and are listed under Follow-ups.
  • The shop books a reversal against the payment; under Follow-ups, Request payment asks the customer to pay again. Disputes that have not moved money yet are not reported by PayPal.

Notes on the start page

  • Sandbox mode on a published method: payments run in the test environment and take no money.
  • Licence not valid: the method is no longer offered at checkout. Payments under way, notifications and refunds go on.
  • Webhook missing, deleted at PayPal or pointing to an old domain, or no domain at the start point: payments are confirmed late. Follow the note in the payment method's edit mask.

In HUF, JPY and TWD PayPal takes whole amounts only; set prices and shipping costs in whole amounts there.

← Mollie