Android Code Snippet [B4X] Online Payment with PayPal

Hi all.
In Attached an example on how to use paypal for online payment in a simple way for B4X ( B4A - B4i - B4j )
In the example it is possible to enter any active paypal account, so you can also make payments on different paypal accounts.
For each transaction, it will return if the transaction was successful or failed.
If you improve the same, upload and share the same pls.

Have a nice day



    33.8 KB · Views: 1,037
Last edited:


Licensed User
Longtime User
Hi @MarcoRome, I was trying this approach to use paypal and everithing is working great, but when a customer is paying through a PC (i'm using it with B4j for a webapp) the page doesn't redirect automatically to the success url, the user have to click on return to sellers website after the payment is made to be redirected to the success url, so if the user closes the browser after doing the payment and don't click on the return to seller's website button, the transaction won't be notiffied to my site, do you know if there is a way to force loading the succes url or to get a payment notification to avoid this kind of problem with paypal payments?.

thanks a lot in advance.


Licensed User
Longtime User
You need to set up automatic redirection from your paypal account.