payitgo library

Dart client for the payitgo crypto payment gateway.

On your server, with your secret key:

final payitgo = Payitgo(Platform.environment['PAYITGO_KEY']!);
final payment = await payitgo.payments.create(orderId: 'ORD-1001', amountUsd: 10, token: 'USDT_TRC20');
// send the customer to payment.checkoutUrl; fulfil on the payment.confirmed webhook

In a Flutter app, never with a secret key: PayitgoCheckout shows a payment your backend created, from its checkout token.

Classes

Deposit
One transfer to a payment's address.
EventPage
One page of Events.list: events, oldest first; while hasMore, read on with after the last event's id.
Events
The key's mode's events, each as its webhook carried it (the same id, type, livemode, created_at and data), kept whether it was delivered or not. Any account key reads them, read-only ones too; a storefront's key is refused (403).
Payitgo
The payitgo client, for your server. The API key (apiKey, a test or a live key: isLive says which) is a secret: never put it in a Flutter app; use PayitgoCheckout there.
PayitgoCheckout
The payer's side of a payment, without any key: safe in a Flutter app. Your backend creates the payment and hands the app its checkout_token.
Payment
A payment, as the API returns it. Amounts are decimal strings; raw holds every field.
PaymentList
One page of payments.
Payments
PayoutApproval
A team member's approval of a batch.
PayoutAssetTotal
A batch's valid payments in one coin.
PayoutBatch
A batch of payments, checked, priced, approved and funded together; or your open list of payout requests (open). raw holds every field.
PayoutBatches
Batches: a whole list of payments at once. Reading works with any key; the rest needs a key with payouts on.
PayoutBatchList
One page of batches.
PayoutClaim
A claim link's state: the payment's recipient opens url and chooses the coin and the address.
PayoutConversion
A payment paid in another coin than the wallet's, converted on its way: you asked to pay toAmount of to; its recipient receives about estimate, and amountOut once it is sent.
PayoutCounts
A batch's payments by status.
PayoutCoverage
What sending your valid payout requests in one coin takes (needed) against what the wallet can spend: topUp is the difference to send to address first.
PayoutInbox
Your open payout requests: the list itself (a batch with its totals and counts), what sending them takes of each coin, and one page of them.
PayoutIssue
Something wrong with a payment (in PayoutItem.errors: it is left out) or worth knowing (in PayoutItem.warnings: it still goes).
PayoutItem
One payment to a recipient: a payout request, or a row of a batch. Amounts are decimal strings in the payment's coin (for a converted payment, the wallet's coin: see convert); raw holds every field.
PayoutItemInput
One payment to a recipient, as you give it to Payouts.quote, PayoutBatches.create and PayoutBatches.addItems. Fields left null are not sent.
PayoutItemList
One page of a batch's payments.
PayoutPage
One page of Payouts.list: items, oldest change first. While hasMore, read on with nextCursor; once it is false, keep nextCursor to read what changes next time.
PayoutQuote
The totals a batch of the quoted payments would have.
PayoutQuoteResult
What Payouts.quote returns: the quote, and the items as they would be, each with its fees and issues. Nothing is kept.
PayoutRecipient
Who a payment is for, as you named them; each null when not given.
PayoutRejection
Who rejected a batch, when, and why.
PayoutRemoveResult
What Payouts.remove did with one id: item when the request is out of the list (removed now, or before), or error when it is not.
Payouts
Payout requests: each of your clients' payouts, sent as it comes in. payitgo checks and prices it, keeps it in your open list with its costs, and sends the list when you ask (send), or by itself with auto-send in your payout settings. Reading works with any key; the rest needs a key with payouts on.
PayoutSchedule
A schedule, which makes the same batch again and again (a payroll): the summary a payout_schedule.run event carries, without its payments. Schedules are set up in the dashboard.
PayoutScheduleFunding
What a schedule's next run lacks: the data of a payout_schedule.funding_needed event, sent a few days before the run.
PayoutShortfall
How much more of a coin the payout wallet needs, and where to send it.
PayoutWaiting
Why a batch waits for funding, and since when.
PayoutWallet
Your payout wallet on one network: where to top it up, and what it holds of each coin it pays in.
PayoutWalletAsset
What a payout wallet holds of one coin.
PayoutWallets
Your payout wallets: one address per network (tron, bsc, …), made the first time they are asked for.
PayoutWithdrawal
A payout wallet's coin sent back to one of your payout addresses: the data of a payout_wallet.withdrawn or payout_wallet.withdrawal_failed event.
PreviousCoin
A coin chosen for a payment before its current one, when the customer changed it. Its address is still watched.
Simulation
A test payment's simulated outcome, and how far it is.
TokenInfo
A token a customer can pay with. minUsd and networkFeeUsd move with the network's fees.
Tokens
Webhook
WebhookDelivery
One event on its way to one URL; raw holds every field.
WebhookDeliveryAttempt
One try at a delivery, or a person's action on it.
WebhookEvent
A webhook event: a verified notification, or one replayed by payitgo.events.list (the same body).
Webhooks
The webhook (IPN) of the key's mode: a test key manages the test webhook, a live key the live one. A storefront's key may read and test it, not change it.
WebhookSettings
The webhook (IPN) of the key's mode: the URL every event of the mode is POSTed to, and the secret that signs them; raw holds every field.

Exceptions / Errors

PayitgoException
The API refused the request. status is the HTTP status, or 0 for a network error.
SignatureVerificationException
A webhook request whose signature or timestamp did not check out.