### Would you like to contact support?

No momento, esta página não está disponível em português

# PayBright Drop-in integration

Add PayBright to an existing Drop-in integration.

When making an PayBright payment, you also need to:

1. Collect shopper details, and specify these in your /sessions or /payments request.
PayBright uses these for risk checks.
2. Provide information about the purchased items by specifying lineItems.

## API reference

Select which endpoint you're integrating:

This is the default with Drop-in v5.0.0 or later.
Parameter name Required Description
shopperName Shopper's first name and last name.
dateOfBirth The shopper's date of birth.
telephoneNumber The shopper's phone number.
countryCode The shopper's country. For example, CA.
shopperReference A unique reference to identify the shopper (minimum length three characters).
deliveryAddress The address where the purchased goods should be delivered. If blank or missing, billingAddress is used by default.
shopperLocale A combination of language code and country code to define which language should be used in the PayBright checkout page.
lineItems Price and product information about the purchased items. This is optional, but we recommend to include this data to improve approval rates.
curl https://checkout-test.adyen.com/v69/sessions \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"countryCode":"CA",
"amount":{
"value":6000
},
"shopperLocale":"en_CA",
"shopperReference":"YOUR_UNIQUE_SHOPPER_ID",
"reference":"YOUR_ORDER_NUMBER",
"shopperName":{
"firstName":"Simon",
"lastName":"Hopper"
},
"dateOfBirth":"1970-07-10",
"telephoneNumber":"+16478491378",
"shopperEmail":"s.hopper@example.com",
"city":"Toronto",
"country":"CA",
"houseNumberOrName":"240",
"postalCode":"M5V 2C5",
"stateOrProvince":"ON",
"street":"Richmond St W"
},
"city":"Toronto",
"country":"CA",
"houseNumberOrName":"240",
"postalCode":"M5V 2C5",
"stateOrProvince":"ON",
"street":"Richmond St W"
},
"returnUrl":"https://your-company.com/checkout?shopperOrder=12xy..",
"lineItems":[
{
"description":"Shoes",
"quantity":"1",
"amountIncludingTax":"4000",
"amountExcludingTax":"3310",
"taxCategory":"Low"
},
{
"description":"Socks",
"quantity":"2",
"amountIncludingTax":"3000",
"amountExcludingTax":"2480",
"taxCategory":"Low"
},
{
"description":"Discount",
"amountExcludingTax":"-1000",
"amountIncludingTax":"-1000",
"quantity":"1",
"taxCategory":"Low"
}
]
}'

## Drop-in configuration

There is no PayBright specific configuration for Drop-in.

## Capture the payment

By default, all PayBright payments are captured automatically after authorisation.
If you prefer to capture the payment after the goods have been sent, or when you want to partially capture payments, you need to set up a capture delay or use manual capture.
When you capture the payment, the shopper is charged for the first installment.

### Partial captures

To partially capture a PayBright payment, specify in your /capture request:

• modificationAmount: The amount that the shopper should pay.
• additionalData.openinvoicedata: Optional Price and product information for the items that the shopper should pay for.

Although the field names are different, the information in additionalData.openinvoicedata is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.

The following example shows how to make a partial capture request if the shopper only kept one pair of socks from the two included in the original payment request.

/capture request
{
"originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"modificationAmount":{
"value":"4500"
},
"openinvoicedata.numberOfLines":"2",
"openinvoicedata.line1.description":"Shoes",
"openinvoicedata.line1.itemAmount":"3310",
"openinvoicedata.line1.itemVatAmount":"690",
"openinvoicedata.line1.numberOfItems":"1",
"openinvoicedata.line2.description":"Socks",
"openinvoicedata.line2.itemAmount":"1240",
"openinvoicedata.line2.itemVatAmount":"260",
"openinvoicedata.line2.numberOfItems":"1",
},
"reference":"YOUR_CAPTURE_REFERENCE"
}

Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for multiple partial captures, the unclaimed amount after an initial capture is not automatically cancelled.

To set up multiple partial captures, contact our Support Team. Multiple partial captures will create a new invoice for each capture.

## Refunds

If a payment has not yet been captured, you can cancel it. If the PayBright payment has already been captured and you want to return the funds to the shopper, you need to refund it.

### Partial refunds

To partially refund a payment, specify in your /payments/paymentPspReference/refunds request:

• modificationAmount: The amount to be refunded to the shopper.
• additionalData.openinvoicedata: Optional Price and product information about the returned items.

Providing additionalData.openinvoicedata is optional, and although the field names are different, the information is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.

The following example shows how to make a partial refund request if the shopper returned the shoes included in the original payment request.

/refund request
{
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount":{
"value":"4000"
},
"openinvoicedata.numberOfLines":"1",
}