Last updated

PayPal Checkout Adapter

Overview Document: Payment Adapters Overview

Overview and Unique Capabilities

The PayPal Checkout Adapter integrates PayPal's payment platform with Norce Checkout. This page focuses on the unique technical details and configuration for PayPal.

Supported payment methods and other features: Features Overview

Configuration in Norce Admin

The adapter is configured using the following settings in the apiSettings section:

FieldDescriptionExample Value
apiUrlPayPal API URL (sandbox or live).https://api-m.sandbox.paypal.com
paypalMerchantIdYour PayPal Merchant ID from Developer Dashboard.MERCHANT123

Options Configuration

The options section contains adapter behavior settings:

FieldDescriptionDefault Value
intentPayment intent: authorize (reserve funds) or capture (immediate payment).authorize
providesCustomerIf true, customer address comes from PayPal. If false, address is collected outside PayPal.false
mapDiscountPerRowIf true, discounts are included in item prices. If false, discounts appear as separate order lines.false
useCartReferenceAsInvoiceIdIf true, uses cart.reference as PayPal invoice ID. If false, uses the Norce order reference.false
disableFundingArray of funding sources to disable (e.g., ["credit", "card"]).[]
enableFundingArray of funding sources to enable (e.g., ["paylater", "venmo"]).[]
paymentSourceJSON string for advanced PayPal payment source configuration with return/cancel URLs.null

Redirect URLs Configuration

When using PayPal as an external redirect flow (not SDK-based), configure the redirectUrls section:

FieldDescription
checkoutPageURL to redirect to if payment fails or is cancelled. Supports {order.merchant}, {order.channel}, {order.id}, and {errorCode} placeholders.
confirmationPageURL to redirect to after successful payment authorization. Supports {order.merchant}, {order.channel}, and {order.id} placeholders.

PayPal API Environments

In addition to the generic Norce Adapter URLs (see Payment Adapters Overview), PayPal uses the following external API environments:

EnvironmentPayPal API Base URL
Productionhttps://api-m.paypal.com
Sandboxhttps://api-m.sandbox.paypal.com

Webhook Configuration

Configure webhooks in PayPal Developer Dashboard with the following events:

  • CHECKOUT.ORDER.APPROVED
  • CHECKOUT.ORDER.COMPLETED
  • PAYMENT.AUTHORIZATION.CREATED

Webhook URL format:

https://{slug}.api-se.{env}.norce.tech/checkout/paypal-adapter/api/checkout/v1/callback/webhook

Creating a PayPal Payment

To initialize a PayPal Checkout session:

POST /api/v1/orders/{order_id}/payments
Host: {slug}.api-se.stage.norce.tech
x-merchant: {merchant}
x-channel: {channel}
Authorization: Bearer {token}

The response includes SDK configuration for rendering PayPal buttons:

{
  "paymentId": "pVjGamNQMiEtecSfkABthgijIJK",
  "reference": "5O190127TN364715T",
  "sdkUrl": "https://api-m.sandbox.paypal.com",
  "partnerAttributionId": "Norce_Cart_PPCP",
  "sdkSettings": {
    "clientId": "AdfIh3vhZgRSn0CrYDXnbDOCwTUPnWZ...",
    "merchantId": "MERCHANT123",
    "currency": "SEK",
    "locale": "sv_SE",
    "buyerCountry": "SE",
    "disableFunding": [],
    "enableFunding": [],
    "commit": false,
    "vault": false,
    "integrationDate": "2025-04-01",
    "intent": "authorize"
  }
}

Handling Shipping Changes

The adapter supports shipping address and option change callbacks:

    POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/shipping-address-change
    Host: {slug}.api-se.stage.norce.tech
    POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/shipping-options-change
    Host: {slug}.api-se.stage.norce.tech

Troubleshooting (PayPal Specific)

In addition to the generic troubleshooting steps:

  • Payment Creation Fails (409 Conflict): A PayPal payment already exists for this order. Remove the existing payment or use a different order.
  • Authorization Fails (422): Verify the customer has approved the payment in the PayPal UI.
  • Webhook Signature Invalid: Verify the webhook URL is correctly configured in PayPal Developer Dashboard.
  • Review transaction details in PayPal Developer Dashboard.
  • Verify webhook delivery status in PayPal.

Payment States

StateDescription
intentPayment initialized, awaiting customer approval
processingPayment approval in progress
pendingAwaiting asynchronous confirmation
reservedPayment authorized successfully
capturedPayment captured (funds transferred)
declinedPayment declined by PayPal
cancelledPayment voided/cancelled