Skip to main content

PayPal

Setup Instructions

PayPal integration requires data from your application on the PayPal Developer Dashboard. If you are offering subscriptions, enabling PayPal Server Notifications, which delivers updates about subscription states and expirations to the IAPGUARD backend in realtime, is required as well. When testing, keep in mind to login with your Sandbox Account when initiating the purchase. You can find your login credentials for sandbox accounts in the PayPal Developer Dashboard.

In the following screenshot, you can see the required fields we are going to fill out. Edit your Application to get started.

  • Account ID
  • License Key
  • Webhook ID (Server Notifications)
note

Note that the steps described below need to be done for the Sandbox and Production environment separately. Within the PayPal Developer Dashboard, you can switch between environments at any time.


PayPal-Setup000


Account ID

The Account ID is displayed when editing your application in the PayPal Developer Dashboard.

  • Navigate to Apps & Credentials in Sandbox environment
  • Create a new application or use the Default Application
  • Copy-paste the Client ID into the IAPGUARD Dashboard under Account ID
  • Repeat for Production environment

After this step, your project settings should look like this:


PayPal-Setup010


License Key

With the last step, a default Secret Key was already created for your application as well.

  • Edit your application in Sandbox environment
  • Copy-paste the Secret Key into the IAPGUARD Dashboard as License Key
  • Repeat for Production environment
tip

It is highly recommended to add a second Secret Key. Use one for your client application, the other for the IAPGUARD dashboard. Keeping them separate ensures that in case your client key is compromised, your server validations remain unaffected.

Server Notifications

caution

This step is required when offering subscriptions.

note

The Server URL is the same for Production and Sandbox.

Please note that you should have already created your subscription plan(s) in the Sandbox environment (login with your Sandbox Business account displayed in the Developer Dashboard) and on the Production environment (login with your official Business account). Subscription plan configuration can be found in the Pay & Get Paid > Subscriptions > Subscription plans menu.

  • Edit your application in the Developer Dashboard Sandbox environment
  • Scroll down to the Webhook section and click on Add Webhook
  • Enable events for Billing subscription, Checkout and the single Payment sale completed event
  • Add the following URL and save the Webhook
https://api.iapguard.com/v1/webhook/{YourAppID}/paypal

Replace {YourAppID} with the application ID that is displayed when editing your IAPGUARD application.

  • Copy-paste the Webhook ID into the IAPGUARD Dashboard under Webhook ID
  • Repeat for Production environment

Please contact Support if you have issues with this process or require further assistance.


PayPal-Setup020 PayPal-Setup021

Additional Information

Storage Durations: Since PayPal is only a payment processor, not an App Store, it does not provide a login system for associating user accounts with PayPal transactions. As such, users are not able to retrieve their past transactions from PayPal after they expired on IAPGUARD. When offering subscription products, active subscriptions automatically refresh a user's storage duration as described in Features: User Storage. However when offering One-Time Payments, consider storing validated transaction IDs along with user accounts in your own user management system, in order to revalidate them with IAPGUARD at a later time, or request an increase of User Storage duration by contacting IAPGUARD Support.

REST API: If you are not using one of IAPGUARD's Game Engine SDKs, but want to validate PayPal transactions with IAPGUARD manually, please note the following integration guidelines:

  • When creating Orders, set the intent value to CAPTURE
  • When the Order is in the APPROVED status, send it to IAPGUARD for validation which then captures the payment
  • When creating Subscriptions, set the application context > user_action value to CONTINUE
  • When the Subscription is in the APPROVED status, send it to IAPGUARD for validation which then activates the subscription