https://github.com/dfinity/invoice-canister
Providing an example and simplified experience for accepting payments in smart contracts
https://github.com/dfinity/invoice-canister
Last synced: about 1 month ago
JSON representation
Providing an example and simplified experience for accepting payments in smart contracts
- Host: GitHub
- URL: https://github.com/dfinity/invoice-canister
- Owner: dfinity
- License: apache-2.0
- Created: 2022-01-05T19:06:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-08T21:32:42.000Z (over 3 years ago)
- Last Synced: 2023-04-10T07:32:21.211Z (about 3 years ago)
- Language: Motoko
- Size: 9.77 MB
- Stars: 38
- Watchers: 43
- Forks: 14
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Invoice Canister
This project provides a simple interface for creating and paying invoices in various tokens on the Internet Computer. It is a custodial solution, intended to be a simple, drop-in payments solution for any canister. To read more about the design of the canister, see the [Design Doc](./docs/DesignDoc.md).
## IMPORTANT / DISCLAIMER
This project is to be used for educational purposes only. It has [known security vulnerabilities](https://github.com/dfinity/invoice-canister/issues). As such, it should not be used in any real-world / production context where money is at stake. Please proceed with thoughtfulness and attention.
## Integrating with the Invoice Canister
Include this code in your `dfx.json` and follow our `self-hosted` example: TODO
## Getting Started - Development
Make sure you have followed the DFX installation instructions from https://smartcontracts.org.
Run the `install-local.sh` script to install the ICP ledger and and the invoice canister on your device. You can make calls using the `dfx` sdk, or you can see test cases running through the flows under the `test` directory.
## Testing
To test, you will need to install `moc` from the latest `motoko--.tar.gz` release. https://github.com/dfinity/motoko/releases.
Then, install Vessel following the guide at https://github.com/dfinity/vessel.
You will also need to install `wasmtime`. For macOS, you can install with `brew install wasmtime`. For Linux, you can install with `sudo apt-get install wasmtime`.
To run unit tests, use `make test`.
To run the end-to-end JavaScript tests, first install fresh with with `./install-local.sh`. Then, run `npm test`.