How to implement PayPal recurring payments in Magento 2?

A convenient way to set recurring payments through PayPal is the Subscriptions & Recurring Payments extension. To set up this function with the help of the extension, do the following:
Step 1. Navigate to Stores > Configuration > Sales > Payment Methods > PayPal Express Checkout > Configure.

Step 2. Fill in the following data (you can get credentials from PayPal):

  • Email Associated with PayPal Merchant Account
  • API Username, Password, and Signature.

Step 3. Enable Sandbox Mode and sign in with your PayPal credentials.

Step 4. Choose whether you want to enable API Uses Proxy setting.

Step 5. ?hoose the Yes option in the Enable this solution dropdown to enable the PayPal payment method.

Step 6. Then click the Save Config and clear the cache so that the configurations are displayed correctly on the front page.

Step 7. If you need to get Merchant Account ID, open the PayPal admin panel and navigate to Sandbox > Accounts > View/Edit Account:

paypal recurring payments sandbox

Step 8. Then fill it in the Merchant Account ID field.

Step 9. Go to Magento account and navigate to Subscriptions and recurring payments > Configuration > PayPal to authorize and link your store with the PayPal account.

Step 10. Fill in the Client ID and Client Secret fields with the credentials from your developer’s PayPal account.

Step 11. Then go to the PayPal account, navigate to the My Apps & Credentials window and click the Create App button. Now the administrator can copy the Client ID and Secret from this page:

paypal my apps

Step 12. Paste the copied info into the Client ID and Client Secret fields in the PayPal Configuration window and click Save Config to enable Webhook ID generation.

Step 13. After that, click Create to generate Webhook ID.

Step 14. Then navigate to the Magento account, go to Subscriptions & Recurring Payments > Configuration> General and select PayPal Express Checkout in the Supported Payment Gateways section. Click Save Config and clear Magento Cache so that the configurations are displayed correctly on the front page:

recurring payments settings

If you want to implement other payment systems using this extension, then check out the user guide. 

Read the Magento PayPal integration guide for more info about PayPal to Magento integration.

Check out the Recurring billing can get your Magento 2 store back in line article to know why recurring payments are important.

How can we help you?

Didn’t you find the answer to your question? We are always happy to help you out.

© 2009-2024 Amasty. All Rights Reserved.