Paypal Adaptive Chained Payment - Set Primary Receiver Payment Type -
i'm using adaptive payments on website. when buyer purchases product 1 of merchants, commission , seller gets rest of profit.
the issue payment seller receives of payment type services, instead of goods. when happens, sellers lose seller protection.
i have tried setting paymenttype property of reciever class no luck, transaction still comes seller paymenttype services.
please advise. can set receiver paymenttype = goods possible?
thanks!
receiverlist receiverlist = new receiverlist(); decimal merchantfee = new decimal(0.04); decimal basecommission = (orderamount * merchantfee); double finalcommission = convert.todouble(basecommission); finalcommission = globalhelper.roundup(finalcommission, 2); receiverlist.receiver = new list<receiver>(); receiver primaryreceiver = new receiver(); primaryreceiver.amount = orderamount; primaryreceiver.email = primaryrecieveremail; primaryreceiver.primary = true; primaryreceiver.paymenttype = "goods"; receiverlist.receiver.add(primaryreceiver); receiver secondaryreceiver = new receiver(); secondaryreceiver.amount = convert.todecimal(finalcommission); secondaryreceiver.email = secondaryrecieveremail; secondaryreceiver.primary = false; receiverlist.receiver.add(secondaryreceiver); requestenvelope requestenvelope = new requestenvelope("en_us"); string actiontype = "pay"; string returnurl = system.configuration.configurationmanager.appsettings["paypalreturnurl"]; string cancelurl = system.configuration.configurationmanager.appsettings["paypalcancelurl"]; string currencycode = "usd"; payrequest payrequest = new payrequest(requestenvelope, actiontype, cancelurl, currencycode, receiverlist, returnurl); payrequest.ipnnotificationurl = system.configuration.configurationmanager.appsettings["paypalnotifyurl"]; payrequest.trackingid = (orderid).tostring(); payrequest.memo = string.format("{0} {1}","payment for",title); dictionary<string, string> sdkconfig = new dictionary<string, string>(); sdkconfig.add("mode", system.configuration.configurationmanager.appsettings["api_mode"]); sdkconfig.add("account1.apiusername", system.configuration.configurationmanager.appsettings["api_username"]); sdkconfig.add("account1.apipassword", system.configuration.configurationmanager.appsettings["api_password"]); sdkconfig.add("account1.apisignature", system.configuration.configurationmanager.appsettings["api_signature"]); sdkconfig.add("account1.applicationid", system.configuration.configurationmanager.appsettings["application-id"]); adaptivepaymentsservice adaptivepaymentsservice = new adaptivepaymentsservice(sdkconfig); payresponse payresponse = adaptivepaymentsservice.pay(payrequest); return payresponse;
Comments
Post a Comment