#aiwa-payment-methods

1 messages · Page 1 of 1 (latest)

fringe stratusBOT
dusk fog
#

Hello

#

I'm not sure what you mean by "card number also not getting in the response".

#

Can you clarify?

#

You can also disable Link via your Dashboard if you don't want to support it -- that depends on which integration you are using.

swift latch
#

I was getting last 4 digits of the card....but right now am getting as null

#

already disabled it

dusk fog
#

Do you have an example you can share?

swift latch
#

"paymentIntent": {
"id": "pi_3OUkJeHd7jiDEEHb13xXASnj",
"object": "payment_intent",
"amount": 50000,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 50000,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3OUkJeHd7jiDEEHb13xXASnj_secret_A3Z1VR5As2NKGujp2HZowEDU8",
"confirmation_method": "automatic",
"created": 1704349326,
"currency": "aed",
"customer": "cus_PJN3xGQObOtAE3",
"description": "Subscription creation",
"invoice": "in_1OUkJdHd7jiDEEHbTiyQ4n8l",
"last_payment_error": null,
"latest_charge": "ch_3OUkJeHd7jiDEEHb1dU8grjt",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1OUkJcHd7jiDEEHbCYxu8HeW",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic",
"setup_future_usage": "off_session"
},
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"card",
"link"
]
},

dusk fog
#

Thanks, looking at that PaymentIntent

swift latch
#

payment_method_types its coming as both card and type why ?? i have activated only card ???

dusk fog
#

So you wold need to turn off Link in those settings

swift latch
#

but we are not getting last 4 digts in payment intetn id API

#

its working after deactivating

dusk fog
#

Where are you looking exactly?

#

You can find the last 4 as part of the Charge's payment_method_details.card.last4

swift latch
#

not gettting that in the payment intent api

dusk fog
#

Are you expanding the latest_charge?

#

But to see the full charge object when looking at a PaymentIntent you would have to expand the latest_charge

swift latch
#

{
"id": "pi_3OUrnrHd7jiDEEHb0ooLr4T2",
"object": "payment_intent",
"amount": 160000,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 160000,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3OUrnrHd7jiDEEHb0ooLr4T2_secret_gB8oGM5jsEvfYiDHztOP1BnU8",
"confirmation_method": "automatic",
"created": 1704378107,
"currency": "aed",
"customer": "cus_PJUnBqWhrOD6iW",
"description": "Subscription creation",
"invoice": "in_1OUrnrHd7jiDEEHb969BrZVD",
"last_payment_error": null,
"latest_charge": "ch_3OUrnrHd7jiDEEHb0ZjQRezV",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1OUrnqHd7jiDEEHbYVx6y5A0",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic",
"setup_future_usage": "off_session"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": "off_session",
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}

#

this is what am getting

#

what is that expanding latest_charge measn ?

dusk fog
swift latch
#

coudnt find any cards in the above link

dusk fog
#

Let's back up.

#

You are receiving a Webhook here, correct?

swift latch
#

yes

dusk fog
#

Are you listening for payment_intent.succeeded?

swift latch
#

yes

dusk fog
#

Great

#

So when you receive that Webhook it contains the PaymentIntent object

#

The last 4 is not returned, as it within the Charge object

#

When you do that, you will now receive the full PaymentIntent object and within it the full Charge object

#

Which will contain the last4 that you are looking for.

swift latch
#

sorry we are taking payment intetn id from invoice.paid webhook

dusk fog
#

That works fine too

#

Same idea

swift latch
#

we are calling by payment intent id

#

that response only i shared before

dusk fog
#

Right because you aren't expanding latest_charge

#

Can you show me your code for how you are retrieving the PaymentIntent?

swift latch
#

client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", stripeSecretKey);

            var response = await client.GetAsync("https://api.stripe.com/v1/payment_intents/" + paymentIntentId);

            var returnObject = await response.Content.ReadAsAsync<object>();
dusk fog
#

Can I ask why you aren't using one of our SDKs?

swift latch
#

we implemnted in this way...

#

some version conflict was there

#

we were using an old stripe account....and getting all the values in that account....now we changed into another stripe account for going live....but this issue got

dusk fog
#

Yeah with older API Versions we returned charges which included this info

#

That was removed

#

Can you try adding ?expand=latest_charge to your fetch

#

Like var response = await client.GetAsync("https://api.stripe.com/v1/payment_intents/" + paymentIntentId + "?expand=latest_charge");

swift latch
#

getting invalid array

dusk fog
#

Try ?expand[]=latest_charge

fringe stratusBOT