PayPal Standard
On this page
PayPal Standard sends the customer to PayPal's own website to pay and then back to your order confirmation page. Customers pay with their PayPal account or any method PayPal offers them there. At checkout the option is labelled PayPal (in the admin it is called PayPal Standard). RestroPress does not show a card form for it.
The setup screen has changed from older versions. You no longer enter a PDT identity token or IPN settings in RestroPress. Instead you add REST app credentials and click Connect PayPal, and RestroPress pulls your merchant email and ID for you.
Before you start#
- A PayPal Business account, and for testing a sandbox business account and a sandbox personal (buyer) account from the PayPal developer dashboard.
- A REST app in the PayPal developer dashboard (Client ID and Secret). Use sandbox credentials for test mode and live credentials for live mode.
- Your site should use HTTPS.
Set up PayPal#
- In the PayPal developer dashboard open your REST app and enable Log in with PayPal. Under its advanced options enable Email, so that RestroPress can read your account email.
- Set the app's Return URL exactly to the address RestroPress shows you in the PayPal section. It is your site's
admin-post.phpaddress, for example:https://your-site.com/wp-admin/admin-post.php - In RestroPress go to Settings › Payment Gateways › General, tick PayPal Standard under Payment Gateways, optionally pick it as Default Gateway, and save.
- Open RestroPress › Settings › Payment Gateways › PayPal Standard (headed PayPal Standard Settings).
- Enter PayPal REST Client ID and PayPal REST Client Secret from the same PayPal app, then click Save Changes.
- Click Connect PayPal (the button reads Reconnect PayPal once connected). Sign in at PayPal and authorise. You return to the settings page with the notice "PayPal account connected successfully." and a line showing "Connected as ... in Sandbox mode" or "Live mode", plus your Merchant ID.
- The PayPal Merchant Email field ("Business merchant email used for checkout and display.") is filled in automatically. You can also type it.

RestroPress works out whether your credentials are sandbox or live by testing them with PayPal, and connects to the matching PayPal environment. Payments follow the Test Mode setting, so keep the two in agreement.
Test mode and going live#
- Tick Test Mode in Settings › Payment Gateways › General.
- Connect with sandbox credentials. Customers are sent to www.sandbox.paypal.com. Pay with your sandbox buyer account.
- Use a different PayPal account as the buyer than the one connected as merchant. Otherwise the order is refused with "Use a different PayPal buyer account. The connected PayPal merchant account cannot pay its own order."
- In test mode, if your store currency is INR, PayPal checkout is sent in USD instead (filter
rpress_paypal_sandbox_fallback_currencychanges this). Live mode always uses your store currency. - To go live: untick Test Mode, replace the Client ID and Secret with live credentials, click Connect PayPal (or Reconnect PayPal) again, and place one real order to confirm.
Return URL and IPN#
For every order RestroPress sends PayPal three addresses, so you do not configure IPN yourself:
- Return: your order confirmation page with
payment-confirmation=paypalandpayment-idadded. - Cancel: your failed-transaction page, with the order ID.
- Notify (IPN):
https://your-site.com/index.php?rpress-listener=IPN.
The IPN is what marks the order Paid. RestroPress checks every IPN message with PayPal (the ipnpb.paypal.com or sandbox equivalent) and ignores anything that is not verified. It then checks that the receiver matches your connected merchant ID or email, that the currency matches the order, that the amount is not lower than the order total, and that the invoice number matches the order's purchase key. IPN messages must be able to reach your site, so do not block that URL with a firewall, maintenance mode or a login wall. Also make sure IPN is not turned off in your PayPal account's notification settings.
What happens to the order#
- Placing the order. The order is saved as Pending and the customer is redirected to PayPal.
- Payment completed. The IPN with status Completed sets the payment status to Paid and adds the note "PayPal Transaction ID: ...". The ID is saved as the order's transaction ID and links to PayPal.
- Customer returns before the IPN arrives. The confirmation page shows the "payment processing" screen while the order is Pending or Processing. If the order has failed, the page says "Your payment could not be completed. Please return to checkout to try again." and does not clear the cart.
- Failed checks. A wrong receiver, currency, amount or purchase key sets the order to Failed with a note such as "Payment failed due to invalid PayPal business email." or "Payment failed due to invalid amount in PayPal IPN.", and logs an "IPN Error".
- Pending at PayPal. If PayPal reports Pending, the order stays unpaid and a note explains PayPal's reason (for example a payment that must be accepted manually in PayPal, or one under review). Only an eCheck sets the order to Processing.
- Refunded or reversed at PayPal. A full refund sets the order to Refunded with notes for the transaction and reason. A partial refund only adds the note "Partial PayPal refund processed: ...".
If Order Auto Accepted is on (RestroPress › Settings › General), PayPal orders are auto-accepted only after they are Paid.
Refunds#
Refund the payment in your PayPal account. If it is a full refund PayPal's notification updates the order to Refunded automatically. Changing the status in RestroPress does not send money back. The code also contains a PayPal API refund feature (a "Refund Payment in PayPal" checkbox next to the status), but it only appears if classic PayPal API credentials are stored for the order's mode, and the current settings screen has no fields for them. Treat refunds as done in PayPal.
Common problems#
- "PayPal merchant account is not configured. Reconnect your PayPal account in gateway settings." Neither a merchant email nor a merchant ID is saved. Click Connect PayPal.
- "Please add the PayPal REST Client ID and Client Secret before connecting." Fill both fields and save first.
- "Unable to complete PayPal token exchange. Check your client credentials and try again." The Client ID and Secret are from different apps, or the Return URL in the PayPal app does not match exactly. RestroPress also shows PayPal's own response under the notice.
- "Client Authentication failed. Verify the REST Client ID and Secret from the same PayPal app." The credentials are invalid for both sandbox and live.
- "PayPal connect session expired or is invalid. Please try connecting again." The authorisation took more than 15 minutes. Start again.
- "PayPal authorization was canceled.", "PayPal did not return an authorization code. Please try again.", "Unable to retrieve PayPal account details after authorization." Retry the connection.
- "PayPal authorized successfully, but email was not returned. Enable Email scope..." Enable Email under Log in with PayPal › Advanced Options, then reconnect, or type the email in PayPal Merchant Email and use the saved merchant ID.
- Orders stay Pending after paying. The IPN is not reaching your site or is not verifying. Check for "IPN Error" entries in the RestroPress gateway error log and that the notify URL above is reachable.
- Sandbox errors with INR. See the currency note above.
Developer notes#
- Filter
rpress_paypal_settingschanges the settings fields; filterrpress_paypal_redirect_argschanges the arguments sent to PayPal; filterrpress_paypal_urichanges the PayPal URL. - Filter
rpress_process_paypal_ipn_datachanges the incoming IPN data; filterrpress_paypal_web_accept_and_cart_datachanges it for web accept and cart payments; filterrpress_process_paypal_refund_datafor refunds. - Action
rpress_verify_paypal_ipnruns when the IPN listener is hit; actionrpress_paypal_web_accept(orrpress_paypal_followed by the IPNtxn_type) handles the message; actionrpress_gateway_paypalstarts the payment. - Filter
rpress_paypal_allowed_redirect_hosts, filterrpress_paypal_oauth_scopes, filterrpress_paypal_image_url, filterrpress_paypal_link_payment_details_transaction_id. - Refund filters and action:
rpress_paypal_refund_api_credentials,rpress_paypal_refund_body_args,rpress_paypal_refund_header_args,rpress_paypal_refund_request_argsandrpress_paypal_refund_purchase. - Option names without a settings field in this version:
paypal_identity_token(legacy PDT, still honoured if set),disable_paypal_verificationandpaypal_image_url.
