Giter Club home page Giter Club logo

mercadopago_sdk_dart's People

Contributors

hostelix 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mercadopago_sdk_dart's Issues

Public key and access token

According MercadoPago documentation to generate a preference, you need a Public Key and Access Token and not a Client Id and Client Secret.

I tried to get preference sending using de constructor MP('public_key','access_token') but didn't work, so i suppose that the Client id is not the same as Public Key and Client Secret is not the same as Access Token.

iOS support

Is this plugin ready for iOS? it says so in pub.dev, but I dont see any way it can be implemented.

Thanks.

Error on calling get

Im trying to get users or pay method and I have this error:

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The getter 'keys' was called on null.
Receiver: null
Tried calling: keys

If a try by the URL by web i receive the information.

The caller is:

mp.get("/v1/payment_methods", authenticate: true, params: {});

Thanks!

It's not a issue, it's a doubt

Can you tell me if with this api i can create a pending payment to be released in X days?
I need to meet two scenarios:

  1. user makes a purchase, I hold this amount for 2 days, after two days I cancel and return it, like a guarantee.
  2. user makes a purchase, I hold for 2 days, after the two days I effect the payment.

Recurring Payment

Hello BMKeros,

Is it possible to use a recurring payment with this api?

Thank you,
Elaine

ERROR de seguridad

Como ya lo han reportado, el "quemar" tanto el client id como el client secret y el access token es una brecha de seguridad gigante por lo que no es recomendado el uso de este plugin mientras no haya manera de cifrar esas credenciales.

Error using it with image_picker

Because mercadopago_sdk 1.2.0 depends on http ^0.12.0 and no versions of mercadopago_sdk match >1.2.0 <2.0.0, mercadopago_sdk ^1.2.0 requires http ^0.12.0.
So, because .... depends on both http ^0.13.0 and mercadopago_sdk ^1.2.0, version solving failed.

preference info

hello!
I'm having some problems trying to implement the funcionality "getpreference"
It lead's me to an error message.

the code is:

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:mood/classes.dart';
import 'package:mood/style/components/textFieldFormularios.dart';
import 'package:mood/style/fonts.dart';
import 'package:flutter_google_pay/flutter_google_pay.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

class CartaoPage extends StatefulWidget {
CartaoPage(this.mediaHeight, this.mediaWidth, {Key key})
: super(key: key);
final double mediaHeight;
final double mediaWidth;

@OverRide
CartaoPageState createState() => new CartaoPageState();
}

class CartaoPageState extends State {
@OverRide
void initState() {
super.initState();
}

@OverRide
Widget build(BuildContext context) {
MercadoPago mercadoInstance = new MercadoPago();
_makeCustomPayment() async {
var environment = 'rest'; // or 'production'

  if (!(await FlutterGooglePay.isAvailable(environment))) {
    print('Google pay not available');
  } else {
    ///docs https://developers.google.com/pay/api/android/guides/tutorial
    PaymentBuilder pb = PaymentBuilder()
      ..addGateway( "PAYMENT_GATEWAY","3359798608018742195")
      ..addTransactionInfo("1.0", "USD")
      ..addAllowedCardAuthMethods(["PAN_ONLY", "CRYPTOGRAM_3DS"])
      ..addAllowedCardNetworks(
          ["AMEX", "DISCOVER", "JCB", "MASTERCARD", "VISA"]
      )
      ..addBillingAddressRequired(true)
      ..addPhoneNumberRequired(true)
      ..addShippingAddressRequired(true)
      ..addShippingSupportedCountries(["US", "GB","BR"])
      ..addMerchantInfo("Example");

    Result result = await FlutterGooglePay.makeCustomPayment(pb.build()).catchError((error) {
      print(error);
    });
    if (result.status == ResultStatus.SUCCESS) {
      print('Success');
    } else if (result.error != null) {
      print(result.error);
    }
  }
}

Future<Map<String, dynamic>> index() async {
  var payer = {
    'email': '[email protected]'
  };
  var preference = {
    "items": [
      {
        "title": "Test",
        "quantity": 1,
        "currency_id": "BRL",
        "unit_price": 10.4,
        "payer":payer
      }
    ],
  };

  var result = await mercadoInstance.mp.createPreference(preference);

  return result;
}

_launchURL(String url) async {
  if (await canLaunch(url)) {
    await launch(url);
  } else {
    throw 'Could not launch $url';
  }
}

return Scaffold(
  backgroundColor: Color(0xff5c31b8),
  appBar: AppBar(
    backgroundColor: Color(0xff5c31b8),
    elevation: 0,
    actions: <Widget>[],
  ),
  body: SingleChildScrollView(
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ConstrainedBox(
              constraints: BoxConstraints(
                maxWidth: widget.mediaWidth * 0.9,
              ),
              child: TextFieldFormulario(
                context,
                textInputAction: TextInputAction.next,
                style: AntipastoTextStyle(
                    color: Colors.white, fontSize: 20.0),
                labelText: "Numero do Cartão ",
                labelStyle: AntipastoTextStyle(
                    color: Colors.white, fontSize: 20.0),
              ),
            ),
          ],
        ),
        FlatButton(
          child: Text('Google Pay'),
          onPressed: ()async{
            _makeCustomPayment();
          },
        ),
        FlatButton(
          child: Text('Mercado Pago'),
          onPressed: ()async{
            var payment = await index();
            print(payment);
            var url = payment['response']["sandbox_init_point"];
            String iDe = payment['response']["id"];
            var result = await mercadoInstance.mp.getPreference(iDe);
            print(result);
          },
        )
      ],
    ),
  )
);

}
}

it gives me the error message:

Exception has occurred.
NoSuchMethodError (NoSuchMethodError: The getter 'keys' was called on null.
Receiver: null
Tried calling: keys)

Thanks

Error of integration using analyzer

Because mercadopago_sdk >=1.3.0 depends on test ^1.16.8 which depends on analyzer ^1.0.0, mercadopago_sdk >=1.3.0 requires analyzer ^1.0.0.

So, because audasiuz depends on both analyzer ^0.40.6 and mercadopago_sdk ^1.3.0, version solving failed.
pub get failed (1; So, because audasiuz depends on both analyzer ^0.40.6 and mercadopago_sdk ^1.3.0, version solving failed.)

Basic Payment Flow Example?

Any chance we could get a basic payment flow as an example? I've read the doc but I think I'm missing a lot of information.

I have created this so far, but then I'm not sure what's next on the list.

Future<void> startMP() async {
    MP mercadoPago = MP('6924219732628689', 'yd5kmBOBHhXE24GuOVK9iozt5D8vjyY2');

    String token = await mercadoPago.getAccessToken();

    var payer = {'email': '[email protected]'};

    var preference = {
      "items": [
        {
          "title": "Test01",
          "quantity": 1,
          "currency_id": "USD",
          "unit_price": 0.01,
          "payer": payer,
        }
      ],
    };

    var result = await mercadoPago.createPreference(preference);

    
  }

What's next? Thank you.

How do I create a card? No ```createCardToken``` found

I am developing a marketplace in Flutter using this package to access the MercadoPago API to build a Transparent Checkout. However, to add a card, I believe I need the createCardToken function. But it doesn't exist in the package, right? How should I implement the adding card feature?

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.