sucrose 0.0.3+1 copy "sucrose: ^0.0.3+1" to clipboard
sucrose: ^0.0.3+1 copied to clipboard

A Bridge Payment Gateway for Xendit and any other payment gateway.

Sucrose #

A Bridge Payment Gateway for Xendit and any other payment gateway, but for now only Xendit available. Soon we'll add another payment gateway.

GitHub Repo Size Pub Version GitHub top language Codacy grade

Available Payment Gateway #

  • ✅ Xendit (WIP)
  • ❌ Midtrans (Planned)

Installation #

flutter pub add sucrose

Getting Started #

Init Xendit

import 'package:sucrose/sucrose.dart';
    
final sucrose = Sucrose.initXendit(xenditApiKey:"YOUR_API_KEY");

Create QR Payment Request

  final response = await sucrose.xendit.createQrPaymentRequest(

    // Here you can input some value.
    request: XenditQrRequest(
      amount: 10000,
      currency: XenditQRCurrency.IDR,
      paymentMethod: XenditQRPaymentMethod(
        reusability: XenditReusablePaymentMethod.ONE_TIME_USE,
        qrCode: XenditQrCodeProps(
          channelCode: XenditQRChannelCode.DANA,
        ),
      ),
      description: "",
      metadata: XenditMetadata(
        metadata: {
          "test": "test",
        },
      ),
    ),
  );

Create Invoice

  final response = await sucrose.xendit.createInvoice(
    request: XenditInvoiceRequest(
      externalId: "ref 13123213",
      amount: 10000,
      description: "your description goes here",
      payerEmail: "hello@mail.com",
      items: [
        XenditInvoiceItem(
          name: "item 1",
          price: 10000,
          quantity: 1,
          category: "meow",
          url: "https://google.com",
        ),
      ],
    ),
  );

Feedback #

If you have any feedback, please reach out to us at evnx32@gmail.com

2
likes
0
pub points
12%
popularity

Publisher

unverified uploader

A Bridge Payment Gateway for Xendit and any other payment gateway.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, logger

More

Packages that depend on sucrose