Integration Guide

Learn how to integrate Bamboo’s payment solutions into your VTEX e-commerce store. This guide provides step-by-step instructions for seamless setup and configuration.

You’ll find detailed instructions for setting up authentication, configuring payment settings, and establishing conditions for both installment and single payment options.


General Setup

To configure Bamboo as a payment provider in your VTEX store, follow these steps:

  1. Log in to your VTEX admin panel using your credentials.

PrintScreen

  1. Navigate to ‘Store Configuration’ > ‘Providers’ > ‘New Provider’.

PrintScreen

  1. Search for Bamboo-Payments in the list of providers and select it.

PrintScreen

Bamboo Plugin Configuration

Authentication Setup

Enter your store credentials in the designated fields. For information on generating your store keys, refer to the VTEX Keys documentation

PrintScreen

Payment Control

  1. Choose whether to operate in test mode.

PrintScreen

  1. Select your preferred type of settlement.

Provider Fields

Configure the following settings:

  1. Private Key: Enter your Bamboo PrivateKey.
  2. Enable Authorization and Capture: If enabled, you’ll need to manually capture payments made with Bamboo from your store.
  3. Operating Country: Select the country where your store operates.

PrintScreen

After completing these fields, click the ‘Save’ button.

Payment Methods Configuration

To set up payment methods:

  1. Go to the ‘Payment Conditions’ tab.

PrintScreen

  1. Click the ‘+’ icon to add a new condition.
  2. Configure the payment method you want to offer to your customers.

PrintScreen

Installments for Credit Cards

To set up installments for Credit Cards:

  1. Select the desired card brand from the list.

PrintScreen

  1. Activate the condition.

PrintScreen

  1. Select Bamboo-Payments as the provider.

PrintScreen

  1. Enter a name to identify the payment condition.

PrintScreen

  1. Choose the ‘Installments’ option and enter the requested data.
  2. Configure interest rates and/or external interests as needed.
  3. Save the changes.

PrintScreen

Single Payment (One-time Payment) for Credit and Debit Cards

To set up single payments (payments in one installment):

  1. Follow the same process as ‘Installment Payments’.
  2. Instead of selecting ‘Installments’, choose the ‘Single Payment’ option.

PrintScreen

  1. Configure the necessary details for one-time payments.
  2. Save the changes.

PrintScreen

By following these steps, you’ll successfully offer Bamboo as a payment method to your customers in your VTEX store, including both installment plans and single payment options.

Antifraud Script

For the correct functioning of transactions made through Bamboo, an anti-fraud analysis script must be injected into the store. To configure it, follow the steps below:

  1. Inside the VTEX administrative panel, go to ‘Store Settings’.

PrintScreen

  1. Navigate to ‘Storefront > Checkout’.
  2. Click on the configuration icon for the ‘Default’ option.

PrintScreen

  1. Enter ‘Code > checkout-custom.js’.

PrintScreen

  1. Insert the following code block into the file and save:
const API_Environment = "https://api.bamboopayment.com",
    PublicAccountKey = "CT4XUYw10xDemA4UqCgU0m_I56ONV7HQ";

async function getIp() {
    return fetch("https://api.ipify.org/?format=json")
}

async function loadScript(e, t) {
    if (!window.vtex || window.vtex.deviceFingerprint) {
        console.debug(window.vtex ? `already deviceFingerprint: ${window.vtex.deviceFingerprint}` : "there is no VTEX");
        return
    }
    let n = document.createElement("script");
    n.src = e,
    n.onload = t,
    document.head.appendChild(n)
}

async function generateFingerPrint() {
    if (!window.setSessionID) {
        console.debug("SetSessionID not found");
        await new Promise(e => setTimeout(() => e(!0), 1e3));
        console.debug("Retrying...");
        return generateFingerPrint();
    }
    let e = window.getSessionAntifraud(),
        t = await getIp().then(e => e.json()).then(({ip: e}) => e),
        n = JSON.stringify({
            sessionId: e,
            ip: t
        });
    window.vtex.deviceFingerprint = n
}

window.addEventListener("DOMContentLoaded", () => {
    console.info("==== RUNNING FINGER PRINT ====");
    loadScript(`${API_Environment}/v1/Scripts/Antifraud.js?key=${PublicAccountKey}`, generateFingerPrint)
});

This script will ensure that the anti-fraud analysis is performed correctly for transactions processed through Bamboo.

footer
Last modified September 19, 2024

© Bamboo | All rights reserved 2024