#oleg_codaio

1 messages · Page 1 of 1 (latest)

unborn flowerBOT
graceful hinge
#

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

viscid hawk
#

Can you share with me the ID of the request that you made to update the payment_method of the invoice?

graceful hinge
#

req_ng5sXMbhBSeK12

viscid hawk
#

I see, so you want to remove card from payment_settings.payment_method_types, am I right?

graceful hinge
#

Yeah, exactly. We accidentally created a bunch of these invoices with card as an allowed payment method

viscid hawk
#

I don't think that's possible, this invoice is already finalized so no changes are allowed.

graceful hinge
#

It was possible on some other invoices though -

viscid hawk
#

Are those invoices in draft mode?

graceful hinge
#

Finalized. Example: req_9yf2CAZFMPQAQR

viscid hawk
#

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.

graceful hinge
#

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

viscid hawk
#

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

graceful hinge
#

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)

viscid hawk
#

request ID?

graceful hinge
#

req_o7DzqGyr2sDqN5

viscid hawk
#

try using -d "source=null"

graceful hinge
#

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?

viscid hawk
#

OK, you are right, looks like neither source or payment_method can be unset for a PaymentIntent.