Skip to main content

daravel_payments 1.25.0 copy "daravel_payments: ^1.25.0" to clipboard
daravel_payments: ^1.25.0 copied to clipboard

Payments for Daravel through Midtrans, Xendit and Stripe. Verified webhooks applied exactly once, amounts checked, events after commit, and a fake for tests.

Daravel

daravel_payments #

English · Bahasa Indonesia

Payments for Daravel through Midtrans, Xendit and Stripe, behind one API. A paid notification is applied once, from the gateway only, for the amount ordered.

dart pub add daravel_payments
Application createApp() => Application.configure(basePath: '.')
    .withPayments()                                  // POST /payments/webhook/{gateway}
    .withMigrations(const [CreatePaymentTables()])
    // ...
    .create();

final checkout = await Payment.checkout(
  const PaymentRequest(orderId: 'ORDER-42', amount: 150000),
);
// checkout.redirectUrl: the gateway's payment page

events.listen<PaymentPaid>((paid) => fulfil(paid.payment.orderId));
  • Midtrans Snap (QRIS, virtual accounts, e-wallets, cards); notifications checked with SHA512(order_id + status_code + gross_amount + server key).
  • Xendit invoices; callbacks checked with the x-callback-token.
  • Stripe Checkout; webhooks checked with the v1 HMAC-SHA256 of the timestamped body, five minutes of tolerance.
  • Exactly once: an idempotency log keyed on the notification, the payment row locked, the amount compared with the order's, status moves that only go forward (a late pending never undoes paid), events after commit.
  • Payment.fake() for tests, dartisan payment:check <order> for a missed webhook.

Documentation: https://github.com/daravel-dev/daravel/blob/main/docs/guide/payments.md.

License and trademarks #

MIT. "Laravel" is a trademark of Laravel Holdings Inc.; "Dart" is a trademark of Google LLC. Midtrans, Xendit and Stripe are trademarks of their owners. Daravel is an independent project, not affiliated with or endorsed by any of them.

0
likes
160
points
452
downloads

Documentation

Documentation
API reference

Publisher

verified publisherframework.daravel.dev

Weekly Downloads

Payments for Daravel through Midtrans, Xendit and Stripe. Verified webhooks applied exactly once, amounts checked, events after commit, and a fake for tests.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#payments #midtrans #xendit #stripe #server

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

crypto, daravel, dartisan_cli

More

Packages that depend on daravel_payments