#Suren

1 messages · Page 1 of 1 (latest)

tacit idolBOT
clever dome
noble cloud
#

where can I test this

#

without any code

#

I remember an interface for that

clever dome
noble cloud
#

Toby

#

error
:
{type: 'invalid_request_error', message: 'Invalid API Key provided: pk_test_*********************aLr"', status: 401}
[[Prototype]]
:
Object

#

PaymentElement doesnt load for the above error

#

I am sure I am using the right test key\

clever dome
#

I would recommend double checking the key you're using, it should likely have a prefix format of pk_test_

noble cloud
#

yes yes pk_test_Y**wg0ZOzAguYESkZEAabaLr

#

I took it from the API keys part of the dashboard in test mode

clever dome
#

Okay, and that issue still persists after ensuring that's the value your code is using? Asking because it doesn't seem to match the format in the error message.

noble cloud
#

yes thats right

#

the error message becomes like that when I paste it

clever dome
#

Is this a public site that I could take a look at?

noble cloud
#

{
"type": "invalid_request_error",
"message": "Invalid API Key provided: pk_test_*********************aLr"",
"status": 401
}

#

yes but I am doing this test offline

clever dome
#

How do I get to the page where the Payment Element is expected to be rendered from there?

noble cloud
#

I am doing this offline

#

means locally

#

in test mode

#

can you anydesk?

#

thats the only way at the moment

#

const stripe = Stripe('pk_test_YUSwg0ZOzAguYESkZEAabaLr"');

const options_ = {
    clientSecret: 'pi_3NWIx8I9xjTc4WYW1IqzVqyI_secret_0QAtnIgCwfGRSMjfwTGltBpD5',
    // Fully customizable with appearance API.
    appearance: {/*...*/ },
};
#

for now I am just hardcoding the client secret of an payment that is incomplete and trying to authenticate and succeed

#

the subscription status is incomplete and payment is pending

clever dome
#

That key is wrong, it's missing an underscore

#

pk_test_

noble cloud
#

pk_test_YUSwg0ZOzAguYESkZEAabaLr

clever dome
#

Does that work when you put that in the code?

noble cloud
#

It is getting removed in the chat

#

its there

clever dome
#

Then I don't know what could be going wrong. I would recommend double checking the key value is correct. If you can put this in a publicly accessible site then I can take a closer look, but currently all I can tell is our API doesn't like the key value your code is providing it.

noble cloud
#

toby

#

I found the issue

#

the way I was stringifying was wrong. Its working now

#

however, I have a quick question

#

Now when a user subscribes for the first time, they enter their card info. Then the subscription gets created with the status incomplete and payment status - pending.

Now, I am redirecting them to a page, when they have to enter card details again and complete authentication

#

is this the only flow

clever dome
#

That's a bit vague, but no, there are lots of flows when working with Stripe. That one does not sound ideal, why are you handling it that way?

noble cloud
#

Because I collect payment info before creating a subscrition

#

<form action="~/Stripe/Create" method="POST" class="dt-sc-subscription-frm">
<input type="hidden" value="@feetype.TypeID" name="feetypeid">
<input type="hidden" value="@feetype.StripePlanID" name="stripeplanid">
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_YUSwg0ZOzAguYESkZEAabaLr"
data-amount=@feetype.AmountInCents
data-name="@feetype.TypeName Subscription"
data-email=@feetype.Email
data-description="Stripe Secure Payment"
@data-image="......\logo_bmu.png"@
data-locale="auto"
data-label="Pay"
data-currency=@feetype.Currency>
</script>
</form>

#

with something like this

clever dome
#

Ah, that is our legacy version of Checkout, I'm honestly not too familiar with it offhand. Is this a new integration you're working on building, if so I wouldn't recommend continuing with that approach and would recommend using one of our newer flows instead.

noble cloud
#

can u point me thete

#

there

clever dome
noble cloud
#

ok thanks

#

I will look into this