briansalvattore / mercado_pago_flutter

MIT License
26 stars 14 forks source link

error type int #5

Closed fapcruz closed 4 years ago

fapcruz commented 4 years ago

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: 'brian@castillo90.com');

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: 'jperez1@asasas.com' ); }

briansalvattore commented 4 years ago

Hi, Mercadopago changed the response type to String.

I just uploaded an update correcting the error. I hope it

helps.https://pub.dev/packages/mercado_pago