Configure VTEX

This guide explains how to integrate Bamboo as a payment provider in your VTEX store. It includes the steps to authenticate your store, configure payment options, and enable both installment and one-time payments.

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.

  2. Navigate to 'Store Configuration' > 'Providers' > 'New Provider'.

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



Bamboo Plugin Setup

Authentication

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


Payment Control

Choose whether to operate in test mode. and select your preferred type of settlement.


📘

Test Mode

Test mode allows you to simulate Bamboo transactions in your store before offering it to customers. Deselect this option when you're ready to process real transactions


Provider Fields

Configure the following settings:

  • Private Key: Enter your Bamboo private key.
  • Enable Authorization and Capture: Enable this if you plan to manually capture payments.
  • Operating Country: Choose your store's country of operation.


Payment Methods Configuration

To set up payment methods:

  1. Go to the Payment Conditions section.

  2. Click the + icon to add a new condition.

  3. Choose the payment method you want to offer.



Installments for Credit Cards

To set up installments for Credit Cards:

  1. Select the card brand (e.g., Visa, Mastercard).

  2. Set the condition to Active.

  3. Select Bamboo-Payments as the provider.

  4. Enter a name for the payment condition.

  5. Select the Installments option and fill in the details.

  6. Set interest rates if needed.

  7. Click Save.



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.
  1. Configure the necessary details for one-time payments.
  2. Save the changes.

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.

⚠️

Changes to payment conditions may take up to 10 minutes to apply at your VTEX store's checkout.


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:

ℹ️

This configuration only applies to PayFac merchants. It is not valid for the Gateway modality. If you have any doubts, please consult with support or your account manager.

Inside the VTEX administrative panel, go to 'Store Settings'.

  • Navigate to 'Storefront > Checkout'.
  • Click on the configuration icon for the 'Default' option.
  • Enter 'Code > checkout-custom.js'.
  • 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.



Next Steps

Once the VTEX plugin is configured, proceed with the following guides: