Credit Messaging Reference Tables

DOCS

Last updated: Aug 15th, 8:02am

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

Messages Function

Create a PayPal Credit message object by calling the paypal.Messages function with the following parameters. Returns a PayPal Credit message object.

ValueTypeDescription
Configuration ObjectObjectConfigures credit message

Message Object

The PayPal Credit message object contains the following properties

PropertyTypeDescription
renderFunctionDetermines where to render the credit 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

OptionsTypeDescription
accountStringYour specific merchant account ID provided by PayPal. To find out your account ID, go to https://www.paypal.com/businessmanage/settings/aboutBusiness (Business Accounts only). If omitted from the configuration object, it must be present as the attribute data-pp-account value on the messaging.js script tag.
amountNumberThe product price or cart amount in dollars. For example, \$598.94 = 598.94. This field is only required by merchants who offer PayPal Credit Easy Payments and want to display monthly payment amounts to their consumers. The monthly payment amount is determined by the merchant's Easy Payments financing terms and the product cost.
styleObjectStyle options for credit messaging. (Default shows contextual messaging with the primary logo positioned to the left.)
countryCodeStringThe two-character code of the country in which the website will display the credit message. Your PayPal account's country will be used if omitted.
onRenderFunctionCallback function called immediately after each message has been successfully rendered to the DOM.

Style Options

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

Set either option to one of these values:

ValueDescriptionPreview
textDefault. Lightweight, contextual message.Credit,messaging,text,primary,left,black
flexResponsive display banner. See below for the supported ratio sizes and colors.Credit,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.

Logo Type

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

Set either option to one of these values:

ValueDescriptionPreview
primaryDefault. Stacked PayPal Credit Logo.Credit,messaging,text,primary,left,black
alternativeSingle line PayPal Credit Logo.Credit,messaging,text,alternative,left,black
inlineSingle line PayPal Credit Logo without monogram.Credit,messaging,text,inline,black
noneNo logo. Text only.Credit,messaging,text,inline,black

Logo Position

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

Set either option to one of these values:

ValueDescriptionPreview
leftDefault. Logo left of the text.Credit,messaging,text,primary,left,black
rightLogo right of the text.Credit,messaging,text,primary,right,black
topLogo above the text.Credit,messaging,text,primary,top,black

Text Color

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

Set either option to one of these values:

ValueDescriptionPreview
blackDefault. Black text with a colored logo.Credit,messaging,text,primary,left,black
whiteWhite text with a white logo.Credit,messaging,text,primary,left,white

Flex Layout Type

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

Color

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

Set either option to one of these values:

ValueDescriptionPreview
blueDefault. Blue background with white text and white logo.Credit,messaging,flex,1x1,blue
blackBlack background with white text and white logo.Credit,messaging,flex,1x1,black
whiteWhite background with blue text, colored logo, and blue border.Credit,messaging,flex,1x1,white
white-no-borderWhite background with blue text and colored logo.Credit,messaging,flex,1x1,white-no-border
grayLight gray background with blue text and colored logo.Credit,messaging,flex,1x1,gray

Ratio

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

Set either option to one of these values:

ValueDescriptionPreview
1x1Default. Ratio of 1x1 that flexes between 120px and 300px wide.Credit,messaging,flex,1x1,blue
1x4Ratio of 1x4 that is 160px wide.Credit,messaging,flex,1x4,blue
8x1Ratio of 8x1 that flexes between 250px and 768px wide.Credit,messaging,flex,8x1,blue
20x1Ratio of 20x1 that flexes between 250px and 1169px wide.Credit,messaging,flex,20x1,blue