IC-PayPortal - Comprehensive Payment Module for Motoko
Project highlights
IC-PayPortal is a module for Motoko that provides developers with a set of functions for managing fiat payments on the Internet Computer Protocol (ICP). The target users are developers building applications on the ICP who need to integrate payment solutions seamlessly. The project addresses the need for secure, reliable, and easy-to-implement payment processing.
Features
- Payment Gateway Integration: Supports integration with popular payment gateways like Stripe and PayPal.
- Payment Processing: Handles tasks such as creating payment requests, verifying transactions, and handling callbacks.
- Secure Transactions: Adheres to best practices in payment security.
- Error Handling: Includes robust mechanisms to handle exceptions and provide meaningful error messages.
How to install
- Clone the git repository:
git clone https://github.com/Expeera/IC-PayPortal/tree/phase-3
- Navigate to the project directory and install dependencies:
cd IC-PayPortal
npm install
- Start the local Internet Computer environment:
dfx start --clean
- Configure the fiat canister’s owner before deployment, and update Stripe’s
secret_key
and PayPal’sclient_id
andclient_secret
in theservice.mo
file. - Deploy the canisters:
dfx deploy --network local
For deployment on the Internet Computer network, use:
dfx deploy --network ic
- Update the
config.mo
file with the new assets canister ID and redeploy. - Generate TypeScript types:
npm run generate:types
- Start the development server:
npm run dev
- Run tests:
sh test/demo.sh
Usage Example
Creating New Invoice
let invoice = IC_PayPortal.create_invoice({
paymentMethod: "Stripe",
currency: "USD",
items: [/* items details */],
amount: 1000
});
Changing Invoice Status
let status = IC_PayPortal.change_invoice_status({
invoiceNo: invoice.id,
paymentMethod: "Stripe",
isSuccess: true
});
Getting User Invoices
let invoices = IC_PayPortal.get_my_invoices();
Documentation
For full documentation, please visit our GitHub repository documentation section.
Dependencies
- IC SDK latest version
- NodeJS version >= 16
- mops (Motoko package manager)
License
IC-PayPortal is open-sourced under the MIT License. For more details, refer to the LICENSE file.
Resources
- GitHub Repository: GitHub - Expeera/IC-PayPortal at phase-3
- Live Demo: https://3356i-cqaaa-aaaao-axdqa-cai.icp0.io
- YouTube Product Pitch Video: https://youtu.be/E3MfxbHCTGY
Future Plans
- Feature Additions: Enhance support for more payment gateways and add multi-currency support.
- Conferences: Plan to present at upcoming blockchain and decentralized application conferences.
- Grants: Apply for additional development grants to further expand the project capabilities.