Skip to content

Commit

Permalink
feat: payment-processor new package (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed Feb 14, 2020
1 parent 0c36de1 commit a2ce521
Show file tree
Hide file tree
Showing 34 changed files with 3,207 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,30 @@ jobs:
root: *working_directory
paths:
- packages/payment-detection/coverage/
test-payment-processor:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run build'
- run:
name: 'Lint payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run lint'
- run:
name: 'Deploy test contracts from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run test'
- persist_to_workspace:
root: *working_directory
paths:
- packages/payment-processor/coverage/
publish-coverage:
docker:
- *node_image
Expand Down Expand Up @@ -617,6 +641,9 @@ workflows:
- test-payment-detection:
requires:
- build
- test-payment-processor:
requires:
- build

# Publish the code coverage
- publish-coverage:
Expand All @@ -635,6 +662,7 @@ workflows:
- test-utils
- test-multi-format
- test-payment-detection
- test-payment-processor

# Release a next version package everytime we merge to master
- next-release:
Expand All @@ -656,6 +684,7 @@ workflows:
- test-utils
- test-web3-signature
- test-payment-detection
- test-payment-processor
context: protocol-release
filters:
branches:
Expand Down
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"fau",
"fetchable",
"filename",
"gnosis",
"gwei",
"hexlify",
"http",
Expand All @@ -84,6 +85,9 @@
"metadata",
"metamask",
"mul",
"multisig",
"numberify",
"numberish",
"namespace",
"parallelize",
"param",
Expand Down
19 changes: 19 additions & 0 deletions packages/payment-detection/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extension": [
".ts"
],
"include": [
"src/*.ts",
"src/**/*.ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"json",
"html"
],
"sourceMap":true,
"all": true
}
3 changes: 3 additions & 0 deletions packages/payment-detection/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tslint.json"
}
3 changes: 3 additions & 0 deletions packages/payment-processor/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"src/**/*.ts": ["tslint --project . --fix", "prettier --single-quote --write", "git add"]
}
19 changes: 19 additions & 0 deletions packages/payment-processor/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extension": [
".ts"
],
"include": [
"src/*.ts",
"src/**/*.ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"json",
"html"
],
"sourceMap":true,
"all": true
}
5 changes: 5 additions & 0 deletions packages/payment-processor/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"mochaExplorer.files": "**/test/**/*.ts",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.cwd": "../.."
}
11 changes: 11 additions & 0 deletions packages/payment-processor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @requestnetwork/payment-processor

`@requestnetwork/payment-processor` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It contains client-side payment methods for:

- ERC20 proxy contract
- ETH input data

### Basic Usage

see [ERC20](/packages/usage-examples/src/pay-erc20-request.ts) and [ETH](/packages/usage-examples/src/pay-eth-request.ts) usage examples.
69 changes: 69 additions & 0 deletions packages/payment-processor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "@requestnetwork/payment-processor",
"version": "0.12.0",
"publishConfig": {
"access": "public"
},
"description": "Payment processing using ethers.",
"keywords": [
"requestnetwork"
],
"repository": {
"type": "git",
"url": "git+https://github.com/RequestNetwork/requestNetwork.git"
},
"homepage": "https://github.com/RequestNetwork/requestNetwork/tree/master/packages/payment-processor#readme",
"bugs": {
"url": "https://github.com/RequestNetwork/requestNetwork/issues"
},
"license": "MIT",
"engines": {
"node": ">=8.0.0"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"directories": {
"lib": "src",
"test": "test"
},
"files": [
"dist"
],
"scripts": {
"build": "tsc -b",
"clean": "shx rm -rf dist tsconfig.tsbuildinfo",
"lint": "tslint --project . && eslint \"src/**/*.ts\"",
"lint-staged": "lint-staged",
"prepare": "yarn run build",
"test": "nyc mocha --extension ts --require ts-node/register --require source-map-support/register \"test/**/*.ts\"",
"test:watch": "yarn test --watch"
},
"dependencies": {
"@requestnetwork/payment-detection": "0.12.0",
"@requestnetwork/smart-contracts": "0.3.0",
"@requestnetwork/types": "0.11.0",
"@requestnetwork/utils": "0.10.0",
"ethers": "4.0.43"
},
"devDependencies": {
"@types/chai": "4.1.7",
"@types/mocha": "5.2.7",
"@types/sinon": "7.5.0",
"@typescript-eslint/parser": "1.2.0",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"chai-spies": "1.0.0",
"eslint": "5.13.0",
"eslint-plugin-spellcheck": "0.0.14",
"eslint-plugin-typescript": "0.14.0",
"lint-staged": "8.1.3",
"mocha": "6.2.2",
"nyc": "15.0.0",
"prettier": "1.19.1",
"shx": "0.3.2",
"sinon": "7.5.0",
"source-map-support": "0.5.13",
"tslint": "5.12.1",
"typescript": "3.7.2"
}
}
Loading

0 comments on commit a2ce521

Please sign in to comment.