Help with right cc hash syntax for Wappler component

Very useful postman api by Matt Mitchell on Git, saves so much time and error :+1:

I get this OK status when testing the Payment Method API with the test cc card info (and my secret key):

What am I supposed to learn/identify from this?

That you know how to pass right data and in the correct format.

Now translate that into Wappler and make sure you use the exact same data.

I have been using the data and syntax as in the Stripe docs…
Now I still don’t know how to write the hash in the card field of the stripe Payment Method component - see further down.

And now this is Stripe tech support answer - in pure PHP - but wappler field expects something else that is different syntax:

Again, how do I translate this into a correct hash for the card field of the wappler component, right there:
image

The code in that image is not pure PHP, it's not even unholy PHP. It's JS :wink:

1 Like

Anyway, use the PHP API if you are using PHP as server model.

image

It’s expecting an array. Use the same format as there.

I should have started this project in NodeJS :sweat_smile:

Problem is, whatever i copy/paste manually into the php code page, it does not work (parsing error).
I need to find the right syntax for the card field in the component.
Something like: {number: “42424242424242424242442”, exp_month: 6, exp_year: 2022, cvc: “314”}
Obviously, Stripe does not know how this card field into wappler’s component should be input.

Try with:

['number' => '4242424242424242', 'exp_month' => 6, 'exp_year' => 2022, 'cvc' => '314']

No doubt :smiley:

I've used this and it gives me a parsing error. Not the same symtax as in the code of that api. This is the syntax it is expecting:
image

Still invalid object but I like the direction and I'll play with the => and = sign and quotes now...
Stay tuned

These syntaxes trigger an invalid object error too:
[“key”: “string”, “key”: number]
['key: “string”, ‘key’: number]
{[‘key’ => ‘string’, ‘key’ => number]}
{[‘key’: ‘string’, ‘key’: number]}
{key: ‘string’, key: number}

I am out of ideas. Unfortunately I haven’t tested the Stripe integration yet. And if I did it wouldn’t be PHP.

So I think we can only resort to the team.

@george @teodor @patrick

When you want to pass an object as value then you need to pass it as an expression, so enclose it in {{ and }}.

{{ {number: "42424242424242424242442", exp_month: 6, exp_year: 2022, cvc: "314"} }}
4 Likes