Android Question MercadoPago SDK

cgili14

Member
Licensed User
Hello!
I need to integrate mercadopago to make payments from the app (for now only android).
* MercadoPago is a payment entity mostly known in Latin America

On the page there is an SDK for Java:
Can that be used in B4A?

From already thank you very much!
Greetings Cristian
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Any Android SDK can be used with B4A.

This one looks quite simple and can be accessed with a few JavaObjects calls.

Relevant examples:
Accesing third party Jar with #Additionaljar and JavaObject - Picasso
 
Upvote 0

cgili14

Member
Licensed User
Thanks for the reply Erel!
Try to compile the sdk with SimpleLibraryCompiler (v1.11) but it gives me error.


Also try compiling with Eclipse, but I don't know what to mark in the compilation, the tests I did returned errors


El error lo devuelve GetMp:
java.lang.ClassNotFoundException: com $ mercadopago $ Mercadopago

MercadopagoTest:
Sub Activity_Create(FirstTime As Boolean)
    'MercadoPago.SDK.setClientSecret(System.getenv("CLIENT_SECRET_OK"));
    GetMp.RunMethodJO("setClientSecret", Array(clientSecretKey))
    GetMp.RunMethodJO("setClientId", Array(clientID))
End Sub

Sub GetContext As JavaObject
    Return GetBA.GetField("context")
End Sub

Sub GetBA As JavaObject
    Dim jo As JavaObject
    Dim cls As String = Me
    cls = cls.SubString("class ".Length)
    jo.InitializeStatic(cls)
    Return jo.GetFieldJO("processBA")
End Sub

Sub GetMp As JavaObject
    Dim jo As JavaObject
    'com.squareup.picasso.Picasso.with(context)
    Return jo.InitializeStatic("com.mercadopago.Mercadopago").RunMethod("SDK", Array(GetContext))
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Try to compile the sdk with SimpleLibraryCompiler (v1.11) but it gives me error.
You can not use the original project and compile it with SLC without writing a wrapper first.
It will not work the way you did.

About the error: you need to add the gson jar to the libs folder and reference it in the eclipse project.
 
Upvote 0

Sergio Castellari

Active Member
Licensed User

Hello Cristian!
I am interested in the subject. MercadoPago is very popular in Argentina, and I would like to know if you have managed to make it work.

Cheers,
Sergio
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
tips:

B4J version 1.5.x mercadopago


Packages

JAVA version 1.6.x

android 4.43.x




 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
You must use the certificate because it uses "cURL RestClient"

Solution if you don't have a certificate on your SEVER or development PC

sorry spanish guide

Info:
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
in cpanel Admin:


benny Vasquez

I love her
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…