Paypal自适应链式付款 - 设置主要接收方付款类型

时间:2015-08-19 14:47:16

标签: paypal payment paypal-adaptive-payments chained

我目前正在我的网站上使用自适应付款。当买家从我的一个商家购买产品时,我得到佣金,然后卖家获得剩余的利润。

问题是卖家收到的付款是付款类型的服务,而不是商品。当这种情况发生时,我的卖家会失去卖家保护。

我已尝试设置Reciever类的paymentType属性,但没有运气,该交易仍作为paymentType SERVICES发送给我的卖家。

请指教。我可以设置Receiver paymentType = GOODS是否可能?

谢谢!

        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;

0 个答案:

没有答案