#matiullahpro

1 messages · Page 1 of 1 (latest)

spiral roseBOT
dire tendon
#

Hello! That's not what that API is for. Detatching is for removing a Payment Method from a Customer. If you want to remove it from a Setup Intent update the Setup Intent and set its payment_method property to a different Payment Method or an empty string.

ripe echo
#

how?

dire tendon
ripe echo
#

i am trying to update null value on payment method. its showing error.

dire tendon
#

Ah, okay, I guess you can't unset a Payment Method on a Setup Intent (I've never tried before). You would need to specify a different one.

#

What's your use case? It's unusual to want to remove a Payment Method from a Setup Intent without replacing it with a different one.

ripe echo
#

I want empty string on payment method., because these payment_method no more exist,

dire tendon
#

Why though?

#

Why does it no longer exist?

ripe echo
#

$paymentMethodId = $setupIntent->payment_method; $paymentMethod = \Stripe\PaymentMethod::retrieve($paymentMethodId); $paymentMethod->detach();

because i delete it using this code.

dire tendon
#

You can't delete a Payment Method, you can only detach it from a Customer.

#

Have you considered canceling the Setup Intent instead?

ripe echo
#

yes it shows, succeed statused setup intent cannot be canceled

dire tendon
#

Oh, it already succeeded? Then the Setup Intent can no longer be modified. It stays there as a historial record of what happened.

spiral roseBOT
ripe echo
dire tendon
#

Yep, you can't modify that.

#

It's succeeded, so it's now mostly immutable except for the metadata.

#

There's no reason for you to modify it.

ripe echo
#

once payment method unattached, its customer value become null.

#

it help me.