Reference

Learn others ways to configure Pay Later messages

DocsCurrentLast updated: September 30th 2021, @ 5:56:39 pm


The following tables display the values for the custom elements contained in the Code Samples.

On this page

Script query parameters

Pass these parameters to the PayPal JavaScript SDK script URL as the query parameters that apply to Pay Later messaging. This is a subset of the possible query parameters that supports the JavaScript SDK.

For the full set of script parameters, see the JavaScript SDK guide.

Sample code

<script
  src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&merchant-id=MERCHANT_ID_IF_NECESSARY&components=messages"
  data-partner-attribution-id="BN_CODE"
  data-namespace="PayPalSDK"
></script>
Parameter Example value Description
client-id a1b2c3d4e5f6 The client ID identifies the PayPal account for the messages component.
merchant-id abcdef123456 The merchant ID of a merchant for whom you're facilitating a message. Use this parameter only for partner, marketplaces, and cart solutions, when you are acting on behalf of another merchant. This parameter is essential to guarantee the merchant sees the best possible message.
data-partner-attribution-id 6f5e4d3c2b1a Also known as BN code. Your BN code is issued to you as part of the onboarding process.
data-namespace PayPalSDK Required if you're using a legacy checkout integration such as checkout.js. The name you'd like to use for the global variable when the SDK loads. For the example value, you would invoke PayPalSDK.Messages() in your integration. Can be any string, except paypal.

Messages function

Create a pay later message object by calling the paypal.Messages function with the following parameters. Returns a pay later message object.

Value Type Description
Configuration Object Object Configures pay later message

Message object

The pay later message object contains the following properties

Property Type Description
render Function Determines where to render the pay later message on the page. Accepts a valid CSS selector string, single HTMLElement reference, or array of HTMLElement references. Returns a Promise that resolves after all messages have rendered to the DOM.

Configuration object

Options Type Description
placement String Informs the SDK component of the page type where the message displays. Possible values include home, category, product, cart, and payment.
amount Number The product price or cart amount in AUD. For example, 598.94$ = 598.94.
style Object Style options for credit messaging (Default shows contextual messaging with the primary logo positioned to the left.)

Note: Please note that the preview images might not reflect the actual size or message content that displays when rendered onto your website.

Style options

  • Inline HTML attribute: data-pp-style-layout
  • Configuration object property: style.layout

Set either option to one of these values:

Value Description Preview
text Default. Lightweight, contextual message. Pay later messaging text primary left black
flex Responsive display banner. See below for the supported ratio sizes and colors. Pay later messaging flex 1x1 blue

Text layout type

The following options are available to messages with a data-pp-style-layout or style.layout value of text.

style.logo.type

Sets the type of logo used in text layout messages.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.logo.type data-pp-style-logo-type style.layout === 'text' String

Set this option to one of these values:

Value Description Preview
primary Default. Single-line PayPal or PayPal Credit logo au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text
alternative "PP" monogram or "PP Credit" logo au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying only the PayPal icon on the left side of the text
inline Recommended. Same as primary logo, but inline with the content au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal brand name logo displayed within the text
none No logo, text only au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, without a PayPal logo

style.logo.position

Sets the position of the logo relative to the message content for messages using a text layout.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.logo.position data-pp-style-logo-position style.layout === 'text'
&& (style.logo.type
=== 'primary'
|| style.logo.type
=== 'alternative')
String

Set this option to one of these values:

Value Description Preview
left Default. Logo left of the text. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text
right Logo right of the text. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a primary PayPal logo on the right side of the text
top Logo above of the text. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a primary PayPal logo on top of the text

style.text.size

Sets the font size of the text for text layout messages.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.text.size data-pp-style-text-size style.layout === 'text' Number

Set this option to one of these values:

Value Description Preview
10, 11 Smaller text sizes. Pay later messaging text alternative left black multi small
12 Default. Standard text size. Pay later messaging text alternative left black multi default
13, 14, 15, 16 Larger text sizes. Pay later messaging text alternative left black multi large

style.text.color

Sets the color of the text and PayPal/PayPal Credit logos for text layout messages.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.text.color data-pp-style-text-color style.layout === 'text' String

Set this option to one of these values:

Value Description Preview
black Default. Black text with colored logo au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text
white White text with a white logo au text message for a Pay Later offer with 12 pixel font, left-aligned, white text on a black background, with a white primary PayPal logo on the left side of the text
monochrome Black text with a black logo au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a monochrome primary PayPal logo on the left side of the text
grayscale Black text with a grayscale logo au text message for a Pay Later offer with 12 pixel font, left-aligned, grayscale text on a white background, with a grayscale primary PayPal logo on the left side of the text

style.text.align

Sets the direction the text aligns for text layout messages.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.text.align data-pp-style-text-align style.layout === 'text' String

Set this option to one of these values:

Value Description Preview
left Default. Text is left aligned. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text left
center Text is center aligned. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text center
right Text is right aligned. au text message for a Pay Later offer with 12 pixel font, left-aligned, black text on a white background, with a PayPal logo displaying the PayPal icon and name on the left side of the text right

Flex layout type

The following options are available to messages with a data-pp-style-layout or style.layout value of flex.

style.color

Sets the color of the message background for flex layout messages.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.color data-pp-style-color style.layout === 'flex' String

Set this option to one of these values:

Value Description Preview
blue Default. Blue background with white text and white logo A square au flex message for a Pay Later offer with white text and logo on a blue background
black Black background with white text and white logo A square au flex message for a Pay Later offer with white text and logo on a black background
white White background with blue text, colored logo, and blue border A square au flex message for a Pay Later offer with black text and logo on a white background with a blue border
gray Light gray background with blue text and colored logo A square au flex message for a Pay Later offer with blue text and a colored logo on a light gray background
monochrome White background with black text and black logo A square au flex message for a Pay Later offer with black text and logo on a white background
grayscale White background with black text and grayscale logo A square au flex message for a Pay Later offer with blue text and a colored logo on a light gray backgroundscale

style.ratio

The ratio of the flexible display banner.

Object Property (path) Inline HTML Attribute Dependency Value Type
style.ratio data-pp-style-ratio style.layout === 'flex' String

Set this option to one of these values:

Value Description Preview
1x1 Default. Ratio of 1x1 that flexes between 120px and 300px wide A square au flex message for a Pay Later offer with white text and logo on a blue background
1x4 Ratio of 1x4 that is 160px wide A rectangular au flex message with a width to height ratio of 1x4 for a Pay Later offer with white text and logo on a blue background
8x1 Ratio of 8x1 that flexes between 250px and 768px wide A rectangular au flex message with a width to height ratio of 8x1 for a Pay Later offer with white text and logo on a blue background
20x1 Ratio of 20x1 that flexes between 250px and 1169px wide A rectangular au flex message with a width to height ratio of 20x1 for a Pay Later offer with white text and logo on a blue background