Stripe Custom Checkout (from docs) Errors

I’ve just started to use the Stripe actions. When the page runs, the form is created and when I click the submit button I get an error. Looking in the browser console in the Preview I get the following:

{identity: 1, query: , error: “$config must be a string or an array”}
error: “$config must be a string or an array”
identity: 1
query:

Not sure where to begin to look for the error listed. Is this a Stripe issue or a Wappler issue?

Which server language are you using (php/node) and which action are you calling?

Server Language: PHP
Action: Create Payment Intent Template

Well it doesn’t appear to be a Stripe issue. Looks like it is a Wappler issue.

I’ve been following the Stripe Custom Checkout Forms documentation. At first I was just following along and adding what’s in the directions to an existing server action. Since that wasn’t working, I created an entirely new project in Wappler and then followed the directions exactly. And guess what, I got the exact same error message.

error: “$config must be a string or an array”

The funny thing, the server action completes with a status of 200. I assume that’s the “Try/Catch” from the Stripe Payment Intent Template that I used. So, am I missing something from the documentation? Is there another step that needs to be added or should the Stripe Payment Intent Template actually send the information to Stripe and complete the transaction?

More details after testing…

So the error message is being generated on line 55 in file: BaseStripeClient.php which can be found in the following directory:

./dmxConnectLib/stripe/lib/BaseStripeClient.php

I was able to find this by moving the “Create Payment Intent” out of the “Try/Catch” and then executing the action on the form page. I’m starting to think this is a bug and needs to be reported.

Has anyone successfully followed the “Stripe Custom Checkout Forms” and gotten this to work?

Can you share some screen shots of your steps and Chrome dev tool response?

Sure. The steps in the pic below are not the one that will be used in the real application. Those steps have a lot of data checking for valid accounts and logging of the transactions. I’ve isolated the steps in a test server action so that I can just focus on trying to get a test transaction to show up over at Stripe. So far, nothing is even submitted to stripe. The form when submitted does react with a Dynamic Events for Error and says that it failed. But in the Response pic below you can see that there is a error listed. I find where that error comes from in the Wappler code, see post from seven days ago for file and line.

Steps

Form

Console

Network

Response
response

Can you show inside your create payment intent component how you’ve done the setup?
Also show any GET and/or POST variables?

Here you go. I did not include the API Key for Stripe that would have been at the bottom of the second image under the “ADVANCED OPTIONS” section. Also added an image of the POST vars heading to the form.

Create Payment Intent


cpi2

POST vars
post

Are you using the latest version of Wappler?
Also, have you followed this tutorial? https://stripe.com/docs/payments/integration-builder

We are in the middle of launching a new app for a client and have not made the jump to version 4 of Wappler. We have run the the form and server action on a different computer that does have version 4 and are getting the same results. We do have a different form elsewhere in the app that does execute a Stripe transaction. However, this server action was created before Wappler integrated Stripe and uses the general API Action. We want to adopt the Stripe integration that Wappler has added to make managing the server actions easier.

From what I can see, it looks like the data that Wappler is creating with the Create Payment Intent is not being generated correctly. So either there is a bug in Wappler or something is missing in @Teodor 's Stripe Custom Checkout Forms document.

As for the tutorial you provided on Stripe, I have read that before. That assumes you are building the entire page from scratch without using Wappler. Wappler’s new Stripe support should handle all of those steps by just creating a form and adding the correct server actions.

Has the support team reverted to you on this matter, maybe privately?

@Aysel,

No they have not responded to me privately or on this post. We are still working on trying to solve the issue. Once we have a solution, we will post it here for sure.

Sorry I cannot help here, I am new here, trying to assess if Wappler is suitable and more importantly if their stripe components work as expected, which does not seem to be the case yet. $Config is a wappler error, isn’t it?

the stripe components work just fine.
If you have found some issues while using the stripe components, please report them in separate topics so we can fix them.

Have you setup the Stripe options? Error is when the config is missing, should at least have the Stripe Secret Key set.

image

image

@patrick

This has been solved. Thanks to Patrick’s suggestion and upgrading to the latest version of Wappler we were able to get the checkout to work. You must use the secret key added in the settings as suggested in the pic in the post above. Also, you want to make sure that in the “Create Payment Intent” under the Advanced Options you do not set the API key there as well.

Thanks for all the help.