c# - How do I debug a 'malformed request'? -


i using paypal rest api visual studio 2015. getting 'malformed request' on sandbox paying paypal stored ccard (passing token paypal api). debug id:5b98f22095ba7

how capture request submitted paypal, can compare expected request format? alternately, can point me tool give me detail on debug id?

thanks!

?details {paypal.api.details} fee: "0.00" gift_wrap: "0.00" handling_fee: "0.00" insurance: "0.00" shipping: "0.00" shipping_discount: "0.00" subtotal: "55.00" tax: "2.75"

?paypalitem {paypal.api.item} category: null currency: "cad" description: "individual lesson" height: null length: null name: "letsride: individual lesson" postback_data: null price: "55.00" quantity: "1" sku: "1" supplementary_data: null tax: "2.75" url: null weight: null width: null ?amnt {paypal.api.amount} currency: "cad" details: {paypal.api.details} total: "57.75" ?pinfo {paypal.api.payerinfo} billing_address: null birth_date: null buyer_account_number: null country_code: null email: null external_remember_me_id: null first_name: "test" last_name: "user" middle_name: null payer_id: "test" phone: null phone_type: null salutation: null shipping_address: null suffix: null tax_id: null tax_id_type: null ?payr {paypal.api.payer} account_age: null account_type: null external_selected_funding_instrument_type: null funding_instruments: count = 1 funding_option: null funding_option_id: null payer_info: {paypal.api.payerinfo} payment_method: "credit_card" related_funding_option: null status: null ?phn {paypal.api.phone} country_code: "+1" extension: null national_number: "3066920xxx" // redacted {paypal.api.payee} email: "valid email adress - redacted" merchant_id: "valid merchant id - redacted" phone: null

?payment {paypal.api.payment} billing_agreement_tokens: null cart: null create_time: null experience_profile_id: null failed_transactions: null failure_reason: null id: null intent: "sale" links: null note_to_payer: null payee: {paypal.api.payee} payer: {paypal.api.payer} payment_instruction: null redirect_urls: null state: null token: null transactions: count = 1

update_time: null

               intentstr = "sale";                  // create payer object , assign fundinginstrument list object                 payerinfo pinfo = new payerinfo();                 pinfo.first_name = ordermaster.firstname;                 pinfo.last_name = ordermaster.lastname;                 pinfo.payer_id = user.username;                 payer payr = new payer();                 payr.payer_info = pinfo;                 payr.funding_instruments = createpaypalfundinginstrumentlist(ppcctoken);                 payr.payment_method = "credit_card";                 phone phn = new phone();                 phn.country_code = "+1";                 phn.national_number = usercompany.paypalphone;                 payee pyee = new payee();                 pyee.email = usercompany.paypalemail;                 pyee.merchant_id = usercompany.paypalmerchantid;                  // create payment object , assign payer object & transaction list                 payment = new payment()                 {                     intent = intentstr,    // `sale` or `authorize`                     payer = payr,                     payee = pyee,                     transactions = gettransactionslist(ordermaster)                 }; 

self-solved: removed 'payee = pyee' section created third party payments, , received clearer error message paypal api. error related test credit card using, not supporting cad currency!!

man - spend 2 days trying debug code!!!!!

captured different test credit card in vault, , problem solved!

wish paypal clearer messaging on error! or - give developers access debug id detail.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -