Skip to content

Instantly share code, notes, and snippets.

@sohara
Last active January 27, 2021 16:54
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/cdfbf0f96741f78b187e4273547228b3 to your computer and use it in GitHub Desktop.
Save sohara/cdfbf0f96741f78b187e4273547228b3 to your computer and use it in GitHub Desktop.
SDK scratchpad
SDK.setup({
placements: [
{
financingType: "installments" /* card | installments */,
locationType: "product" /* product | cart | checkout */,
domID: "myDomElement" /* DOM element for the placement */,
},
{
financingType: "installments" /* card | installments */,
locationType: "banner" /* product | cart | banner | checkout */,
domID: "myBannerDomElement" /* DOM element for the placement */,
},
{
financingType: "card" /* card | installments */,
locationType: "product" /* product | cart | checkout */,
domID: "myDomElement" /* DOM element for the placement */,
presentmentID:
"49989304-445d-4002-95db-f94z99885447" /* from account manager */,
},
],
keys: {
appID: "xxx-xxx-xxx",
merchantID: "xxx-xxx-xxx",
programID: "xxx-xxx-xxx",
FMCKey: "xxx-xxx-xxx",
},
order: {
items: [
{
name: "Some product",
sku: "xxx-xxx-xxx",
category: "Equipment",
itemURL: "http://goods.com/xyz",
imageURL: "http://goods.com/product.png",
quantity: 1,
shipmentCost: 2000,
shipmentProvider: "FedEx",
shipmentDescription: "Ground",
unitPrice: 55000,
unitTax: 3200,
},
],
currency: "USD",
shipping: 2000,
tax: 3200,
subTotal: 58400,
},
buyer: {
givenName: "Jack",
familyName: "Seamus",
additionalName: "C.",
birthDate: "1974-08-21",
email: "sohara@blah.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",
},
},
rtpsId: "xxx-xxx-xxxx" /* EpJS only - optional */,
});
SDK.on("INSTALMENT:APPLICATION_CHECKOUT", (applicationResult) => {
// Handle successful bread checkout
});
SDK.on("INSTALMENT:APPLICATION_APPROVAL", (applicationResult) => {
// Handle successful bread checkout
});
SDK.on("CARD:RECEIVE_APPLICATION_RESULT", (applicationResult) => {
// handle application result
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment