#Dooing

1 messages ยท Page 1 of 1 (latest)

vestal wrenBOT
gleaming jolt
remote bloom
#

thanks. Anything else that is required in this call?

gleaming jolt
#

I'm not sure, we're not part of Support so we don't know much about their processes.

remote bloom
#

something else - for one time purchases - is there a way to search / query / find which ONE_TIME products a customer bought? Is there a way to inform stripe that a one time product was "USED" by the customer?

gleaming jolt
#

As long as you're using a process that relies on having a Price ID provided (such as creating Checkout Sessions, or using Payment Links), then yes, you can find which Product was purchased.

Can you elaborate on what you mean when you say the product should be marked as "used"? What is your desired outcome of that scenario?

remote bloom
#

well as it is a One time purchase - for isntance, the customers should be able to buy consulting time

#

when the consulting time was spent -

#

we need to somehow flag the one time item as used

#

either in our business logic (database) or inside stripe

#

it seems the result of one time purchases are invoices only? so I guess the answer is NO

gleaming jolt
#

That sounds like something that you would need to track on your end. Stripe is more suited for handling the purchase portion of this flow, and we don't have a good mechanism for tracking consumption of those purchased goods/services.

Most of our objects have a metadata field where data that is important to your flows can be stored, but with how much you would need to interact with the API to track/maintain that information it would likely be easier to manage it on your end.

remote bloom
#

And how can I reference the one time payment made in stripe? with this id? pi_3LlC6yF2iEUqWxhT0mItzZc4

#

or does it actually make any sense to reference the payment on stripe's side when it all has to be referenced on our end anyway?

#

pi_... is that a "stripe payment id"?

#

__
And last but not least.. sorry.... a bit offtopic.. just a question regarding the correct english term - is it - CONSUMING goods / services or using? so "USED" or "CONSUMED" as a status in our database.. what works best in your opinion?

#

(for digital products, not food ๐Ÿ™‚

#

)

gleaming jolt
#

pi is the prefix that the IDs of our Payment Intents have.

The Payment Intent that you referenced is associated with an Invoice, so that Invoice will be the higher-order object which contains the reference(s) to the Price(s)/Product(s) used.

You can find the ID of the related Invoice in the invoice field on the Payment Intent (that field will be null if the Payment Intent isn't related to an Invoice):
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice

You can use the Invoice ID to retrieve that Invoice:
https://stripe.com/docs/api/invoices/retrieve
and inspect its lines to see the line items for the Invoice:
https://stripe.com/docs/api/invoices/retrieve
Inside you'll find the price hash which will have the id of the Price object that was used as well as the ID of the related Product (in the product field).

gleaming jolt
remote bloom
#

Reference - speaking of subscriptions (as a counter sample), there is a subscription id - so the id that references the exact subscription related to a recurring price, for the given customer

#

I am looking for a similar reference of such kind.

#

that i know - this customer - has bought this one time price

#

is that the payment intent, payment id, invoice id, invoice item id?

#

This is completely up to you, and may depend on what you're selling or how you want to represent it.
I know its up to me. But assuming / hoping that you are native or at least better in the stripe / payment terms than I am, I'd hope you'd be able to help me out with the best suited term for a one time price that references a digital / virtual product, like time bought.

#

is that a "USED" or "CONSUMED" in this context?

remote bloom
#

helloooo?

gleaming jolt
#

They're synonyms, either will work.

remote bloom
#

ok

#

still coding on the subject, in parallel. Now I am facing this issue - which webhook should I listen to to see that the one time payment was actually finally paid?
ALso Invoice paid like for subscriptions?

#

here I check:
private static boolean isSubscriptionCreate(Invoice stripeInvoice) {
return "subscription_create".equals(stripeInvoice.getBillingReason());
}

#

assuming it is the same event.. which message / field to check for the one time payments?

#

and then... again the question... how to reference those one time payments in my system? Invoice id? Invoice item id???

rugged lotus
#

Hello, toby is stepping out but I can help out here. Catching up now...

#

Yes, invoice.paid is the event you would listen to for successful payments with one-off invoices.

remote bloom
#

Thank god, Tobey was mostly a pain

rugged lotus
#

And it really is your choice what to use here. That being said, invoice ID would probably make sense as that relates to the entire payment.

remote bloom
#

but invoice id... I would not have until the invoice was received, I assume

rugged lotus
#

You'll have it as soon as the Invoice is created. If that doesn't work, it would probably be best to make some custom ID on your side and store it in some field on the invoice. Probably metadata if you don't want the user to see it or description, footer, or custom_fields if you do want them to see it.

remote bloom
#

you dont get my point

#
  1. a customer chooses a one time product
#
  1. I store this one time product as PENDING in my database for the customer
#
  1. stripe sends me the INVOICE foer the one time product
#
  1. how to connec tthe product PENDING with the invoice... so I can activate it?
#

especially, when several one time products are bought in parallel

#

and my customer (for which I implement this) has several diferent one time prices

#

And, right in parallel, I am also implementing for my own product.. and someting entirely different -
I am right now using the connect api so I can send money TO customers.
Got this exception:

You must update your Connect branding settings with icon, brand color in order to create an account link. You can set the missing fields at https://dashboard.stripe.com/settings/connect; request-id: req_xlwuOMKIWG5htq


I am right on this page.. but I do not find any connect branding setting son this page ๐Ÿ˜ฆ

#

hellooo???

rugged lotus
#

I'm reading through your explanation and am still not quite sure the part that I don't get. So it sounds like you have customer x buys product y from you, you create an invoice in_123 in Stripe for it, and you are trying to figure out how to associate in_123 with customer x buying product y?

#

Will look in to the branding part in a minute. Server is busy so I am bouncing between threads still

remote bloom
#

--

#

ok, that question actually helped me to check my logic ๐Ÿ˜‰

#

Invoice invoice = createInvoice(stripeCustomerId);
createInvoiceItem(stripeCustomerId, stripePriceId, invoice);
Invoice invoiceSent = sendInvoice(invoice);
return invoiceSent.getPaymentIntentObject().getClientSecret();

#

is what i do, on a high level

#

so I assume that means I have - the invocie, the invoice payment intent and probably also the invoice item id

#

which one is the most correct element to persist for later reference of form the incoming stripe event?

#

I assume invoice item - but is that also send by the invoice paid event?

#

and probably difficult to get?

#

Since, in my case, I have just one item in this invoice, I guess it would at least be SAVE her to just use / store the invoice id.. that should later be easy to get from the invoice paid event

rugged lotus
#

If this is only one item per invoice, it would probably be easier to just refer to the payment intent ID or the invoice ID, as you note those would be very easy to get from the event

strange kernel
#

๐Ÿ‘‹ hey everyone! @remote bloom you were completely out of line earlier about my colleague. You can not talk to us or about us this way again.

remote bloom
#

Thanks for the lecture