openpay_bbva library
A Flutter plugin for tokenizing card payments via the Openpay BBVA platform.
Supports iOS and Android for native Device Session ID retrieval, and all platforms (Web, Windows, macOS, Linux) for card tokenization via HTTP.
Quick start
import 'package:openpay_bbva/openpay_bbva.dart';
final openpay = OpenpayBBVA(
merchantId: 'YOUR_MERCHANT_ID',
publicApiKey: 'YOUR_PUBLIC_API_KEY',
productionMode: false,
country: Country.MX,
);
// Get the device session ID (iOS / Android only)
final deviceId = await openpay.getDeviceID();
// Tokenize a card
final token = await openpay.getCardToken(
CardInformation(
holderName: 'John Doe',
cardNumber: '4111111111111111',
expirationMonth: '12',
expirationYear: '25',
cvv2: '123',
),
);
See also:
- OpenpayBBVA — main entry point.
- CardInformation — card data model.
- TokenOpenpay — token response model.
- OpenpayExceptionError — structured error model.
- Country — supported countries.
Classes
- Address
- Address is a class that contains the address information of a card
- CardInformation
- Represents the full set of card data used for tokenization and storage within the Openpay BBVA platform.
- OpenpayApi
- Low-level HTTP client for the Openpay REST API.
- OpenpayBBVA
- Main entry point for the Openpay BBVA Flutter plugin.
- OpenpayError
- OpenpayError is a class that contains the error information.
- TokenOpenpay
- Represents the token response returned by the Openpay API after a successful card tokenization request.
Functions
-
addressFromJson(
String str) → Address - AddressFromJson is a function that returns a Address instance from a json string
-
addressToJson(
Address data) → String - AddressToJson is a function that returns a json string from a Address instance
-
cardInformationFromJson(
String str) → CardInformation - Parses a CardInformation instance from a raw JSON string.
-
cardInformationToJson(
CardInformation data) → String - Serializes a CardInformation instance to a JSON string.
-
openpayErrorFromJson(
String str) → OpenpayError -
openpayErrorToJson(
OpenpayError data) → String -
tokenOpenpayFromJson(
String str) → TokenOpenpay - Parses a TokenOpenpay instance from a raw JSON string.
-
tokenOpenpayToJson(
TokenOpenpay data) → String - Serializes a TokenOpenpay instance to a JSON string.
Exceptions / Errors
- OpenpayExceptionError
- Exception thrown when an Openpay API request fails.