c# - mvc paypal payment details amount dont show -


in project include paypal express check out. send details in below class. , code below;

public class paypal {     public static paypalredirect expresscheckout(paypalorder order)     {         var values = new namevaluecollection();         values["user"] = paypalsettings.username;         values["pwd"] = paypalsettings.password;         values["signature"] = paypalsettings.signature;         values["method"] = "setexpresscheckout";         values["version"] = "63.0";         values["returnurl"] = paypalsettings.returnurl;         values["cancelurl"] = paypalsettings.cancelurl;         values["paymentrequest_0_paymentaction"] = "sale";         values["paymentrequest_0_currencycode"] = "usd";         values["paymentrequest_0_amt"] = order.amount.tostring("0.00", cultureinfo.invariantculture);         values["paymentrequest_0_desc"] = "apart name";           values = submit(values);          string ack = values["ack"].tolower();          if (ack == "success" || ack == "successwithwarning")         {             return new paypalredirect             {                 token = values["token"],                 url = string.format("https://{0}/cgi-bin/webscr?cmd=_express-checkout&token={1}",                    paypalsettings.cgidomain, values["token"])             };         }         throw new exception(values["l_longmessage0"]);     }      private static namevaluecollection submit(namevaluecollection values)     {         string data = string.join("&", values.cast<string>()           .select(key => string.format("{0}={1}", key, httputility.urlencode(values[key]))));          var request = (httpwebrequest)webrequest.create(            string.format("https://{0}/nvp", paypalsettings.apidomain));          request.method = "post";         request.contentlength = data.length;          using (var writer = new streamwriter(request.getrequeststream()))         {             writer.write(data);         }          using (var reader = new streamreader(request.getresponse().getresponsestream()))         {             return httputility.parsequerystring(reader.readtoend());         }     } } 

and controller ;

 public actionresult pay(formcollection form)     {         var redirect = paypal.expresscheckout(new paypalorder { amount = 50 });         session["token"] = redirect.token;         return new redirectresult(redirect.url);     } 

but cant show amount on paypal page????? show desc dont show amount??? wrong? reply.

have passing amount or not, think not passing amount value if not add

public class cartcontroller : controller {    public actionresult index()    {       return view();    }     public actionresult pay()    {       paypalredirect redirect = paypal.expresscheckout(new paypalorder { amount = 50 });        session["token"] = redirect.token;        return new redirectresult(redirect.url);    } } 

for more details check paypal asp.net mvc

hope helps you.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -