@100pay-hq/100pay.js 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.MD +22 -0
  2. package/index.js +40 -0
  3. package/package.json +28 -0
package/README.MD ADDED
@@ -0,0 +1,22 @@
1
+ # 100Pay Checkout
2
+
3
+ Accept crypto payments on your website in 3 mins
4
+
5
+ <!--
6
+ ## ✋ ✋ PACKAGE HAS BEEN DISCONTINUED
7
+ ## Please 👉 [click here](https://npmjs.com/@100pay-hq/checkout) for the updated package 📦 -->
8
+
9
+ ## Getting Started
10
+
11
+ # 🏄 🚀
12
+
13
+ Before you can start accepting crypto payments, you need to create a [100pay account](https://100pay.co) and obtain your api keys from the [100Developers platform](https://100pay.co)
14
+
15
+ For API documentation, please click here 👉 [100Developers API documentation](https://documenter.getpostman.com/view/13045730/2s93RMUatE)
16
+
17
+ ## Features
18
+
19
+ * Verify Crypto payments
20
+ * Bulk Transfers
21
+ * Crypto Transfers
22
+ * Crypto Payments
package/index.js ADDED
@@ -0,0 +1,40 @@
1
+ const request = require('request');
2
+ class _100Pay{
3
+ public_key
4
+ secret_key
5
+ constructor(pub, sec){
6
+ this.public_key = pub
7
+ this.secret_key = sec
8
+ }
9
+ verify = async (id) => {
10
+ return new Promise((resolve, reject) => {
11
+ let response_data = {}
12
+ var options = {
13
+ 'method': 'POST',
14
+ 'url': `https://api.100pay.co/api/v1/pay/crypto/payment/${id}`,
15
+ 'headers': {
16
+ 'api-key': `${this.public_key}`
17
+ }
18
+ };
19
+ request(options, function (error, response) {
20
+ if (error) {
21
+ response_data.status = 'error'
22
+ response_data.data = {}
23
+ reject(response_data)
24
+ } else {
25
+ if(response.body === 'invalid payment id supplied'){
26
+ response_data.status = 'error'
27
+ response_data.data = {}
28
+ return resolve(response_data)
29
+ }
30
+ response_data.status = "success"
31
+ const _response = JSON.parse(response.body);
32
+ response_data.data = _response;
33
+ resolve(response_data)
34
+ }
35
+ });
36
+ })
37
+ }
38
+
39
+ }
40
+ module.exports._100Pay = _100Pay;
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@100pay-hq/100pay.js",
3
+ "version": "1.0.0",
4
+ "description": "100Pay.js is the official Nodejs API wrapper SDK that lets you easily verify crypto payments, run bulk payout, transfer assets and many more.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "test"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/shop100global/100pay.js.git"
12
+ },
13
+ "keywords": [
14
+ "crypto",
15
+ "payment",
16
+ "100pay",
17
+ "nodejs",
18
+ "sdk",
19
+ "100pay",
20
+ "verify"
21
+ ],
22
+ "author": "brainyjosh",
23
+ "license": "ISC",
24
+ "bugs": {
25
+ "url": "https://github.com/shop100global/100pay.js/issues"
26
+ },
27
+ "homepage": "https://github.com/shop100global/100pay.js#readme"
28
+ }