Skip to content

Instantly share code, notes, and snippets.

@sohara
Last active March 26, 2021 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sohara/46c754a56bea1a34cf27f9349b52e24c to your computer and use it in GitHub Desktop.
Save sohara/46c754a56bea1a34cf27f9349b52e24c to your computer and use it in GitHub Desktop.
Register Placements example
window.BreadPayments.setup({
integrationKey: 'xxx-xxx-xxx',
rtpsId: 'xxx - xxx - xxxx',
loyaltyID: 'xxxxxx',
buyer: {
givenName: 'Jack',
familyName: 'Seamus',
additionalName: 'C.',
birthDate: '1974-08-21',
email: 'johncseamus@gmail.com',
phone: '+13235323423',
billingAddress: {
address1: '323 something lane',
address2: 'apt. B',
country: 'USA',
locality: 'NYC',
region: 'NY',
postalCode: '11222',
},
shippingAddress: {
address1: '323 something lane',
address2: 'apt. B',
country: 'USA',
locality: 'NYC',
region: 'NY',
postalCode: '11222',
},
},
});
window.BreadPayments.registerPlacements([
{
financingType: 'card',
locationType: 'checkout',
domID: 'placement1',
order: {
orderItems: [
{
name: 'Men’s Classic Clog',
sku: 'XXXXXX',
category: 'Shoe',
unitPrice: 4499,
unitTax: 0,
brand: 'Crocs',
currency: 'USD',
quantity: 1,
shippingProvider: 'UPS',
},
],
subTotal: 4999,
totalTax: 1000,
totalShipping: 1000,
totalDiscounts: 0,
totalPrice: 6499,
},
},
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment