#Bit-retrieve-pi

1 messages ยท Page 1 of 1 (latest)

tacit thistle
#

Hey! The setup_future_usage field is available when you retrieve the PI. Is this not the case?

iron depot
#

I'm using c#... I can update it by using PaymentIntentServices.Update and passing the PaymentIntentId + the Options
I can create it almost the same way
but I can't find how to retrieve it
when I retrieve a PaymentItent I can only access all the other details (Amount, Metadata,PaymentMethods) but not the PaymentIntentOptions...
and seems there's no documentation at all on how to do it

#

humm no..

#

I can't access that field when I retrieve PI

tacit thistle
#

Can you share an example response/code?

iron depot
#

yes, give me 30 secs

#

oh nice... it's there exactly where I checked 100 times and there was not

#

it happens the same when I need something from the kitchen and my wife says "it's there, in front of you!"

#

are you my wife ? ๐Ÿ™‚

#

thank you very much for your support

tacit thistle
#

Np!

iron depot
#

I hope one day you'll implement a value "noStore" for the SetupFutureUsage, it's a pity I need to destroy a PaymentIntent and create a new one, when a customer is buying the same product but simply chooses not to have a recurring plan

#

because I can't set back to Null the SetupFutureUsage, once I set to "off_session"

tacit thistle
#

Hmm, I'm not sure I understand. You don't need to pass setup_future_usage

iron depot
#

if I want to bill the user when he's offline, I guess I need to

tacit thistle
#

I don't understand why you need to create a new PI though

#

Equally, you can't 'destroy' a PI

iron depot
#

oh nice... so I don't know how to solve it... the flow is this:

scenario 1) customer buys the product without renewal: I create a PI, I do not set "setup_future_usage", the customer pays, the paymentmethod doesn't get attached to the customer: everything is fine.

scenario 2) customer buys the product with renewal: I create a PI, I set "setup_future_usage" to "off_session", the customer pays, the paymentMethod gets attached to the customer, I can bill him next month: everything is fine.

scenario 3) customer wish to buy the product with renewal: I create a PI, I set "setup_future_usage" to "off_session", the customer starts to pay but cancels the payment during the 3D, then he changes his mind and select the same product but without renewal, and pays. The paymentMethod gets attached to the customer anyway.

#

when the customer selects a "no recurring" we explicitly say them that we will not save his card... but at the end what happens is that they'll find the card attached in their profile even if they chose a product without renewal/susbscription plan

#

if I can't update the PI and I can't cancel/destroy it, how can I find a way out ?

#

I simply create a new one, and forget about the previous created one ?

tacit thistle
#

So yes, in this instance:

then he changes his mind and select the same product but without renewal, and pays. The paymentMethod gets attached to the customer anyway.
You'd unset the setup_future_usage parameter via an update on the existing PI: https://stripe.com/docs/api/payment_intents/update

iron depot
#

but I can't update it once it has been set to "off_session"

#

if I set it to "null", and then retrieve the PI again, it still has the value of "off_session"

tacit thistle
#

Ah, got it. Wasn't sure if they could be unset

#

I guess you'll need to cancel and create a new PI in that case

iron depot
#

yes, and don't you agree that is a shame, only because there's not a "no_store" value you can set the SetupFutureUsage to ?

#

I hope you have a way to forward the idea for a future improvement

tacit thistle
#

Hey! Just tested something

#

You can unset the setup_future_usage parameter when updating. You just need to send an empty string value (not null)

tacit thistle
#

@iron depot โ˜๏ธ