#og-cvc-element

1 messages · Page 1 of 1 (latest)

worldly sun
#

Hey! To confirm, you're using the CardElement? Not PaymentElement?

earnest ridge
#

I don't know for sure, rather Payment... I have a web application based on React and it has an implementation of Stripe.

worldly sun
#

Can you share the code when you invoke the Elements instance?

earnest ridge
#
const stripe = require("stripe")(process.env.STRIPE_KEY);

router.post("/payment", (req, res) => {
  stripe.charges.create(
    {
      source: req.body.tokenId,
      amount: req.body.amount,
      currency: "usd",
    },
    (stripeErr, stripeRes) => {
      if (stripeErr) {
        res.status(500).json(stripeErr);
      } else {
        res.status(200).json(stripeRes);
      }
    }
  );
});

module.exports = router;
#
              name="Essential Shop"
              image="https://avatars.githubusercontent.com/u/1486366?v=4"
              billingAddress
              shippingAddress
              description={`Your total is $${currCart.total}`}
              amount={currCart.total * 100}
              token={onToken}
              stripeKey={KEY}
            >
              <Button>CHECKOUT NOW</Button>
            </StripeCheckout> ```
worldly sun
#

What's in <StripeCheckout>?

#

You shouldn't be using the Charges API really

earnest ridge
#

I can share all Git code with you. Can you figure it out?

worldly sun
#

I can take a look, sure

worldly sun
#

@earnest ridge you able to share the code?