🖥

#Stripe API / Delete all metadata key and value in Stripe object/ Rub

2020/02/26に公開

update and empty value. it works.

# Set metadata
Stripe::SubscriptionSchedule.update(subscription.schedule.id, metadata: { a: "1", b: "2"}).metadata
# => #<Stripe::StripeObject:0x2b194861e680> JSON: {
#  "a": "1",
#  "b": "2"
# }

# NG
# Update with empty Hash
Stripe::SubscriptionSchedule.update(subscription.schedule.id, metadata: { }).metadata
# => #<Stripe::StripeObject:0x2b19485d9fa8> JSON: {
#  "a": "1",
#  "b": "2"
# }

# NG
# Update with nil
Stripe::SubscriptionSchedule.update(subscription.schedule.id, metadata: nil).metadata
# => #<Stripe::StripeObject:0x2b19485b1f80> JSON: {
#  "a": "1",
#  "b": "2"
# }

# OK
# Update with empty string
Stripe::SubscriptionSchedule.update(subscription.schedule.id, metadata: "").metadata
# => #<Stripe::StripeObject:0x2b194858a32c> JSON: {
# } 

deleting Metadata · Issue #637 · stripe/stripe-dotnet

Original by Github issue

https://github.com/YumaInaura/YumaInaura/issues/3005

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2020-02-26

Discussion