Android Question [Solved]payment gateway help

Carlos marin

Active Member
Licensed User
Longtime User
Hello everyone

I am trying to implement a payment gateway for my clients, but I have 2 problems
First: the platform provides me with an SDK for android but it does not work for b4a

Second: they give me a script which I run anywhere and it takes me to the payment server, try to load it in the WebView and even though it generates the payment button when I click it, it does not load anything. Can you help me? I've been in this for several days and I do not know what to do, I also try WebViewExtras but I do not even load the button. Any help or indication my sincere thanks

This is the test script:

B4X:
<form>
        <script
            src="https://checkout.epayco.co/checkout.js"
            class="epayco-button"
            data-epayco-key="491d6a0b6e992cf924edd8d3d088aff1"
            data-epayco-amount="50000"
            data-epayco-name="Vestido Mujer Primavera"
            data-epayco-description="Vestido Mujer Primavera"
            data-epayco-currency="cop"
            data-epayco-country="co"
            data-epayco-test="true"
            data-epayco-external="false"
            data-epayco-response="https://ejemplo.com/respuesta.html"
            data-epayco-confirmation="https://ejemplo.com/confirmacion">
        </script>
    </form>

respond_page is the page that should load me when I click on the button

-----spanish------
Hola a todos

Estoy intentando implementar una pasarela de pagos para mis clientes, pero tengo 2 problemas
Primero: la plataforma me proporciona un SDK para android pero este no me sirve para b4a
Segundo: me dan un script el cual ejecuto en cualquier parte y me lleva al servidor de pago, intente cargar este en el webview y aunque me genera el botón de pago al darle clic no me carga nada me pueden ayudar? Llevo varios días en esto y no sé que hacer, también intente con webviewextras pero no me carga ni el botón. Cualquier ayuda o indicación mis sinceros agradecimientos
Este es el script de prueba:
 

Attachments

  • respond_page.png
    respond_page.png
    33.5 KB · Views: 449

Carlos marin

Active Member
Licensed User
Longtime User
I have seen that you convert the B64 string to byte. I think you have to write iv-i=i without further conversions. before sending the request.
See:
B4X:
 url_r = EncryptText("https://www.epayco.co/respuesta", iv)
    url_com = EncryptText("https://www.epayco/callback", iv)
    metcom = EncryptText("POST", iv)
   ' iv_i = Bconv.StringToBytes(i, "UTF8")
    iv_i=i
    pruebas = EncryptText("true", iv)
 
    ToastMessageShow("Listo",True)


Corrected! the two variables are in string. but I have a doubt is that the example encryption is sent in a string and here is sent in bytes that will influence something?

look the example

B4X:
url_respuesta: "tzhPnWgJOaHdH75arHBQh/DdyiJHjhC8mA8pJvYRTh4=",
            url_confirmacion: "tzhPnWgJOaHdH75arHBQh/DdyiJHjhC8mA8pJvYRTh4=",
            metodoconfirmacion": "JY8t3swUoHU4HV+AgyWF+Q==",
            lenguaje: "php",
            i: "MDAwMDAwMDAwMDAwMDAwMA==",
           enpruebas: "vxGQj9FZusNz6NbwEzukeg=="
 
Upvote 0

Carlos marin

Active Member
Licensed User
Longtime User
I raise my hands...


do not worry, tigrot has helped me a lot. your code worked perfectly, my problem is that the encrypted information will not be sent, I will open a new tiket about the encryption. again a thousand thanks for your help tigrot and greetings from Colombia! ;););)
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
I have seen that the confirnation of the transaction is sent to an URL(that means you need a WEB site)in this case:
B4X:
url_r = EncryptText("https://www.epayco.co/respuesta", iv)
    url_com = EncryptText("https://www.epayco/callback", iv)
since they doesn't exist a web page is returned to android.
That is the page it's displayed on Android screen.
I send a revised version of App. Good Luck!
Happy Easter!
Mauro
 

Attachments

  • payment.zip
    10.1 KB · Views: 300
Upvote 0
Top