我在键值对字符串中使用贝宝 NVP 和 NVP 响应
例子
TOKEN=EC-3XXXXXXXXXXX154J&BILLINGAGREEMENTACCEPTEDSTATUS=1&CHECKOUTSTATUS=PaymentActionNotInitiated&TIMESTAMP=2012-07-10T11:45:59Z&CORRELATIONID=ecf9bfe9b1168&ACK=Success&VERSION=64.0&BUILD=3242673&EMAIL=govind_1341920205_per@gmail.com&PAYERID=3V85HKW32SXKG&PAYERSTATUS=verified&FIRSTNAME=Govind&LASTNAME=Malviya&COUNTRYCODE=US&SHIPTONAME=Govind Malviya&SHIPTOSTREET=1 Main St&SHIPTOCITY=San Jose&SHIPTOSTATE=CA&SHIPTOZIP=95131&SHIPTOCOUNTRYCODE=US&SHIPTOCOUNTRYNAME=United States&ADDRESSSTATUS=Confirmed&CURRENCYCODE=USD&AMT=30.90&SHIPPINGAMT=0.00&HANDLINGAMT=0.00&TAXAMT=0.00&DESC=test EC payment&INSURANCEAMT=0.00&SHIPDISCAMT=0.00&PAYMENTREQUEST_0_CURRENCYCODE=USD&PAYMENTREQUEST_0_AMT=30.90&PAYMENTREQUEST_0_SHIPPINGAMT=0.00&PAYMENTREQUEST_0_HANDLINGAMT=0.00&PAYMENTREQUEST_0_TAXAMT=0.00&PAYMENTREQUEST_0_DESC=test EC payment&PAYMENTREQUEST_0_INSURANCEAMT=0.00&PAYMENTREQUEST_0_SHIPDISCAMT=0.00&PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false&PAYMENTREQUEST_0_SHIPTONAME=Govind Malviya&PAYMENTREQUEST_0_SHIPTOSTREET=1 Main St&PAYMENTREQUEST_0_SHIPTOCITY=San Jose&PAYMENTREQUEST_0_SHIPTOSTATE=CA&PAYMENTREQUEST_0_SHIPTOZIP=95131&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US&PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME=United States&PAYMENTREQUESTINFO_0_ERRORCODE=0PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false&PAYMENTREQUEST_0_SHIPTONAME=Govind Malviya&PAYMENTREQUEST_0_SHIPTOSTREET=1 Main St&PAYMENTREQUEST_0_SHIPTOCITY=San Jose&PAYMENTREQUEST_0_SHIPTOSTATE=CA&PAYMENTREQUEST_0_SHIPTOZIP=95131&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US&PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME=United States&PAYMENTREQUESTINFO_0_ERRORCODE=0PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false&PAYMENTREQUEST_0_SHIPTONAME=Govind Malviya&PAYMENTREQUEST_0_SHIPTOSTREET=1 Main St&PAYMENTREQUEST_0_SHIPTOCITY=San Jose&PAYMENTREQUEST_0_SHIPTOSTATE=CA&PAYMENTREQUEST_0_SHIPTOZIP=95131&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US&PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME=United States&PAYMENTREQUESTINFO_0_ERRORCODE=0
我想在强类型数据中反序列化它,就像 JavaScriptSerializer 对 json 字符串所做的那样。请不要使用字典提供解决方案我想避免使用魔术字符串,我可以在每个属性上添加属性。
我的课是
public class GetExpressCheckoutDetailsResponse : IPaypalResponse
{
public string Token { get; set; }
public string BillingAgreementAcceptedStatus { get; set; }
public string CheckoutStatus { get; set; }
public string Timestamp { get; set; }
public string CorrelationID { get; set; }
public Status Acknowledgement { get; set; }
public string Version { get; set; }
public string Build { get; set; }
public string Email { get; set; }
public string PayerID { get; set; }
public string PayerStatus { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CountryCode { get; set; }
public string ShiptoName { get; set; }
public string ShiptoStreet { get; set; }
public string ShipToCity { get; set; }
public string ShipToState { get; set; }
public string ShipToZip { get; set; }
public string ShipToCountryCode { get; set; }
public string ShipToCountryName { get; set; }
public string AddressStatus { get; set; }
public string CurrencyCode { get; set; }
public string Amount { get; set; }
public string ShippingAmount { get; set; }
public string HandlingAmount { get; set; }
public string TaxAmount { get; set; }
public string Description { get; set; }
public string InsuranceAmount { get; set; }
public string ShipdiscAmount { get; set; }
public string PaymentRequestCurrencycode { get; set; }
public string PaymentRequestAmount { get; set; }
public string PaymentRequestShippingAmount { get; set; }
public string PaymentRequestHandlingAmount { get; set; }
public string PaymentRequestTaxAmount { get; set; }
public string PaymentRequestDescription { get; set; }
public string PaymentRequestInsuranceAmount { get; set; }
public string PaymentRequestShipdiscAmount { get; set; }
public string PaymentRequestInsuranceOptionOffered { get; set; }
public string PaymentRequestShipToName { get; set; }
public string PaymentRequestShipToStreet { get; set; }
public string PaymentRequestShipToCity { get; set; }
public string PaymentRequestShipToState { get; set; }
public string PaymentRequestShipToZip { get; set; }
public string PaymentRequestShipToCountryCode { get; set; }
public string PaymentRequestShipToCountryName { get; set; }
public string PaymentRequestInfoErrorCode { get; set; }
}