PPCP (PayPal Complete Payments)
PayPal Complete Payments merchant onboarding and payment flow.
Merchant onboarding
Onboard each merchant with PayPal before you make PayPal Complete Payments available to them. Start onboarding by activating the PayPal PPCP payment provider method using Activate Payment Provider Method.
Activating payment method
Use provider: paypal and method: ppcp in the activate merchant payment method request.
Parameters
| Parameters | Type | Description | Required |
|---|---|---|---|
status_callback_url | string | Callback for receiving updates on the payment method activation | No |
provider_method_parameters | object | Parameters dependent on the given provider and method | Yes |
Provider method parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
email | string | The email of the merchant business account with PayPal. | Yes |
redirect_url | string | The URL where PayPal redirects the merchant after onboarding. | Yes |
Onboarding flow
- Activate the
paypal.ppcppayment provider method to start onboarding. The provider method response includes anaction_url. - Redirect the merchant to the
action_url. - The merchant steps through the PayPal onboarding process.
- Include
status_callback_urlin the activation request to receive the onboarding status callback. - After the merchant completes onboarding, PayPal redirects the merchant to the
redirect_url. Ping Payments sends a status callback to thestatus_callback_url.Callback example{ "id": "<Id returned when initiating the onboarding flow>", "status": "COMPLETED", "details": null } - The merchant can now accept PayPal PPCP payments.
If the merchant organization already has completed onboarding with the provided email, Ping Payments activates the payment method directly for the merchant. In this case, the response status is
COMPLETED.
Testing onboarding in sandbox
Create a PayPal sandbox business account to test the onboarding flow. Log in to The PayPal Developer Portal with an existing account. Go to Testing Tools > Sandbox Accounts, select Create account, and choose Business as the account type. After PayPal creates the account, select the account email to view the account details. Use the sandbox account email and password when onboarding the merchant.
Designated Merchant
Every PayPal PPCP payment requires a designated_merchant_id in the provider_method_parameters. This is the Ping Payments Merchant ID (UUID) of the merchant whose PayPal account processes the payment.
Key points:
- The designated merchant must have a
COMPLETEDPayPal onboarding. - The designated merchant must appear in at least one of the payment's
order_items(i.e. themerchant_idof at least one order item must match thedesignated_merchant_id). - For payments involving multiple merchants, designate one merchant by setting the
designated_merchant_idto one of the merchant'smerchant_id. The payment session uses that merchant's PayPal account.
Initiating a Payment
Use provider: paypal and method: ppcp in the initiate payment request.
Required parameters
Parameter | Type | Description |
|---|---|---|
|
| The purchase description. PayPal calculates the maximum length based on US ASCII characters. Other character types, such as accented characters or Japanese characters, can reduce the number of characters you can submit. |
|
| The primary Ping Payments API Merchant ID for the payment. |
|
| Category type of order lines for the entire purchase. Ping Payments applies this value to all order lines sent to PayPal. |
|
| The language tag for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. |
|
| Where PayPal sends the customer after they complete the payment. |
|
| Shipping details. If the payment does not require shipping, set |
Shipping
shipping is required but if there are no physical products in the order then set the preference field to NO_SHIPPING and none of the shipping information is needed.
Parameter | Type | Description | Required |
|---|---|---|---|
|
| The location source for the shipping address. | Yes |
|
| Shipping cost. | No |
|
| The internationalized email address. | No |
|
| The full name. | Required if |
|
| Shipping address. | Required if |
|
| The phone number, in its canonical international E.164 numbering plan format. | No |
Address
| Parameter | Type | Description | Required |
|---|---|---|---|
address_line_1 | string | The first line of the address, such as number and street. | Yes |
address_line_2 | string | The second line of the address, for example, a suite or apartment number. | No |
city | string | A city, town, or village. | Yes |
country_code | string | The 2-character ISO 3166-1 code that identifies the country or region. | Yes |
postal_code | string | The postal code, such as a ZIP code or equivalent. | Yes |
Phone number
| Parameter | Type | Description | Required |
|---|---|---|---|
country_code | string | The country calling code (CC), in its canonical international E.164 numbering plan format. The combined length of the CC and the national number must not exceed 15 digits. | Yes |
national_number | string | The national number, in its canonical international E.164 numbering plan format. The national number consists of a national destination code (NDC) and subscriber number (SN). | Yes |
Supported currencies
NOK, SEK, DKK, GBP, EUR
Payment Flow
- Initiate a payment — the response contains a
url. - Redirect the customer to the
urlto complete payment in PayPal's checkout.NOTE: It is recommended to always redirect the customer to the PayPal checkout and not try rendering it in an iframe as this can cause unpredictable behavior
- After the customer completes the payment, PayPal redirects them to the
redirect_urlprovided in the request. - Ping Payments delivers the payment status through the standard Ping Payments callback.
Example Request
{
"currency": "SEK",
"method": "ppcp",
"order_items": [
{
"amount": 10000,
"merchant_id": "{{merchantId}}",
"name": "Product A",
"vat_rate": 25.0
}
],
"provider": "paypal",
"total_amount": 10000,
"provider_method_parameters": {
"designated_merchant_id": "{{merchantId}}",
"locale": "sv-SE",
"redirect_url": "https://example.com",
"description": "description",
"shipping": {
"preference": "NO_SHIPPING"
},
"item_category": "DIGITAL_GOODS"
}
}Example Response
{
"id": "15c44587-7ebb-43a3-b437-8d00e5f8df7a",
"provider_method_response": {
"url": "https://www.sandbox.paypal.com/checkoutnow?token=abc123"
}
}Testing payments in sandbox
To test PayPal PPCP payments a sandbox personal account is needed. Create the account by, first, logging in to your PayPal developer account, then, going to Testing Tools > Sandbox Accounts, select Create account, make sure to choose Personal as the account type. After the PayPal account is created, select the account email to view the account details. Use the sandbox account email and password when making the payment.
Refunds
PayPal PPCP payments support refunds through the standard Ping Payments refund flow. PayPal supports partial refunds. Check the create refund guide for more information on how to perform a refund.
Updated about 4 hours ago