cielo_zero_auth 1.0.4 copy "cielo_zero_auth: ^1.0.4" to clipboard
cielo_zero_auth: ^1.0.4 copied to clipboard

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
30
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

cielo_oauth, flutter, http, json_annotation

More

Packages that depend on cielo_zero_auth