#ASittingDuck

1 messages ยท Page 1 of 1 (latest)

sick windBOT
upper yacht
#

This needs to be a specific payment method id (or compatible object) such as pm_1234

steel gate
#

OH shoot, I am using the wrong type

upper yacht
#

for example in test mode you can use pm_card_visa or our other test PM ids

steel gate
#

I am using react api, please disregard

upper yacht
#

That snippet looks like a node server-side snippet

#

Are you trying to confirm server side or in your react app client side?

steel gate
#

I am confirming on the react app client side, because I will be sending the needed information to woocommerce and manually setting the order to confirmed once done.

upper yacht
#

How does woocommerce fit in here?

steel gate
#

Thanks, yeah woocommerce is just want I am connecting to the application

#

OK ONE last thing. I have gotten that method to work. I just need to get the following information if I can

-customer_id
-source_id
-stripe_fee
-transaction_id

#

I am not seeing that on any of the returned objects

upper yacht
#

Which returned object, specifically?

steel gate
#

The paymentIntent object is the last one returned

upper yacht
#

If you provided a customer for the payment intent, that should be reflected on the payment intent object

steel gate
#

Is that the same as providing billing information?

upper yacht
#

What are the other bits of data you're looking for? Most likely you want to look at the latest_charge and expand the balance transaction for such details:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
https://stripe.com/docs/api/charges/object#charge_object-balance_transaction
https://stripe.com/docs/api/balance_transactions/object

steel gate
#

I am looking for the transaction ID for when the card was charged so that refunds can be made if needed, and the customer ID

#

I am passing the billing information and I see that in the data, but it isn't creating a customer there

upper yacht
#

What transaction ID are you referring to?

steel gate
#

OK cool thank you!

#

I have an example. one second

#
Stripe charge complete (Charge ID: ch_3MbTcpIlmlJhoaqY1idqtYzN)
upper yacht
#

Sure, that's the charge object ID, its on the payment intent as the latest_charge linked to above

steel gate
#

That isn't on the returned object

upper yacht
#

Can you share that request ID? or copy the payment intent ID here

#

Is this a client-side confirmation?

steel gate
#

Yes it is, and request ID, as in the PI-ID?

#

pi_3MbVZWIlmlJhoaqY2kVYz0SN

#

there is the payment intent ID

upper yacht
steel gate
#

Yeah I am seeing that, So does that mean I just need to make a request to retrieve the PI and then I will get that information?

upper yacht
#

Yes, that's correct

steel gate
#

That literally got me the same thing

#
stripe.confirmPayment({
    elements,
    confirmParams: {
        payment_method_data: {
            billing_details: {
                name: `${customer.firstName} ${customer.lastName}`,
                address: {
                    city: customer.city,
                    line1: customer.address,
                    postal_code: customer.zip,
                    state: customer.state,
                },
                email: customer.email,
                phone: customer.phone,
            }
        }
    },
    redirect: "if_required",
}).then((transaction) => {
    parentSetProgress(80);
    console.log('Payment Sent', transaction);
    stripe.retrievePaymentIntent(transaction.paymentIntent.client_secret).then((paymentIntent) => {
        console.log('Payment Intent Retrieved', paymentIntent);
    });
upper yacht
#

Let me confirm I see the same thing

steel gate
#

Thanks

steel gate
#

This is the biggest thing I need right now, the freaking customer ID

#

message
:
"Subscription payment method could not be set to stripe with error message: A "Stripe Customer ID" value is required."

valid escarp
#

Hi there ๐Ÿ‘‹ taking over, as my colleague needs to step away

Give me a few minutes to get caught up.

steel gate
#

Ok

valid escarp
#

So where are you adding a Customer and where are you looking for one?

steel gate
#

I believe I am adding a customer when I am confirming the payment intent

#

and I am looking for the returned customer ID on the intentconfirmation return object

valid escarp
#

I didn't think billing_details created a Customer.

steel gate
#

hmmmm so I have to explicitly do that

valid escarp
#

Yeah, you'd need to create a Customer separately

steel gate
#

using stripe.js where is the doc for that?

valid escarp
steel gate
#

I think I got that part already, I will continue to research on how to attach the customer, along with their payment method

steel gate
#

If I am using a PaymentElement on my system, and I want to take that data and use it to create a payment method, I need to get the card from that PaymentElement. I tried using elements.getElement(CardElement) and elements.getElement(CardNumberElement) but both those are returning null.

valid escarp
#

A Payment Method is created as a result of confirming the Payment Intent, so you should already have one when the payment flow is complete

steel gate
#

I am using the payment method with a customer so it needs to be saved beforehand, (because this is going to be used with a subscription)