telepay_dio

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

telepay dio

telepay_dio #


TelePay client for Dart language, to easily process cryptocurrency payments using http client Dio.
Getting Started #
Check the full example here.
Install #
Add to dependencies on pubspec.yaml:
dependencies:
telepay_dio: <version>
copied to clipboard
Make Your First Request #
The first thing is to create an instance of TelePayDio for later use, which receives two parameters, your API private key and an instance of Dio.
final telepay = TelePayDio(secretApiKey: 'your_secret_api_key', dio: Dio());
copied to clipboard
๐Ÿšจ WARNING ๐Ÿšจ
Your secretApiKey is confidential and meant to be used by you. Anyone who has your project key can access your merchant. Please, do not share it or commit it in your code.
Methods
getMe
Get the current merchant info.
final me = await telepay.getMe();
copied to clipboard
getAssets
Get all the assets suported by TelePay.
final assets = await telepay.getAssets();
copied to clipboard
getBalance
Get the balance of the all your wallets.
final balance = await telepay.getBalance();
copied to clipboard
getInvoices
Get all the invoices the your merchant.
final invoices = await telepay.getInvoices();
copied to clipboard
createInvoice
Creates an invoice, associated to your merchant.
final invoiceCreate = await telepay.createInvoice(
const CreateInvoice(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 3.5,
),
);
copied to clipboard
getInvoice
Get a specific invoice etails, by invoice number.
final invoice = await telepay.getInvoice('YYXZT1U7Q2P8');
copied to clipboard
cancelInvoice
Cancel invoice, by its number.
final invoiceCancel = await telepay.cancelInvoice('FNGUA7LR6B');
copied to clipboard
deleteInvoice
Delete invoice, by its number.
final isDelete = await telepay.deleteInvoice('FNGUA7LR6BYYY');
copied to clipboard
transfer
Create a tranferent between internal wallets, thsi is a off-chain operation
final transfer = await telepay.transfer(
const CreateTransfer(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 3.5,
username: 'yeikel16',
),
);
copied to clipboard
getWithdrawMinimum
Get minimum fee for a specific asset for withdraw.
final withdrawMin =
await telepay.getWithdrawMinimum('TON', 'TON', 'testnet');
copied to clipboard
getWithdrawFee
Get estimated withdraw fee, composed of blockchain fee and processing fee.
final withdrawFee = await telepay.getWithdrawFee(
const CreateWithdraw(
asset: 'TON',
blockchain: 'TON',
network: 'testnet',
amount: 5.2,
toAddress: 'EQAwEl_ExMqFJIjfitPRPTdV_B9KTgHG-YognX6iKRWHdpX1',
),
);
copied to clipboard
Running Tests ๐Ÿงช #
To run all unit tests use the following command:
dart test --coverage="/coveraga" --test-randomize-ordering-seed random

copied to clipboard
To view the generated coverage report you can use coverde.
# Filter the tested files.
coverde filter -f \.g\.dart

# Generate Coverage Report and open in browser.
coverde report -l
copied to clipboard

Bugs or Requests #
If you want to report a problem or would like to add a new feature, feel free to open an issue on GitHub. Pull requests are also welcome.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.