fourpaypayments 0.1.3 copy "fourpaypayments: ^0.1.3" to clipboard
fourpaypayments: ^0.1.3 copied to clipboard

outdated

4pay.online allows you to accept payments - comfortably and safely.

4PayPayments #

4PayPayments.

class PaymentResult {
  String errorText;
  bool get hasError => (errorText ?? "").isNotEmpty;
  String response;
}

Example #

PaymentResult result;
if (Platform.isIOS) {
    result = await FourPayPayments.makeApplePayment(
        <authToken>,
        <merchant_identifier>,
        label: 'Label',
        description: 'Description',
        amount: 1,
        txid: Uuid().v1(),
    );
} else if (Platform.isAndroid){
    result = await FourPayPayments.makeGooglePayment(
        <authToken>,
        <merchantId>,
        amount: 1,
        description: 'Description',
        gateway: <gateway>,
        environment: <'test' or 'production'>,
        merchantInfo: <merchantName>,
        txid: Uuid().v1(),
    );
} else {
    throw UnsupportedError("Unsupported platform");
}
if (result.hasError) {
    print(result.errorText);
} else {
    print(result.response);
}
3
likes
30
pub points
0%
popularity

Publisher

verified publisher4pay.online

4pay.online allows you to accept payments - comfortably and safely.

Homepage

License

unknown (LICENSE)

Dependencies

dio, flutter

More

Packages that depend on fourpaypayments