New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@guachos/bidaiondo-client

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guachos/bidaiondo-client

Ah hybrid (ESM, CJS) nodejs client for the Bidaiondo API

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

bidaiondo-client

A simple javascript client for the Bidaiondo API. This library is built to be used with ECS and legacy CJS projects

Install

npm i @guachos/bidaiondo-client

Usage

  • 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
}

Integration on payment Flows (Example)

NOTE: (from Bidaiondo Doc)

"Integration with third parties The merchant integration process will be carried out by Form through one of the following ways:

  1. Transfer of control to the Bidaiondo platform.
  2. 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
}

Supported amex codes

codedescription
'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

Supported currency codes

see: https://es.iban.com/currency-codes

codedescription
840USD
978EUR
124CAD
......

Supported gateway codes

NOTE: deppend on amex

codedescription
75insecure gateway
81secure gateway

Supported language codes

  • es: Spanish
  • en: English

Keywords

FAQs

Package last updated on 16 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc