Paypal simple-HTML

Hi, I've just create a simil html for Paypal.
It's the modified original HTML of the "Smart Button".
If you want other button, ask.
Here's the tutorial

Download the HTML file
Go to "https://www.paypal.com/us/home" -------> Sign In/ Sign Up
Sign in or create an account
Once in the dashboard go to developer
Go to "Get API Credentials"
Choose Sandbox (testing) or Live ---> Create App
Choose the name ---> Create App
Copy the Client ID

Open the HTML by notepad++ or visual studio code
Put the copied Client ID over n1
and the value n2 is the currency (USD dollar, EUR euro; here's the complete list )
Save and open app inventor

Create a new project, add a WebViewer, a notifier and go to the blocks.
Put the code in the photo or copy from the example

WARNING!!! It works only in the main page
Here the tutorial with the immages.
General block code:


Sample e-commerce code:

Sample e-commerce aia:
Peluchazon.aia (341.9 KB)
HTML Download:
Here

2 Likes

but it's not an extension.

edited

Great Work!!

1 Like

Dear R_A! We have downloaded Peluchazon.aia and it works fine. However we are left with one big question: Since we need to pass in the Paypal.html our Paypal Client code, we also need to know where this file is stored. In the App Inventor blocks the file is accessed via https on the Localhost. In other words where shall we store "our" Paypal.html?
Big thank you!
Regards
Vittorio

Also is this important?

http://localhost/tramezzo.js

It is in the html file, but not in the assets of the example aia project.

1 Like

Hi @TIMAI2, it's refering to the script that takes from internet, it's ok. Thanks.

Dear @Vittorio11,
Thanks for the interest. Like in the example file is stored like an asset and called by the url "http://localhost/"+file name (Paypal.html); that's where, when is deployed, it sees the html. So you have to put it as an asset (or you can do it on a site apart and show it passing datas by url).
Looking forward to hearing from you soon,
R_A

Should that line just be a comment then? The url indicates that the js file is in the assets of the aia project? Should it show a link to the actual file on the internet? I do not understand why it is there.

Hi @TIMAI2 ,
I've just checked and you're right, in this case it's useless and it can be commented. I'll correct this error.
Thanks for asking,
R_A

1 Like

Thank you R_A! All clear now. Great!
Have a nice weekend!
Vittorio

1 Like

Hello! WE have implemented as shown over the call from AI to PayPal using subscription plan in PayPal. After using a test plan for a while, we have created a real plan in PayPal. We get the entire code from paypal to use in the .html file that we call from app inventor. We see that the .html file works perfectly when called from a browser. BUT, from app inventor the very same .htm file calls the "test" plan instead of the correct plan. Yet the P-ID is correct and all. Any suggestion?

Hi @Vittorio11,
when I made it was only for test and for fun, so I didn't use the real mode, so I can only suggest to experiment with it. If you find the solution you can post to help other creators.
Good luck for your project,
RO

Does it work with the native browser on an android phone - e.g. Chrome ?

If so, you could try using this extension with the webviewer:

WebViewExtra