Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading struct from NameValueCollection

Tags:

c#

http

asp.net

I am working on a payment processor class right now and I have hit a roadblock. I am using the FastSpring e-commerce service and they have a nice set of tools, but I am stuck on one thing.

For PayPal IPN, to get the person's first name (this is in C#/ASP code) I would do this:

base.Context.Request.Params["first_name"]

With FastSpring, they seem to store the information within a structure, as seen here in "customer": http://nvsx.net/i/c2252.png

How would I modify my code to properly create that structure from the HTTP post context?

Updates:

NameValueCollection keys: http://pastie.org/1346312

Customer Key Value: {0} --> {1}Customercom.brightmarket.api.variable.v1.contact.ContactVariable@175d7aa

like image 840
Eaton Avatar asked Oct 10 '26 07:10

Eaton


1 Answers

It looks like it's already a proper object, no? You should just have to cast it.

Have you tried something like

var contact = (ContactVariable)Context.Request.Params[str];

and then using the members of the contact variable?

like image 126
cdhowie Avatar answered Oct 12 '26 20:10

cdhowie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!