UpdatePaymentMethod: unable to delete properties
See original GitHub issueI’m unable to delete properties at all when trying to update a PaymentMethod. I’ve all 4 of the following approaches. I will use the address.city
as an example:
- PaymentMethodUpdateParams.BillingDetails.Address.builder().setCity(null)
- PaymentMethodUpdateParams.BillingDetails.Address.builder().setCity(“”)
- PaymentMethodUpdateParams.BillingDetails.Address.builder().putExtraParam(“postal_code”, null)
- PaymentMethodUpdateParams.BillingDetails.Address.builder().putExtraParam(“postal_code”, “”
I’ve also tried mixing-and-matching these 4 cases, but nothing works.
I get this error when it’s empty string: com.stripe.exception.InvalidRequestException: You cannot set 'billing_details[address][line2]' to an empty string. We interpret empty strings as null in requests. You may set 'billing_details[address][line2]' to null to delete the property.
It seems to be roughly the same issue as: https://github.com/stripe/stripe-java/issues/788.
I would reckon that the PaymentMethod.update
is almost completely useless without the ability to delete values.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unable to delete property | Booking.com for Partners
I setup 'new' property - in order to change some settings that were wrong. Now I am unable to delete the other property....
Read more >Remove a payment method from your Apple ID - Apple Support
Remove a payment method online · Go to appleid.apple.com. · Tap or click Sign In, then sign in with your Apple ID. ·...
Read more >Add, update, or delete a payment method - Microsoft Learn
This article describes how to add, update, or delete a payment method used to pay for an Azure subscription.
Read more >Vault Products - Autodesk Knowledge Network
Issue: Users reported that when trying to delete a property with zero usage count in Vault it fails and the following message is...
Read more >Unable to delete configuration properties from LWC?
1 Answer 1 ... Yes, this is a Very trick thing. For this, you Have to remove the "LWC" component from your record...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@decoursin You are correct, this is a bug in the library. There should be a
setFooter(EmptyParam value)
override, but it doesn’t exist currently. We’ll look into it and release a fix.Hi @decoursin. Fields that can be unset have an overload method that accepts an
EmptyParam
value, e.g.: https://github.com/stripe/stripe-java/blob/4a7a241288cc626a6ef0142a1c3ec79ba5174857/src/main/java/com/stripe/param/CustomerUpdateParams.java#L255The only valid
EmptyParam
value isEmptyParam.EMPTY
. So for instance this is how you’d unset theaddress
field on a customer:In the case of
PaymentMethodUpdateParams
, none of fields inbilling_details[address]
nor the parent fieldbilling_details[address]
itself are unsettable in the API, so the Java library does not provide overload methods to passEmptyParam.EMPTY
for any of these fields.I will raise this issue internally, but I also recommend you reach out to support at https://support.stripe.com/email to request this feature and give some details about your use case.