Stripe Checkout Idempotency-Key

@Teodor
I’m setting up the stripe following the tutorial
I got to the point that I need to set the Idempotency-Key
I selected NOW-UTC and inside it generates a SHA1 hash
To make it random what should I put in “salt”?

You can use NOW-UTC for both, the hash and the salt.

Thank You Ben, but I do not understand
In the tutorial the result is different

This my project NOW-UTC -> {{NOW_UTC.sha1(.randomize())}}

This in Tutorial

Up to this point I think everything has been set up correctly. But I have two obstacles in front of me to continue.

  • The first is the correct insertion of the Idenpotency-Key field
  • the second is that opening the Fetch Schema requires username and password. I enter the login data of the Stripe account, but it gives me an error

Schermata 2022-05-23 alle 10.48.46

`
“headers”: {
“Authorization”: “{{‘Bearer sk_test_XXXXXXXXXXXX’}}”,

“Idempotency-Key”: “{{NOW_UTC.sha1(‘saltvalue’)}}”
}
`

This configuration not open Fetch Schema

{{‘Bearer sk_test_XXXXXXXXXXXX’}} is the value of the API key that you should have received from the Stripe dashboard

An idempotency key is a unique value that’s generated by a client and sent to an API along with a request.

In other words, it can be any value as long as it is unique.

{{NOW_UTC.sha1(‘saltvalue’)}} ensures that the value cannot be replicated. The salt value can be anything to your liking, that is why I suggested using the UTC value for this.

@Marzio I’m not sure if you’re aware, but the devs (almost fully) integrated stripe now. You can access most things using the ui. So you don’t need to create this api action.

I’m confused
So which tutorial should be used to simply get a checkout payment page with data from a form with Wappler and Stripe?
In this case I don’t need to create an ecommerce
Does the tutorial I’m using now no longer work?

Okay Ben, but why when I then click on Fetch Schema and provide the Stripe account credentials, do I get errors blocking me?

Hello Ben
Thanks for your help
I found the problem and a stupid mistake of mine. I had entered the dynamic data in the wrong place
Fetch Schema now opens correctly
However I still have a doubt Nothing is entered in the NOW_UTC field

In that case you have not supplied the information to insert the current time.

Do not confuse the UTC value that you used for the idempotency key; these are two very different data values.

This brings me to question what it is that you are trying to do. If it is a single payment then follow

If you have the products listed in Stripe, then follow the link that @karh has quoted.

As a side note, this deviates from the original subject. It is better to start a new topic if you want to ask further.

Best of luck!

1 Like

@Teodor

I thank everyone for the information.
I am left with the initial doubt of this discussion
I ask Teodor if he can kindly clarify my ideas
In the Tutorial when it is inserted
the “Idempotency-Key / Sha1 / Random” field
contains alphanumeric text

Schermata 2022-05-24 alle 17.03.59
While I can only get this result
I would like to know if it is correct anyway or if something is wrong

{{NOW_UTC.sha1(‘saltvalue’)}}