#oleg_codaio
1 messages · Page 1 of 1 (latest)
The request for the first operation I get an error from is this:
stripe invoices update in_1NppP1AegRHrUhUqdYZq4J9i --payment-settings.payment-method-types=customer_balance --live
The operation succeeds if the payment intent has a null source (no previous source set on the customer) but if there was some source, looks like the payment intent is tightly coupled to it and I can't figure out how to detach
Can you share with me the ID of the request that you made to update the payment_method of the invoice?
req_ng5sXMbhBSeK12
I see, so you want to remove card from payment_settings.payment_method_types, am I right?
Yeah, exactly. We accidentally created a bunch of these invoices with card as an allowed payment method
I don't think that's possible, this invoice is already finalized so no changes are allowed.
You should revise the invoice by creating a new invoice https://stripe.com/docs/api/invoices/create?lang=node#create_invoice-from_invoice
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 was possible on some other invoices though -
Are those invoices in draft mode?
Finalized. Example: req_9yf2CAZFMPQAQR
I see, that's beacuse the assocaited PaymentIntent pi_3NpeGeAegRHrUhUq1P2d6CdS doesn't have a payment_method yet
One workaround is to detach the payment_method of in_1NppP1AegRHrUhUqdYZq4J9i's payment_intent and try again.
Payment intent pi_3NppPBAegRHrUhUq1zNnYzqS does have a source though
How do I detach it? I tried this:
stripe payment_intents update pi_3NppPBAegRHrUhUq1zNnYzqS -d "payment_method=" --live
Getting error:
You passed an empty string for 'payment_method'. We assume empty values are an attempt to unset a parameter; however 'payment_method' cannot be unset. You should remove 'payment_method' from your request or supply a non-empty value.
And the customer_balance payment method doesn't have an id
What I mentioned earlier is pi_3NpeGeAegRHrUhUq1P2d6CdS, which doesn't have source or payment_method and that's why you can change the associated invoice's payment_settings.payment_method_types
pi_3NppPBAegRHrUhUq1zNnYzqS has a source but no payment_method, so you should unset the source (by setting it to ""), not payment_method
hmm, I tried:
stripe payment_intents update pi_3NppPBAegRHrUhUq1zNnYzqS -d "source=" --live
get an error: No such source: ''
using the "-d" since source isn't even documented in the docs anymore (presumably since sources are deprecated)
request ID?
req_o7DzqGyr2sDqN5
try using -d "source=null"
req_oJqRuElrGG4FEs
Hmm, the CLI is passing it in as a 'null' string
tried the same in Node - SDK is also rewriting null to ;; req_O1C0r47iN7wHrp
the Stripe API doesn't accept JSON and only x-www-form-urlencoded, so think it's only possible to send in empty strings?
OK, you are right, looks like neither source or payment_method can be unset for a PaymentIntent.