#morfina9873

1 messages ยท Page 1 of 1 (latest)

vapid sequoiaBOT
finite coyote
#

Hi ๐Ÿ‘‹ how can I help? (please feel free to put your full question/concern in your post next time)

#

@grizzled panther I created a thread here

#

Let's keep messages here instead of the main channel

#

I am having some issues retrieving the payment_method for a payment intent.I created one via the dashboard, and when I use the API to retrieve that payment intent the payment method field is null

but in the dashboard, the payment method is populated

#

Can you share the ID of a Payment Intent where you saw that behavior?

grizzled panther
#

pi_3OlumUAsM9ubIWyR17zNU1ff

finite coyote
#

Thanks, pulling that up

#

It looks like you used a Source rather than a Payment Method, so the ID is stored in the source field on the Payment Intent.

grizzled panther
#

a Source?

finite coyote
#

It's the Object type that predated Payment Methods

grizzled panther
#

But this payment was created via the Dashboard

finite coyote
#

Yup, understood, is there something you're trying to ask? We aren't too familiar with the dashboard functionality in this forum, we specialize in helping developers work with our API and SDKs.

grizzled panther
#

well the thing is, if I create the payment via the stripe checkout, when I try to retrieve the payment intent the payment method is filled, If I create the same payment via the dashboard it doenst come

#

this is a problem since I have a customer "Order History" section that shows all the previous payments and their respective payment methods

finite coyote
#

Can you retrieve that Payment Intent and share the full output you're seeing from the API here?

grizzled panther
#

I can sec

#

{
id: 'pi_3OlumUAsM9ubIWyR17zNU1ff',
object: 'payment_intent',
amount: 12900,
amount_capturable: 0,
amount_details: { tip: {} },
amount_received: 12900,
application: null,
application_fee_amount: null,
automatic_payment_methods: null,
canceled_at: null,
cancellation_reason: null,
capture_method: 'automatic',
client_secret: 'pi_3OlumUAsM9ubIWyR17zNU1ff_secret_SLxiTZQhZW16REATzy1sFx4rC',
confirmation_method: 'automatic',
created: 1708441130,
currency: 'eur',
customer: 'cus_Pb4SCx7UWhhYyn',
description: 'Subscription creation',
invoice: 'in_1OlumUAsM9ubIWyRwCnwpfEx',
last_payment_error: null,
latest_charge: 'ch_3OlumUAsM9ubIWyR1TXagy4j',
livemode: false,
metadata: {},
next_action: null,
on_behalf_of: null,
payment_method: null,
payment_method_configuration_details: null,
payment_method_options: {
card: [Object],
link: [Object],
paypal: [Object],
sepa_debit: {}
},
payment_method_types: [ 'card', 'link', 'paypal', 'sepa_debit' ],
processing: null,
receipt_email: null,
review: null,
setup_future_usage: null,
shipping: null,
source: 'card_1Olum6AsM9ubIWyRBPfyHjrZ',
statement_descriptor: null,
statement_descriptor_suffix: null,
status: 'succeeded',
transfer_data: null,
transfer_group: null
},

finite coyote
#

Thanks, that source field there is the ID of the Source that was used for the payment, I would recommend adjusting your flow so it checks for either a payment_method or source value being present.

grizzled panther
#

thanks I will try that, but this means I need to make an additional request to fethc the card info based on that card id right?

finite coyote
grizzled panther
#

let me try that ๐Ÿ˜„ thanks for the tip

#

it works ๐Ÿ˜„

#

thx a lot!

#

this was driving me nuts

finite coyote
#

๐Ÿฅณ Any time!

grizzled panther
#

just need to adjust my flow to also look for the source in case payment_method is null

#

thx a lot toby