cielo_zero_auth 1.0.2

Flutter Android iOS web

A Flutter package that helps to use Cielo's Zero Auth.

example/main.dart

import 'package:cielo_zero_auth/cielo_zero_auth.dart';

void main(List<String> arguments) async {
  var zeroAuth = CieloZeroAuth(
    clientId: "YOUR-CLIENT-ID",
    clientSecret: "YOUR-CLIENT-SECRET",
    merchantId: "YOUR-MERCHANT-ID",
    environment: Environment.SANDBOX,
  );

  var result = await zeroAuth.validate(ZeroAuthRequest(
    cardNumber: "1234123412341234",
    cardType: CardType.CreditCard,
    holder: "Maurici Ferreira Junior",
    expirationDate: "01/2030",
    securityCode: "123",
    saveCard: false,
    brand: "Visa",
    cardOnFile: CardOnFile(
      usage: Usage.Used,
      reason: Reason.Recurring,
    ),
  ));

  print(result.statusCode);

  if (result.zeroAuthErrorResponse != null) {
    result.zeroAuthErrorResponse.forEach((e) {
      print("ErrorCode: ${e.code}");
      print("ErrorMessage: ${e.message}");
    });
  }

  if (result.zeroAuthResponse != null) {
    print(result.zeroAuthResponse.valid);
    print(result.zeroAuthResponse.returnCode);
    print(result.zeroAuthResponse.returnCode);
    print(result.zeroAuthResponse.issuerTransactionId);
  }
}
0
likes
80
pub points
31%
popularity

A Flutter package that helps to use Cielo's Zero Auth.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

braspag.sdk@gmail.com

License

MIT (LICENSE)

Dependencies

cielo_oauth, flutter, http, json_annotation

More

Packages that depend on cielo_zero_auth