2026年11月12日
2026年11月12日
WooCommerce PayPal Setup: Connect PayPal Payments and Test in Sandbox
This article is a localized edition of the Japanese original. Read the Japanese original
To accept PayPal payments in WooCommerce, use "WooCommerce PayPal Payments," the free official plugin developed and provided by PayPal. Besides PayPal buttons, it can show credit and debit card fields and Apple Pay and Google Pay, if your region and account qualify. This article was checked against the PayPal Payments documentation on WooCommerce.com and the plugin as distributed on WordPress.org (version 4.2.2) as of November 2026.
What you need
| Item | Requirement |
|---|---|
| WordPress | 6.5 or later |
| WooCommerce | 9.6 or later (installed and activated) |
| PHP | 7.4 or later |
| PayPal | A Business account is recommended. Personal accounts can sell only in some regions and cannot use card fields (Advanced Card Processing), Apple Pay, Google Pay, and similar features |
If a store in Japan accepts Japanese yen (JPY), note that PayPal treats JPY as a currency with no decimal places. In the currency options under WooCommerce → Settings → General, set the number of decimals to 0.
Install the plugin
- In the admin, go to Plugins → Add New Plugin, search for "WooCommerce PayPal Payments," and install and activate the one whose author is PayPal.
- After activation, a link to the settings screen appears. You can also open the PayPal settings from the list under WooCommerce → Settings → Payments.
With WP-CLI:
wp plugin install woocommerce-paypal-payments --activate
Connect in sandbox (test environment) first
Before moving real money, test in the PayPal sandbox.
Prepare sandbox accounts
- Log in to PayPal Developer with your PayPal account.
- Open the list of sandbox accounts on the dashboard. A test Business account (seller) and a Personal account (buyer) are provided. Create them if they are missing.
- Note each account's email address and password. Sandbox accounts are separate from real PayPal accounts.
Connect to WooCommerce
- On the PayPal Payments settings screen, open "See advanced options."
- Turn on "Enable Sandbox Mode," click "Connect Account," log in with the sandbox Business account, and allow the connection.
- If the automatic connection does not work, create a REST API app in PayPal Developer and enter the sandbox Client ID and Secret it shows in the "Manual Connect" fields to connect.
Place a test order
- While logged out (or in another browser), add a product to the cart and click the PayPal button at checkout.
- Log in with the sandbox Personal account (buyer) and pay.
- Under WooCommerce "Orders," confirm that the order status becomes "Processing" ("Completed" for downloadable products and the like).
- Test refunds as well. Click "Refund" on the order screen and confirm that the refund goes through PayPal.
If the status stays at "Pending payment," notifications from PayPal (webhooks) may not be arriving. See "When it does not work" below.
Connect your live account
When testing is done, disconnect the sandbox and connect your live account.
- On the PayPal Payments "Settings" tab, remove the sandbox connection with "Disconnect."
- Click "Activate PayPal Payments" on the settings screen.
- Choose the account type (Business Account or Personal Account).
- Choose the types of products you sell (Virtual Products / Physical Goods, plus Subscriptions if you sell subscriptions). Subscriptions require WooCommerce Subscriptions.
- Choose the payment methods to use (Custom Card Fields, Digital Wallets, and so on).
- Click "Connect to PayPal," log in with your live PayPal Business account, and allow the connection.
After connecting, it is reassuring to make one real payment for a low-priced product and confirm the refund as well.
Settings screen tabs
| Tab | Main contents |
|---|---|
| Overview | Connection status, next steps, and settings buttons for each feature |
| Payment Methods | Turn payment methods on or off (PayPal, cards, Apple Pay, Google Pay, and others) |
| Settings | Connection details and disconnecting, invoice number prefix (Invoice Prefix), how payments are captured (Order Intent), logging, webhooks |
| Styling | Where buttons appear, and their shape, color, and label |
Enter a different value for each store in "Invoice Prefix" on the Settings tab (for example, SHOP1-). If several stores use the same PayPal account, order numbers can collide and payments may be rejected.
Button placement and appearance
On the "Styling" tab, choose where PayPal buttons appear: Cart, Classic Checkout, Express Checkout, Mini Cart, and Product Page. You can also change the shape (rectangle or pill), label, and color (Gold, Blue, Silver, Black, White).
With buttons on product pages or the cart, buyers can pay with PayPal without typing their address on the checkout screen. For stores with complex shipping calculations, showing the button only on the checkout screen causes less confusion.
When it does not work
- Turn on "Logging" on the "Settings" tab, reproduce the problem, then open WooCommerce → Status → Logs and check the
woocommerce-paypal-paymentslog. Logs are kept for 30 days. - If order statuses do not change, click "Resubscribe" in the webhook section of the "Settings" tab to register again, and use "Simulate" to send a test notification. Notifications also fail to arrive if the site is behind Basic authentication or a firewall blocks access from PayPal.
- If the PayPal button does not appear at checkout, exclude PayPal's scripts in the settings of caching or JavaScript optimization plugins and check again.
For narrowing down payment errors in general, see also "How to check why WooCommerce payments fail."
Check the configuration from PHP
With WP-CLI you can list the registered payment methods and whether each is enabled. In PayPal Payments, the PayPal button's ID is ppcp-gateway and the card fields' ID is ppcp-credit-card-gateway.
wp eval 'foreach ( WC()->payment_gateways()->payment_gateways() as $id => $gateway ) { echo $id . "\t" . $gateway->enabled . PHP_EOL; }'
The PayPal transaction ID is stored as the WooCommerce order's transaction ID. In PHP, get it with wc_get_order( $order_id )->get_transaction_id(). Order data may be stored in WooCommerce's own order tables (HPOS), so use this function instead of reading wp_postmeta directly.
If you still use the old PayPal Standard
"PayPal Standard," which used to ship with WooCommerce, stopped appearing for new stores from WooCommerce 5.5, and WooCommerce recommends moving to PayPal Payments. According to the WooCommerce developer blog (June 2026), with PayPal Payments 4.1.0 and later, connecting an account automatically disables and hides PayPal Standard.
- If you have subscriptions (WooCommerce Subscriptions) paid through PayPal Standard, PayPal Standard is left in place and you are notified of the affected subscriptions. Subscriptions are not migrated automatically, so check with WooCommerce support before proceeding.
- Before migrating, you can use the "Upgrade Readiness Tool" in the WooCommerce.com documentation to review your current setup and possible problems.
- If PayPal Standard and PayPal Payments are both enabled, PayPal appears twice at checkout, so keep only one.
Notes
- PayPal fees, available payment methods (Pay Later is not available in Japan), and whether you can use card fields depend on your country and account. Check your PayPal account and PayPal's official information.
- After switching to live, confirm that no sandbox Client ID or Secret remains and that the connection status on the Settings tab no longer shows Sandbox.
- Overall store setup is covered in "WooCommerce initial setup."
Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)