#mukta-k_api

1 messages ยท Page 1 of 1 (latest)

dense havenBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1413272795651248188

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

feral crown
#

๐Ÿ‘‹ Looking into this for you ๐Ÿ™‚

#

Do you have a request ID you could share that demonstrates what you are seeing?

urban crystal
#

var guid = Guid.NewGuid();
var options = new PaymentIntentCreateOptions
{
Amount = (long?)(request.Amount * 100),
Currency = "usd",
ReceiptEmail = request.Email,
PaymentMethodTypes = new List<string> {
"card",
"us_bank_account"
},
PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions
{
UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions
{
VerificationMethod = "instant",
},

},
Description = description[..^3],
Expand = new List<string> { "amount_details.line_items" }, };

options.AddExtraParam("payment_details[order_reference]", guid.ToString() );
options.AddExtraParam("amount_details[line_items][0][product_code]", request.AgencyId);
options.AddExtraParam("amount_details[line_items][0][product_name]", "Media Advertising");
options.AddExtraParam("amount_details[line_items][0][quantity]", 1);
options.AddExtraParam("amount_details[line_items][0][tax][total_tax_amount]", 0);
options.AddExtraParam("amount_details[line_items][0][unit_cost]", (long?)(request.Amount * 100));
options.AddExtraParam("amount_details[line_items][0][unit_of_measure]", "CPM");

var intent = await new PaymentIntentService().CreateAsync(options, cancellationToken: cancellationToken);

feral crown
#

Do you have an example request_id or a payment_intent id I can look at?

urban crystal
#

pi_3S3fWsLxnAupl00q0GzzNKLR

#

we did verify with our Stripe counter part and he doesn't see lineItems for this intentID

feral crown
#

I'm seeing this in the response to the creation request

    line_items: {
      object: "list",
      data: [
        {
          id: "uli_SzeqpRdpG5wcfB",
          object: "payment_intent_amount_details_line_item",
          discount_amount: null,
          payment_method_options: null,
          product_code: "705924",
          product_name: "Media Advertising",
          quantity: 1,
          tax: {
            total_tax_amount: 0,
          },
          unit_cost: 100,
          unit_of_measure: "CPM",
        },
      ],
      has_more: false,
      url: "/v1/payment_intents/pi_3S3fWsLxnAupl00q0GzzNKLR/amount_details_line_items",
    },
    tip: {},
  },```
urban crystal
#

where do you see this on Stripe dashboard

urban crystal
#

why don't I see it in paymentIntent response

#

var intent = await new PaymentIntentService().GetAsync(paymentIntentId, cancellationToken: cancellationToken);

#

in this I get it null

#

{
"id": "pi_3S3fWsLxnAupl00q0GzzNKLR",
"object": "payment_intent",
"amount": 100,
"amount_capturable": 0,
"amount_details": {
"discount_amount": 0,
"line_items": null,
"shipping": null,
"tax": null,
"tip": {
"amount": 0
}
},
"amount_received": 100,

feral crown
#

I suspect those fields are being unset at some point post creation. Looking into when this is happening

urban crystal
feral crown
#

I missed that you were confirming automatically.

dense havenBOT
urban crystal
#

yes we use paymentElement to confirm

feral crown
#

Looking into it a little deeper

urban crystal
#

thanks

balmy fern
#

๐Ÿ‘‹ Taking over this thread, catching up now

#

In your GET request, you didn't expand amount_details.line_items. This is not included by default. Could you try expanding amount_details.line_items?

urban crystal
#

I did

balmy fern
#

I didn't see that in:

var intent = await new PaymentIntentService().GetAsync(paymentIntentId, cancellationToken: cancellationToken);

Where did you expand it?

urban crystal
#

Expand = new List<string> { "amount_details.line_items" }, like this you can see in my above request

#

this is get for paymentintent after creation and confirmation

#

var guid = Guid.NewGuid();
var options = new PaymentIntentCreateOptions
{
Amount = (long?)(request.Amount * 100),
Currency = "usd",
ReceiptEmail = request.Email,
PaymentMethodTypes = new List<string> {
"card",
"us_bank_account"
},
PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions
{
UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions
{
VerificationMethod = "instant",
},

},
Description = description[..^3],
Expand = new List<string> { "amount_details.line_items" }, };

options.AddExtraParam("payment_details[order_reference]", guid.ToString() );
options.AddExtraParam("amount_details[line_items][0][product_code]", request.AgencyId);
options.AddExtraParam("amount_details[line_items][0][product_name]", "Media Advertising");
options.AddExtraParam("amount_details[line_items][0][quantity]", 1);
options.AddExtraParam("amount_details[line_items][0][tax][total_tax_amount]", 0);
options.AddExtraParam("amount_details[line_items][0][unit_cost]", (long?)(request.Amount * 100));
options.AddExtraParam("amount_details[line_items][0][unit_of_measure]", "CPM");

var intent = await new PaymentIntentService().CreateAsync(options, cancellationToken: cancellationToken);

#

this was my code I posted earlier in same thread

balmy fern
#

Expand is per request level. In your GetAsync, you should expand the same

#

Expansion is only done in your CreateAsync, but not on GetAsync

urban crystal
#

I am not clear

#

can you modify my code lines and show me here

#

In support doc url I saw to add expand line in CreateAsync()

balmy fern
#

Expansion is only expand on the object on that specific request sent to Stripe. Not on all the requests / objects created with Stripe. Since the expansion is only done at CreateAsync, amount_details.line_items was only available at the creation request: https://dashboard.stripe.com/logs/req_mhSMhajMLCPzfX

amount_details.line_items will not be available in GetAsync by default if you don't set the expansion on the Get request itself. Example will be:

var options = new PaymentIntentGetOptions();
options.AddExpand("amount_details.line_items");

var service = new PaymentIntentService();
var intent = service.Get('pi_123', options);
urban crystal
#

ok I see it now cool thanks but not sure why StripeDashboard doesn't show it

#

in paymentIntent object

balmy fern
#

This is expected since amount_details.line_items is not included in the Payment Intent object by default, unless your request explicitly expand it

urban crystal
#

I did while creating

#

What can I do to add those on stripe dashboard paymentIntent object ?

#

where should I expand only GetAsync()

balmy fern
#

What can I do to add those on stripe dashboard paymentIntent object ?
This is not possible

#

Dashboard will only include the default PaymentIntent object

urban crystal
#

ohh ok

#

got it

#

Thank you for your help and time.