How do I delete the Metadata?
say I the client wanted to remove "OftenSays" from
var metadataArray = [ Name : "Ray Barone" , OftenSays : "Thatttttt's right" ]
in the javascript I would remove it and send over the New Array to the API
var myCustomer = new StripeCustomerUpdateOptions();
mycustomer.Metadata = metadataArray;
var customerService = new StripeCustomerService();
StripeCustomer stripeCustomer = customerService.Update(*customerId*, myCustomer);
I tried the Update() function as shown above . It succeeded but it wont remove it. any help would be nice
hmm - so what is your code you are passing to the Update function for customer to remove it?
I just sent the new metadata Array with the CustomerId
exactly like the example. It will add new metadata but it wont delete
var myCustomer = new StripeCustomerUpdateOptions();
mycustomer.Metadata = metadataArray;
var customerService = new StripeCustomerService();
StripeCustomer stripeCustomer = customerService.Update(*customerId*, myCustomer);
Do you want to erase the metadata entirely? Have you tried updating with an empty dictionary?
no just one specific like how you can in the stripe.com dashboard
I would check with Stripe first to see how this is done with CURL... I'm not sure what the logic is to remove an entry. Check with them and then we can figure out how to support it (or if it already exists) with Stripe.net
Well it turns out i don't need to mimic that feature anymore but ill see what I can figure out for future reference.
I pinged Stripe in the IRC room - looks like you can just supply a blank value. So in this case, you would pass var metadataArray = [ Name : "Ray Barone" , OftenSays : "" ] ?
edit: feel free to ping again if this doesn't work - support verified with CURL, so Stripe.net should pass the same thing. If it doesn't - re-open and I'll fix 馃憤
Can you pass null as well or does it have to be string.Empty?
@xt0rted I think it has to be an empty string
I wrote a test for this - null and string.empty works. https://github.com/jaymedavis/stripe.net/pull/643
The build should be done soon...
Thanks @xt0rted - I think null is actually a little cleaner.
All set with tests and readme updates 馃憤 Thanks much!!
Most helpful comment
I wrote a test for this - null and string.empty works. https://github.com/jaymedavis/stripe.net/pull/643
The build should be done soon...