A simple javascript client for the Bidaiondo API. This library is built to be used with ECS
and legacy CJS
projects
npm i @guachos/bidaiondo-client
ESM
import { Client as BidaClient } from '@guachos/bidaiondo-client';
async function test() {
const data = {
commerce: 'xxxxxxxx',
}
const cards = await BidaClient.requestCardInfo({
data,
})
console.log(cards);
// do something else
}
CJS
const BidaClient = require('@guachos/bidaiondo-client').Client;
async function test() {
const data = {
commerce: 'xxxxxxxxx',
}
const cards = await BidaClient.requestCardInfo({
data,
})
console.log(cards);
// do something else
}
NOTE: (from Bidaiondo Doc)
"Integration with third parties The merchant integration process will be carried out by Form through one of the following ways:
- Transfer of control to the Bidaiondo platform.
- Incorporation of the form in an iframe of the business. ** ** This environment only works for payments that are made without the Merchant application Secure Electronic (Unsecured Gateways)."
requestPayment
import { Client as BidaClient } from '@guachos/bidaiondo-client';
async function paymentFlow() {
// do something
const validCards = await BidaClient.requestCardInfo({
data: {
commerce: 'commerce-ID',
}
})
//obtain valid cards or error
//Check reqeusted `amex` vs valid cards (interrupt payment on error)
const data = {
commerce: 'commerce-ID',
transaction: 'tx-id',
amount: 1000,
currency: '978',
amex: '2',
language: 'es',
gateway: '75',
}
const paymentResult = await BidaClient.requestPayment({
data: data,
key: 'commerce-KEY',
})
//obtain form or error
// do something else
}
requestRefund
import { Client as BidaClient } from '@guachos/bidaiondo-client';
async function paymentFlow() {
// do something
const data = {
commerce: 'commerce-ID',
transaction: 'tx-id',
amount: 1000,
currency: '978',
}
const refundResult = await BidaClient.requestRefund({
data: data,
key: 'commerce-KEY',
})
//obtain form or error
// do something else
}
code | description |
---|---|
'1' | AMERICAN_EXPRESS |
'2' | VISA |
'3' | MASTERCARD |
'4' | DINNERS_CLUB |
'5' | JCB |
'9' | MASTERCARD_MAESTRO |
'10' | VISA_ELECTRON |
'11' | VIRTUAL_CARD |
'12' | BIZUM |
'13' | LUPAY |
'14' | DISCOVER_GLOBAL |
code | description |
---|---|
840 | USD |
978 | EUR |
124 | CAD |
... | ... |
NOTE: deppend on
amex
code | description |
---|---|
75 | insecure gateway |
81 | secure gateway |
-
es
: Spanish -
en
: English