payouts

Set Up Assisted Account Creation

Important: Assisted Account Creation (AAC) is restricted to approved US partners. To request AAC, contact your PayPal account manager.

To simplify payouts, Assisted Account Creation (AAC) enables customers to use their PayPal account to log in or sign up to a merchant site. This can accelerate and increase creation of merchant site customer accounts.

The merchant receives the payer ID and email address of each customer who completes the onboarding flow. Barring compliance or fraud issues, payer IDs are the most reliable way to send payouts.

AAC can also:

  • Identify users with PayPal accounts and display a Log In with PayPal button.
  • Enable merchants to customize rewards for PayPal users.
  • Enable customers to connect their PayPal account at the merchant site's payment settings screen.

Use AAC with these Payouts integration methods:

Prerequisites

  1. Create a PayPal app to generate client_id and secret credentials. Then, communicate with your PayPal account manager to receive your merchant-specific return URL to add into the App Settings.

  2. In the Sandbox App Settings of your PayPal app, select Log In with PayPal. In the expanded area under Log In with PayPal, select Email address only. Based on your company’s requirements, check Enable customers who have not yet confirmed their email address with PayPal to log in to your app.

Integrate client side

For client side integration, AAC leverages Zoid, PayPal’s open-source, cross-domain component library. Drop the AAC Zoid onto your applicable pages as follows:

Note: In the client side scripts, information you need to fill in (for example, container, client_id, or signup/login) has quotation marks and angled brackets around it.

<!—- PayPal client-side script -->
<script src="https://www.paypal.com/conex/js/client/static/js/zoid.min.js"></script>
<script src="https://www.paypal.com/conex/js/client/static/advConnectZoid.js"></script>


<!-- Set up a container for ACC to be rendered into -->
<div id="container"></div>

<script>
    // Render the AAC component
    AdvConnectZoid.render({
        clientId: "<client_id>",
        pageType: "<signup/login>",
        onLogin: function(response) {
          if(response.err){
            console.log(response.err)
       } else {
console.log(response.body.code + " " + response.body.payerId);
       }
        }

    }, '#container');
</script>

React

To integrate AAC into a React codebase, use this script:

render: function() {
    return (
        <AdvConnectZoid.react clientId="client_id" pageType="signup/login" onLogin={onLogin} />
    );
}

Angular

To integrate AAC into an Angular codebase, use this script:

// Specify the component name as a dependency to your angular app:
angular.module('myapp', ['adv-connect-zoid'])
  // Include the tag in one of your templates (don't forget to use dasherized prop names):
  <
  adv - connect - zoid client - id = "client_id"
page - type = "signup/login"
on - login = {
  onLogin
}
/>

Integrate server side

Server side integration includes two PayPal API calls.

  1. Use the authorization code returned in the client side integration to obtain an access token.
curl -X POST https://api.paypal.com/v1/identity/openidconnect/tokenservice \
  -H 'Authorization: Basic <Base64 Encoded client_id:secret>' \
  -d 'grant_type=authorization_code&code=code'
  1. Pass the access token from the client side integration to the server side.
  2. Use the access token to get the customer's email address and payer ID.
curl -v -X GET https://api.paypal.com/v1/oauth2/token/userinfo?schema=openid \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer access_token"

PayPal Node SDK

Use this code to install AAC if your server runs on Node.

npm install paypal-rest-sdk'

var paypal = require('paypal-rest-sdk');
paypal.configure({
  'mode': 'sandbox', //sandbox or live
  'client_id': '',
  'client_secret': ''
});
// Get tokeninfo with Authorize code
paypal.openIdConnect.tokeninfo.create("Replace with authorize code", function(error, tokeninfo){
  console.log(tokeninfo);
});
// Get userinfo with Access code
paypal.openIdConnect.userinfo.get("Replace with access_code", function(error, userinfo){
  console.log(userinfo);
});

PayPal Python SDK

Use this code to install AAC if your server runs on Python.

apt-get install libssl-dev libffi-dev
pip install paypalrestsdk

import paypalrestsdk
from paypalrestsdk.openid_connect import Tokeninfo, Userinfo

paypalrestsdk.configure({
  "mode": "sandbox", # sandbox or live
  "client_id": "",
  "client_secret": "" })
tokeninfo = Tokeninfo.create("Replace with Authorize code")
userinfo  = tokeninfo.userinfo()
Feedback