1. Home
  2. Tutorials
  3. Integrating Third Party Services
  4. Process a Payment with PayPal

Process a Payment with PayPal

make payment paypal screen

Your app can process a one-time payment using PayPal. By entering the details for an app registered with PayPal and using the dedicated Action on iOS or Android, you can accept a payment from the app user.

  1. If you haven’t already done so, log into your PayPal account developer dashboard and create an app – you will need to enter the Client ID for it in Dropsource. In the REST API apps section, click Create app.

    paypal new app

    Enter the details for your new app and copy the Client ID so that you can paste it into Dropsource.

  2. In your Dropsource project, click Edit next to PayPal in Settings on the left of the editor. Enter your Client ID and choose an environment (e.g. Production for your live app, or Sandbox for testing).

    paypal settings

  3. Decide when you want to process the payment and open the relevant Event, for example to process it when the user taps a Button, select the Button and in Properties > Events, choose the Tapped Event.

    pay button

    Add the Accept Payment Using PayPal (iOS) / Obtain Immediate PayPal Payment (Android) Action. Enter the amount you are charging as a Double value, a currency code, and a short text description of what the charge is for.

    paypal action

  4. When the Action runs, the user will be directed to PayPal’s payment processing component, returning to your page when payment is complete or failed. In the nested Events, add Actions to respond to failure or success of the payment, for example navigating to another page on success or displaying an error message on failure.

    payment fail

The details you enter for the PayPal payment processing Action can be input statically or can be pulled from the available input sources in your app, including API response data. By handling the nested fail and success Events, you can tailor your app’s behavior dynamically to the user’s payment status. If you have a list of items the user is ordering and that is returned from your API you can display them as a shopping cart.

Was this article helpful to you? Yes No

How can we help?