#daniell_74820

1 messages · Page 1 of 1 (latest)

arctic oceanBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

grim knoll
#

Hello! Are you using CHeckout in 'payment' or 'subscription' mode?

left violet
#

in `payment´mode

grim knoll
#

And which API are you hoping to get this information from? When you retrieve a Checkout Session? When you retrieve the Payment Intent?

left violet
#

When I retrieve a checkout session

#

after the event 'checkout.session.async_payment_succeeded' and 'checkout.session.completed'

#

when this event happend

#

events*

grim knoll
#

Gotcha - so when you get that event you can re-retrieve the Checkout Session and expand payment_intent.payment_method to see the full Payment method in the response. The PaymentMethod should have a type that'll be what you want

left violet
#

do you have for me the exact api route?

#

const stripe = require('stripe')('Ihr-Stripe-Secret-Key');

// Angenommen, Sie haben die Session-ID aus dem Event
const sessionId = 'cs_test_...';

stripe.checkout.sessions.retrieve(
sessionId,
{
expand: ['payment_intent.payment_method'],
},
function(err, session) {
// Hier haben Sie Zugriff auf die vollständigen Informationen der Zahlungsmethode
if (session.payment_intent) {
const paymentMethod = session.payment_intent.payment_method;

  // Hier können Sie beispielsweise den Typ der Zahlungsmethode überprüfen
  console.log(paymentMethod.type);
}

}
);

#

is this correct?

grim knoll
#

Yeah that looks correct - but really just try it out and see if it behaves like you expect

left violet
#

ok, i am going to try it know

arctic oceanBOT