Documentation Index
Fetch the complete documentation index at: https://bancofcalifornia-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This guide uses a minimal Collect.js integration for explanatory purposes. For more information about
using Collect.js, please see the Collect.js documentation.
The Kount data collector should be run immediately on a payment page, and may be run multiple times. Each call to createSession() will return a session ID. When submitting, use the latest value.
Initialize Gateway.js
Start by initializing Gateway.js with your public key. You can view your existing public keys
or create a new one in the merchant portal’s
Security Keys page. Initialize Kount
Initialize the Kount service by calling gateway.getKount().
Run the Kount data collector
Run the Kount data collector by calling Kount’s createSession() and retrieve the session ID
using .then().
Render the Collect.js form
Render a Collect.js form to collect the credit card information. You should call Collect.js’s
configure() method to supply a callback. The callback will provide the Collect.js payment
token in place of the credit card details.
Build the transaction object in the callback
Create a Javascript object with the details of the transaction in the callback. The details
should include payment_token, currency, amount, email, city, address1, country, zip,
first_name, last_name, and transaction_session_id.
Submit via the Payment API
Submit the transaction data via the payment API with your private key.
example.html
<html>
<body>
<label>Credit Card Number</label>
<div id="ccnumber"></div>
<label>CC EXP</label>
<div id="ccexp"></div>
<label>CVV</label>
<div id="cvv"></div>
<button id="payButton">Pay Now</button>
<script src="https://gateway.bancedge.com/js/v1/Gateway.js"></script>
<script
src="https://gateway.bancedge.com/token/Collect.js"
data-tokenization-key="000000-111111-222222-333333"
></script>
<script>
// Initialize Gateway.js, use own Public Key
const gateway = Gateway.create('collect_checkout_0000000000000000000000000');
// Initialize the Kount service
const kount = gateway.getKount();
// Run Kount
kount.createSession().then((res) => {
//Store session id
const sessionId = res;
//Run CollectJS Configure
CollectJS.configure({
variant: 'inline',
callback: (e) => {
const options = {
paymentToken: e.token,
currency: 'USD',
amount: '1000',
email: 'none@example.com',
phone: '8008675309',
city: 'New York',
state: 'NY',
address1: '123 First St.',
country: 'US',
firstName: 'John',
lastName: 'Doe',
postalCode: '60001',
transactionSessionId: sessionId
};
fetch('direct-post-back-end.php', {
method: 'POST',
body: JSON.stringify({
...options,
})
});
}
});
gateway.on('error', function (e) {
console.error(e);
});
});
</script>
</body>
</html>
direct-post-back-end.php
<?php
$jsonContent = json_decode(file_get_contents('php://input'));
$fields = array(
'security_key' => '01234567890123456789012345678901',
'payment_token' => $jsonContent->paymentToken,
'amount' => '10.00',
'email' => $jsonContent->email,
'phone' => $jsonContent->phone,
'city' => $jsonContent->city,
'address1' => $jsonContent->address1,
'country' => $jsonContent->country,
'first_name' => $jsonContent->firstName,
'last_name' => $jsonContent->lastName,
'zip' => $jsonContent->postalCode,
'transaction_session_id' => $jsonContent->transactionSessionId
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://secure.networkmerchants.com/api/transact.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $fields
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;