#ohdeedeeoh

1 messages · Page 1 of 1 (latest)

ashen gulchBOT
#

Hello ohdeedeeoh, 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.
ohdeedeeoh, 1 hour ago, 3 messages
ohdeedeeoh, 4 hours ago, 7 messages
ohdeedeeoh, 4 hours ago, 16 messages
oh-subscription-timestamps, 5 hours ago, 19 messages
ohdeedeeoh, 22 hours ago, 12 messages
ohdeedeeoh, 1 day ago, 2 messages

indigo elk
grim oriole
indigo elk
#

OK, can you share with me the invoice ID?

grim oriole
#

The payment intent to create a charge to prepare for payout pi_3O5Gx0DtqoNbg2qI0Z69JhY4

indigo elk
#

I don't see any request to confirm this payment. How did your customer pay?

grim oriole
#

The invoice paid from customer
in_1O5GwwDtqoNbg2qIFL1UTPbc
Along with its payment intent pi_3O5GwuDtqoNbg2qI0kKuAycN

indigo elk
#

This paymentIntent was paid pi_3O5GwuDtqoNbg2qI0kKuAycN, but not pi_3O5Gx0DtqoNbg2qI0Z69JhY4

grim oriole
#

You see a customer first paid 200, and then I the platform create a payment intent according to the doc to create a so called charge to perpare the transfer to different creators express account

indigo elk
#

Ah, I see the confusion now

grim oriole
#

Yes, pi_3O5Gx0DtqoNbg2qI0Z69JhY4 not paid is to create a so called charge to prepare the so called transfer to pay out creators according to the doc

indigo elk
#

Are you using checkout sessions

grim oriole
#

So I don't need to create a new payment intent?

#

Yes I am

#
const session = await stripe.checkout.sessions.create({
    billing_address_collection: 'auto',
    customer: cstmr.id,
    line_items: [
      {
        price_data: {
          currency: 'USD',
          product: product.id,
          // product_data: {
          //   name: product.name,
          // },
          ...(mode === 'subscription' && {
            recurring: {
              interval,
              interval_count: 1,
            },
          }),
          unit_amount_decimal: amntInCent,
        },
        // For metered billing, do not pass quantity
        quantity: 1,
      },
    ],
    ...(mode === 'payment' && {
      invoice_creation: {
        enabled: true,
        invoice_data: {
          metadata: invoiceMetadata,
        },
      },
    }),
    ...(mode === 'subscription' && {
      subscription_data: {
        metadata: subscriptionSessionMetadata,
      },
    }),
    metadata: checkoutSessionMetadata,
    mode,
    success_url: `url,
    cancel_url: `url`,
  });
#

I'm using that to either subscription or one time payment

indigo elk
#

no you don't need to create a new paymentIntent

grim oriole
#

Okay, just using that customer paid payment intent to initiate the transfer? In the doc, it doesn't specify source, do I need to do that since it's already paid

#

And I could call the transfer_group anything I want, there's also an invoice property, do I need to link the invoice id associated with it?

indigo elk
#

Yup, you can name transfer_group whatever you want

grim oriole
#

Got it, I should be really using the payment_intent.succeed instead of invoice.paid.

#

I just logged the payment_intent customer paid with, it doesn't specify the source do I need to add that to the payment intent?

indigo elk
#

is this payment_intent paid with a payment_method or source?

grim oriole
#

payment method from a checkout session

indigo elk
#

that explains why you don't see source on the payment_intent because it was paid using a payment_method

grim oriole
#

Got it, thank you, sorry too many questions, what's the different between payment intent and an invoice?
And I'm confused about the order, the webhook event tells me, payment intent finished before an invoice paid. shouldn't it be the other way around?

indigo elk
#

the sequence of webhook event arrivals is not guaranteed to follow the event created time.

#

So in subscription mode, stripe checkout would create a subscription, and that subscription will create an invoice for your customer to pay when they checkout.

#

In payment mode, stripe checkout create a payment_intent instead.

grim oriole
#

Makes sense, I just looked an one time payment, an intent was created and completed and then an invoice created with link to that intent and completed, shouldn't the intent wait invoice paid to mark it succeeded?

#

So I need to actually do the instant payout in invoice instead, since that's the last one, and get the intent associated with it, or I could just do instant payout right after the intent is marked succeeded?

indigo elk
grim oriole
#

I'm not talking about that

indigo elk
#

So what do you mean by "instant payout" ?

grim oriole
#

Nevermind the wording, please ignore

#

I just looked an one time payment, an intent was created and completed and then an invoice created with link to that intent and completed, shouldn't the intent wait invoice paid to mark it succeeded?

#

So I need to actually do the instant transfers in invoice instead, since that's the last one, and get the intent associated with it, or I could just do instant transfers right after the intent is marked succeeded?

indigo elk
#

I think you mean transfer to connected account?

grim oriole
#

Yes transfer, that's the term

indigo elk
grim oriole
#

I actually read that

indigo elk
#

So which part of the content you need more clarification?

grim oriole
#

It doesn't tell me when I should do the transfer, does the source the key to wait for the invoice finish, does it has to wait for it to funded onto the platform first?

#

By default, a transfer request fails when the amount exceeds the platform’s available account balance. You can instead validate the transfer amount against its associated charge by specifying that charge as the transfer’s source_transaction. In that case, the transfer request automatically succeeds but isn’t executed until the funds from that charge are available in the platform account.

indigo elk
#

I believe this part already answered your question.

#

So it's really up to you, you can wait for the funds to be available and then initiatie a transfer, or you can initiate a transfer when the payment succeeds

grim oriole
#

Got it, so it doesn't matter, when I do the transfer when intent succeeded or invoice succeeded? I see the one time payment for example, an intent was created and completed and then an invoice created with link to that intent and completed

#

when the payment succeeds
Does it mean the payment intent succeeds or the afterwards invoice paid?

indigo elk
#

In your case, payment_intent,succeeded and invoice paid happens at the same time so you can choose either one
The only thing is that the transfer will deduct your Stripe accont's balance, and transfer will fail if your account doesn't have enough balance, and that's where source_transaction param comes in which allows you to create a transfer regardless of your account available balance

grim oriole
#

Thank you for the explanation, the part I'm confused is payment_intent is happening at the same time as the invoice.

#

I have one last question, for my subscriptions and invoice created from checkout session, all the property with type date , the values of them are always the literally the epochtime , i.e. 1970 Tue, do you know what might been the issue, but the stripe web. dashboard display it correctly, when inpecting the json, they are still 19070 Tue

indigo elk
#

The Dashboard display the epoch timestamp in a human-readable format, but the time value is the same.

grim oriole
#

I'm not talking about the format, the value from dashboard and from json are different
https://dashboard.stripe.com/test/events/evt_1O5FRgDtqoNbg2qIistlDXaH
You see this subscription for example sub_1O5FRdDtqoNbg2qIYbE92gbn the created property is 1698272457, when you converted to Date object it's Tue Jan 20 1970 07:44:32 GMT-0800 (Pacific Standard Time) But when you go back to the UI, the created ans start date is actually correct

indigo elk
#

1698272457 is Wednesday, 25 October 2023 22:20:57 UTC

#

I don't know how you get Tue Jan 20 1970 07:44:32 GMT-0800 (Pacific Standard Time) but I don't think that's the correct

grim oriole
#

Wow, I'm stupid, I thought I got it, I used new Date(that number) I'm using javascript

#

Oh I think I remember the node.js doesn't use epoch time, no worries, thank you!