mpcheckout 1.1.0 copy "mpcheckout: ^1.1.0" to clipboard
mpcheckout: ^1.1.0 copied to clipboard

An unofficial package of MercadoPago Mobile Checkout.

mpcheckout #

pub package style: very good analysis

An unofficial package of MercadoPago Mobile Checkout.

Invitame un café en cafecito.app

Requirements #

  • Android minSdk 19
  • iOS 10.0

iOS #

Currently IOS is no longer supported because MercadoPago changed the px-ios SDK repo to private mode and we can no longer use this SDK.

How to use #

First you need to initialize credentials

/// initialize credentials
  mp = Mpcheckout.initialize(
      clientID: 'clientID', 
      publicKey: 'publicKey', 
      accesToken: 'accesToken',
  );
  runApp(MaterialApp(home: MyApp()));

Then create a preference

final Preference _pref = Preference(
  statementDescriptor: 'statementDescriptor',
  additionalInfo: 'additionalInfo',
  items: [
    Items(
    title: 'Test',
    quantity: 1, 
    unitPrice: 120,
    ),
  ],
  paymentMethods: PaymentMethods(
    excludedPaymentTypes: [
      ExcludedPaymentTypes(id: 'ticket'),
      ExcludedPaymentTypes(id: 'atm'),
    ],
  ),
  payer: Payer(
    email: 'test@test.com',
  ),
  shipments: Shipments(
      mode: 'not_specified', 
      freeShipping: false, 
      cost: 350,
      ),
);

Finally start the checkout

try {
    final result = await mp.startCheckout(_pref);
    if (result.status == 'rejected') {
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: Text('Rejected'),
        backgroundColor: Colors.red,
    ));
    }
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: Text('Success'),
        backgroundColor: Colors.red,
    ));
} on MpException catch (error) {
    print(error.message);
}
5
likes
0
pub points
21%
popularity

Publisher

unverified uploader

An unofficial package of MercadoPago Mobile Checkout.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, freezed_annotation, http, json_annotation

More

Packages that depend on mpcheckout