#Slush-inventory-check

1 messages · Page 1 of 1 (latest)

astral kiln
#

hello, you're using PaymentElement, right?

naive lantern
#

On .NET

astral kiln
#

yeah but that uses PaymentElement in your webpage, no?

#

to accept the user's card details?

naive lantern
#

Custom web page

#

Uhmm

#

let me check

#

public ActionResult Create([FromBody]PaymentIntentCreateRequest request)

#

<form id="payment-form">
<div id="payment-element">
<!--Stripe.js injects the Payment Element-->
</div>

#

Yes it is using a payment-element

astral kiln
#

ok so in your code, you should have a button that ultimately calls stripe.confirmPayment() in your code.

On that button press, you can do any checks server-side for your inventory

naive lantern
#

Hmm a little confused I see the call handleSubmit

#

with away stripe.confirmPayment

#

can you show me where in the JS file I would preform the check?

astral kiln
#

sorry to take a step back, since you wrote the code, you would be familiar with it

my point was, at some point in your code, you call confirmPayment()

and before you call that, you can run any checks for inventory

naive lantern
#
                    elements,
                    confirmParams: {
                        // Make sure to change this to your payment completion page
                        return_url: "https://localhost:44310/TournamentPayment",
                    },
                });``` So I would wrap this part of the code in a check?
astral kiln
#

well kind of

confirmPayment() is what takes the card details and "confirms" the PaymentIntent to create a payment

so you need to do any checks before that

naive lantern
#

Or I would just never have it hit confirmPayment if my database check fails