Code Monkey home page Code Monkey logo

mercado_pago_flutter's Introduction

Mercado Pago Helper

pub package

A flutter plugin to integrate MercadoPago into flutter app. So far I completed the basic functions which includes:

  • New user
  • New card
  • Associate card with user
  • Get all card by user
  • Token with card
  • Create payment

Usage

Setup MercadoPago credentials first

import 'package:mercado_pago/mercado_pago.dart';
final credentials = MercadoCredentials(
    publicKey: 'PUBLIC-KEY-TEST',
    accessToken: 'ACCESS-TOKE-TEST'
);

This plugin is in very initial stage, I am using it in my personal app. Future plan is to complete all the remaining API.

mercado_pago_flutter's People

Contributors

br-programmer avatar briansalvattore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mercado_pago_flutter's Issues

ERROR: Card not found

Hola!

Trato de realizar un pago en producción y me encuentro con este problema:

{message: Card not found, error: bad_request, status: 400, cause: [{code: 2010, description: Card not found, data: null}]}

He podido registrar tarjetas de crédito y asociarlas a usuarios existentes, así como obtener el token id de todas las tarjetas; sin embargo, cada vez que voy a registrar un pago me encuentro con el mismo "Card not found". Importante destacar que el error NO es "Card Token not found".

Me da la sensación de que el error está relacionado al token id. Aún así, si busco un token id con /v1/card_tokens/token_id esto es lo que me aparece:

{"id":"3e87604eacd38c3b2120XXXXXXXXXX","public_key":"APP_XXXXXXXXXX","card_id":"5180920000826198","status":"active","date_created":"2019-12-31T14:03:25.000-04:00","date_last_updated":"2019-12-31T14:03:25.000-04:00","date_due":"2020-01-08T14:03:25.000-04:00","luhn_validation":false,"live_mode":false,"require_esc":false,"security_code_length":3}

No identifico ningún problema en lo anterior, pero no sé qué más pueda estarlo generando.

¿Alguna idea de cómo solucionar este problema?

¡Gracias!

plugin pagos con tarjeta credito

Hola Brian,

primero antes que nada , destaco el gran trabajo de integración de la API de mercado pago en flutter.

Ahora mismo estoy probando los métodos de la librería y no he podido crear un pago.

me sale el siguiente error:

/flutter (20755): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type 'int' is not a subtype of type 'String'
E/flutter (20755): #0 MercadoPago._response (package:mercado_pago/src/services.dart:45:56)
E/flutter (20755):
E/flutter (20755): #1 MercadoPago._post (package:mercado_pago/src/services.dart:66:12)
E/flutter (20755):
E/flutter (20755): #2 MercadoPago.createPayment (package:mercado_pago/src/services.dart:172:18)
E/flutter (20755):

Respuesta:
{message: Invalid card_token_id, error: bad_request, status: 400, cause: [{code: 3003, description: Invalid card_token_id, data: null}]

Status Code:
400

Algún tip para resolverlo?

Es un error? o podemos decir que este comportamiento ocurre por estar en modo de pruebas?

Gracias por responder.

estoy dispuesto a colaborar en este proyecto

un cordial saludo.

dejo mis datos de contacto
[email protected]
www.stratosoft.co

Contribution guide missing

I was think to work on something like it, I saw you already have work here, I'd like to contribute for it

error type int

Dear Brian,
Could you assist us in solving the following error?
When performing a test with your package, the error:
Unhandled Exception: type 'int' is not a subtype of type 'String'
can you help us?
thank you
best regards
Fernando
erro
erro.txt

=============TesteMP.dart
import 'mercadopago_sdk.dart';
import 'package:mercado_pago/mercado_pago.dart';

void TesteMP() async {

final credentials = MercadoCredentials(
publicKey: 'TEST-59c4b3db-c3a1-497f-b3bf-2b30d1098f62 ',
accessToken:
'TEST-7896675079358170-031315-3982f73416aa999c190f8c4783a58999-535515908');

await MercadoPago(credentials)
.newUser(
firstname: 'Brian',
lastName: 'Castillo',
email: '[email protected]');

await MercadoPago(credentials)
.newCard(name: "fernando",
code: '333',
year: '2020',
month: 9,
card: '4235647728025682',
docNumber: '85695236',
docType: 'DNI');

final mercado = await MercadoPago(credentials)
.tokenWithCard(
code: '333',
card: '4235647728025682');
print(mercado.data);
MercadoPago(credentials)
.createPayment(
total: 5.0,
cardToken: '8f3e30ddbd518568d6db1ebca76719ae',
description: 'Test pay',
paymentMethod: 'visa',
userId: '387451443-R0Ex7Ij6LdITGi',
email: '[email protected]'
);
}

Please, we want to generate the payment card token

One of the biggest difficulties in integrating with payment methods without using the native platform, is generating the card token. This is because there are several complex steps that a library would solve very well. This library expects a card token but is unable to generate it. How about implementing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.