#SouffleAuChocola
1 messages · Page 1 of 1 (latest)
hello! can you share the Checkout Session object that you're trying to access?
yes , but how?
have you already created the Checkout Session Object?
Let me explain you the flow , I am using a payment link to create a subscription. Inside that payment link I've set up some custom fields. In my API I am listening to subscription created events and I would like to know the value of those custom fields.
that indicates the organization under which the user will be registered in.
the subscription created events shouldn't have those created events. You would access those values from the Checkout Session object : https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-custom_fields
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the documentation is saying that I can access those values by getting those session with the subscription ID.
but when I do that , no custom fields are displayed
can you share the Subscription id? and which documentation are you referring to, can you share the URL?
yes
sub_1MjeUbJHCIFWObpfRNF9gHAk
"retrieve custom fields for a subscription"
can you share your code to attempt to retrieve the custom field data?
that just retrieves the Checkout Session, you still need to access the custom_fields
where's your code to do that?
nowhere
I've been debugging and there is not custom fields on what I am getting from that sessions
what do you get from sessions in that case, can you share the object?
for context, you should have received an array of objects from sessions, and you should be accessing the first object in that array
can you share the object?
{<Stripe.Checkout.Session@22904234 id=cs_test_a1CBZ22oWsZKDNeksRx5hvhzQCtvbLta8SrD5Sovi6EMpsLIT1OHJlImSL> JSON: {
"id": "cs_test_a1CBZ22oWsZKDNeksRx5hvhzQCtvbLta8SrD5Sovi6EMpsLIT1OHJlImSL",
"object": "checkout.session",
"after_expiration": null,
"allow_promotion_codes": false,
"amount_subtotal": 0,
"amount_total": 0,
"automatic_tax": {
"enabled": true,
"status": "complete"
},
"billing_address_collection": "auto",
"cancel_url": "https://stripe.com",
"client_reference_id": null,
"consent": null,
"consent_collection": {
"promotions": "none"
},
"currency": "gbp",
"customer": "cus_NUdmcrl6af8vkt",
"customer_creation": "if_required",
"customer_details": {
"address": {
"city": null,
"country": "RO",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},...
...
"email": "remus.galea@qubiz.com",
"name": "Remus",
"phone": null,
"tax_exempt": "none",
"tax_ids": []
},
"customer_email": null,
"expires_at": 1678435569,
"line_items": null,
"livemode": false,
"locale": "auto",
"metadata": {},
"mode": "subscription",
"payment_intent": null,
"payment_link": "plink_1Mj0h4JHCIFWObpfpZgCdGhQ",
"payment_method_options": {
"acss_debit": null,
"boleto": null,
"konbini": null,
"oxxo": null,
"us_bank_account": null
},
"payment_method_types": [
"card",
"bacs_debit"
],
"payment_status": "paid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"setup_intent": "seti_1MjeUaJHCIFWObpfPqsCq2Ok",
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
"shipping_rate": null,
"status": "complete",
"submit_type": "auto",
"subscription": "sub_1MjeUbJHCIFWObpfRNF9gHAk",
"success_url": "https://stripe.com",
"tax_id_collection": null,
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0,
"breakdown": null
},
"url": null
}}
gimme a while to take a look
i believe custom fields on the Stripe dotnet SDK is only available on this version https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md#4170---2023-02-16
and right now you're using v39.107.0
so I should upgrade the nugget package?