#MarcusStripe
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
thanks
I'm not really following, let's forget a bit about the implementation and just focus on the use-case
could you please describe what are you trying to achieve here?
We have a product, with a price id. the price is a one time price / product
customer with an existing subscription and existing payment method, can buy those items additionally
(mutiple times)
we have a 3D secure requirement also
I was told to buy those one time products, I would have to create an invoice
I want the payment to be done immediately with an extra invoice -
not have the one time item added tot eh invoice at the end of the period
and I think I need a secret for the client / ui to confirm the payment
not necessarly
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it should not be added to the subscription.. it should be a ONE time payment
with prorations none and billing_cycle_anchor unchanged
and it should be paid immediately
please read the link I sent you
hm.. difficult. you are basically telling me to do something entirely different than what was told to me - here - before.
Why not using the invoice create api? Any good reason not to?
and I checked it:
add_invoice_items optional array of hashes
A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription.
As I wrote - that is NOT what I want
no not really but you mentioned this
customer with an existing subscription and existing payment method, can buy those items additionally
which got me thinking about our add_invoice_items which is exactly for this use case
e.g. I have a subscription from 15.-15. Today is the 7th, and right now I want to buy a new one time item
and in the future, this might also be bought without a subscription
if you combine add_invoice_items with prorations none and billing_cycle_anchor unchanged you will get what you want
so if bought on the u7th, the payment should be done immediately
an extra invoice should be sent to the customer
then why are we talking about subscriptions here
why not just treat them separately
ok then maybe I confused you
sorry ๐
I just wanted to say.. I hope the subscripion will not get in the way in some way
it should be handled separatly, but the fact is there may be additional a subscription
if these are add-ons to the subscription I really recommend using my method
and in any case, I asume that the payment method is ready
define "addon"
those one time payments - you can buy support time, e.g
there may - or may not - be a subscription
but the customer can buy extra customer support
so I pay you 100 USD and then I got the right to call you
if the support is related to the subscription then using the add_invoice_items would mean that you would get an invoice linked to that subscription which is paid immediately and that doesn't change the cycle of the subscription (when using the above mentioned params)
if you the support isn't related to that subscription then you can use the create invoice API to do so separately
but, as I said, I dont want it linked, especially not because, at a later time, we want to allow to buy one time payments without having any subscriptions
so I did:
Invoice.create(
InvoiceCreateParams.builder()
.setCustomer(stripeCustomerId)
.setCollectionMethod(InvoiceCreateParams.CollectionMethod.CHARGE_AUTOMATICALLY)
.setDaysUntilDue(0L).build()
I just wanted to make that point clear before proceeding
in that case why are you using charge_automatically when you went the invoice to be sent to the user and have them pay it?
thats how I was told to do.. but following the errors I get.. it is and seems logically wrong
I do the next call as:
InvoiceItem invoiceItem = InvoiceItem.create(InvoiceItemCreateParams.builder()
.setCustomer(stripeCustomerId)
.setPrice(stripePriceId)
.setInvoice(invoice.getId())
and the last call was:
invoice.sendInvoice(InvoiceSendInvoiceParams.builder()
.addExpand("payment_intent")
.build(), requestOptions);
I need a payment intent.. or at least I think I do?
to confirm the one time payment
in the client
just a second please
let's forget about the code again for a sec here, how do you want your customer to pay the invoice? do you want to use the already existing payment method? do you want them to come back to your website and have them enter the payment details? or do you want them to go to our Hosted Invoice page and pay it there?
do you want to use the already existing payment method?
yes
do you want them to come back to your website and have them enter the payment details?
the user themselves click a BUY NOW button
they are online at the time
so you click buy - and confirm the payment with your 3d secure method just in time
ok you might not need 3DS
that's why it said "CHARGE_AUTOMATICALLY"
but it doesnt like the invoice part in that case
ok you might not need 3DS
This I dont know. I just want stripe to give all whatever necessary to the client so the client can finish up the payment while online
and when the payment is done, I expect an invoice to be send to the customer, and I will listen to the event for a manual invoice so I can ACTIVATE that product as bought in my backend
why are you sending the invoice? that part I haven't figured out yet
oh that's not really possible
ok. what alternative ?
you'd have to send the invoice yourself
If I charge money from you, I guess you'd expect an invoice?
or send the receipt instead
it just does because you're charging them automatically
for any money flying arround, we need some kind of paper as a proof
that's not true
but as I said you can send them a receipt
how's that actually different?
an Invoice means that you need money from someone and they need to pay it. a receipt means that someone already paid you for something
yeah this differnece I know
and still... in the digital world.. this difference is not really a (big) difference at all
I just googled the case for Germany. It says receipt only work up to 150 Euro
so I would be definitely saver with an invoice
so I would say - hey customer you want - PRODUCT - here is the INVOICE - and then I charge the invoice directly.
somehow... right?
I mean thats also how it works with the subscriptions
there are invoices, and they are charged by stripe automatically
so I want a similar behaviour
To be clear, an invoice will be sent to users following payment of a charge_automatically invoice (assuming you have receipts turned on)
There'll be a link in the email, like this:
so.. I should use charge automatically, as I did
but then.. should I also call send invoice.. or not.. it doesnt seem to work
What doesn't seem to work?
well so far I had -
create invocie with CHARGE automatically
then - create invoice item - add the price to charge for
then - send invoice
and this gave me an exception
What's the error?
I got:
You can only specify 'due_date' or 'days_until_due' if invoice collection method is 'send_invoice'.; request-id: req_W0WUSJvQy8lgcd
I guess you can't call that endpoint with charge_automatically
Then, I removed that, and got:
You can only manually send an invoice if its collection method is 'send_invoice'.; request-id: req_goPNULhYs84vV5
Yep, as stated:
To be clear, an invoice will be sent to users following payment of a charge_automatically invoice (assuming you have receipts turned on)
So you don't need to manually call the endpoint to send the invoice
and the payment intent that i need -
befgore, I added it to send Invoice
now if I remove that
I would instead do:
private Invoice createInvoice(String stripeCustomerId) throws StripeException {
return Invoice.create(InvoiceCreateParams.builder()
.setCustomer(stripeCustomerId)
.setCollectionMethod(InvoiceCreateParams.CollectionMethod.CHARGE_AUTOMATICALLY)
.addExpand("payment_intent")
.build(), requestOptions);
}
yes?
adding the payment intent expand to the create invoice call
to return the payment intent to the client
to confirm the payment
ok
great, finally solved ๐
one more, other thing
(entirely different!)
we want to add additional payment methods
the payment method is added on-session of course.. in the client
the client AFAIK adds it - but needs a secret for confirmation -
is that a payment intent or a setup intent?
--
We used a payment intent and this failed with:
: Missing required param: amount.; code: parameter_missing; request-id: req_2EMXHNYWGDXCrv
Is it simply to setup a card for future payments? There's no actual initial payment?
yeah
it is just to be abel to swithc a card that is about to expire
so - add a new card for later -
make it the primary card -
Sure, then you need Setup Intents: https://stripe.com/docs/payments/save-and-reuse
remove the old card
Let me know if you have any follow-up Qs about that doc