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

@placetopay/pinpad-sdk

Package Overview
Dependencies
Maintainers
3
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@placetopay/pinpad-sdk

This API provides a PinPad Javascrypt SDK to conect with PinPad service of Placetopay.

  • 0.0.8-beta.1
  • npm
  • Socket score

Version published
Weekly downloads
99
increased by200%
Maintainers
3
Weekly downloads
 
Created
Source

PinPad

A PIN pad or PIN entry device (PED) is an electronic device used in a debit, credit or smart card-based transaction to accept and encrypt the cardholder's personal identification number (PIN).

This API provides a PinPad SDK service with PinBlock generation encrypted according to ISO 9564, the data required for PinBlock generation are as follows:

  • PIN: number digits by the cardholder 4-12 length, refer PIN to more information.

  • PAN: The card number PAN to more information.

  • Format: format to apply to the pin, can be 0, 1, 2 or 3 more info ISO 9564

Installation

 npm i @placetopay/pinpad-sdk

Usage

Init the PinPad JavaScript SDK

For the PinPad will be succesfully loaded, you must initialize the sdk as shown below:

  import PinPad from '@placetopay/pinpad-sdk'

  let pad = new PinPad({
      id: 'YOUR_CLIENT_ID',
      token: 'YOUR_API_TOKEN',
      format: 0, // may be 0,1,2 or 3
      locale: document.documentElement.lang // language to display
  })

Render the PinPad

For render the Pinpad, the PinPad JavaScript SDK provides a funtion render(div_id, PAN). the div_id property es the PinPad DOM element id defined earlier, the PAN property is the card number digited by user (required only formats by 0 and 3)

Render the PinPad as shown below:

  pad.render('my-PinPad-id', 'PAN')

Create Transaction

To create the Pinpad transaction, the PinPad JavaScript SDK provides a funtion createTransaction(). Return positions and transactionId, which will be necessary to send PIN.

create Transaction as shown below:

  pad.createTransaction().then(res => {
    const positions = res.data.positions
    const transactionId = res.data.transactionId
  })

Send PIN to encrypt

To send the PIN to encrypt, the PinPad JavaScript SDK provides a funtion sendPin(transactionId, data). Return Pinblock.

send PIN as shown below:

  let data = {
    format, // format to apply (required)
    pin,    // positions digits from user (required)
    pan,    // card number (required if format is 0 or 3)
  }
   
  pad.sendPin(transactionId, data).then(res => {
    const pinBlock = res.data.pinblock
  })

Keywords

FAQs

Package last updated on 16 Mar 2021

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