https://github.com/pangaunn/node-2c2p
Helper function for encrypt and decrypt 2c2p payment action api
https://github.com/pangaunn/node-2c2p
2c2p nodejs
Last synced: 6 months ago
JSON representation
Helper function for encrypt and decrypt 2c2p payment action api
- Host: GitHub
- URL: https://github.com/pangaunn/node-2c2p
- Owner: pangaunn
- Created: 2018-05-21T13:32:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-09T17:05:20.000Z (about 8 years ago)
- Last Synced: 2025-10-06T14:27:10.371Z (10 months ago)
- Topics: 2c2p, nodejs
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Node-2c2p
### Introduction
Helper function for encrypt and decrypt 2c2p payment action api.
### Installation
```
npm install node-2c2p
```
### encrypt(xmlString, publicKeyPath)
```
/**
* @param {String} xmlString xml string that you want to encrypt.
* @param {String} publicKeyPath path to your certificate file (this file you have to request from 2c2p)
* @return {String} encrypted xml string
*/
```
### decrypt(encryptedXml, privateKeyPath)
```
/**
* @param {String} encryptedXml encrypted reponse string from 2c2p payment action request.
* @param {String} privateKeyPath path to your pem file (this file you have to request from 2c2p)
* @return {String} string in xml
*/
```