
Announcements
Hi All,
I am building a Payment Portal on Power Pages. The idea is a user will login to our portal and make a payment for their invoices. For this, I added a button on a page using the online VS code editor. Please see the screenshot below for an example.
The challenge I am having right now is communicating with Stripe - a payment platform, at the time I click on ‘Pay selected invoices’ button. I will also have similar buttons to add/delete a new credit card etc. I don’t want to put my business logic into the same HTML file, inside the onClick event of this button, since I will be using sensitive information such as a secret key to communicate with Stripe. Instead, my idea was to call Business Central when the button is clicked, and then call Stripe within AL to make a payment. But I can’t call Business Central API directly from Javascript&HTML either since I will also need authorization password to call a Business Central API.
So, my solution to this wass to create a HTTP request inside the onClick event of a button. I created a Power Automate flow which starts with a ‘when a HTTP request is received’ trigger. Now, I can add new steps to call Business Central. Here is an example of a Power automate flow I created to call Business Central API, and return back the list of Credit cards in the response array to the Power page.
My problem with this solution is,
1) I want to pass a parameter while calling the Business Central Api to use it in my Stripe call in AL as I want to fetch information for a specific customer. I don’t see an option to pass a parameter in Power Automate. Is this possible?
2) For each button, I will need to use a HTTP URL to start the Power Automate flow. Do we need to modify the HTTP URL in the code for each customer we deploy our solution to? Will they need to change the source code manually?
What do you suggest? Are these problems fixable? How can I safely call the Stripe? Or should we take a totally different approach?