mercado_pago_integration 1.1.9 copy "mercado_pago_integration: ^1.1.9" to clipboard
mercado_pago_integration: ^1.1.9 copied to clipboard

MercadoPago Mobile Checkout Integration for android and ios. Easy to install, Easy to integrate, Android Support, IOS Support.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:mercado_pago_integration/core/failures.dart';
import 'package:mercado_pago_integration/mercado_pago_integration.dart';
import 'package:mercado_pago_integration/models/payment.dart';

final Map<String, Object> preference = {
  'items': [
    {
      'title': 'Test Product',
      'description': 'Description',
      'quantity': 3,
      'currency_id': 'ARS',
      'unit_price': 1500,
    }
  ],
  'payer': {'name': 'Buyer G.', 'email': 'test@gmail.com'},
};
void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Mercado Pago Integration Example'),
        ),
        body: Center(
          child: RaisedButton(
            onPressed: () async {
              (await MercadoPagoIntegration.startCheckout(
                publicKey: "PUBLIC_KEY",
                preference: preference,
                accessToken: "ACCESS_TOKEN",
              ))
                  .fold((Failure failure) {
                debugPrint('Failure => ${failure.message}');
              }, (Payment payment) {
                debugPrint('Payment => ${payment.paymentId}');
              });
            },
            child: Text('Test Integration'),
          ),
        ),
      ),
    );
  }
}
20
likes
40
pub points
38%
popularity

Publisher

unverified uploader

MercadoPago Mobile Checkout Integration for android and ios. Easy to install, Easy to integrate, Android Support, IOS Support.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

dartz, equatable, flutter, intl, mercadopago_sdk

More

Packages that depend on mercado_pago_integration