贝宝 - 支付综述不显示被SetPaymentOptions设置项目 [英] PayPal - Payment Summery doesn't show items set by SetPaymentOptions

查看:211
本文介绍了贝宝 - 支付综述不显示被SetPaymentOptions设置项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用贝宝SDK的净自适应付款。 我试图用SetPaymentOptions方法,但是设置我希望在付款摘要部分显示的项目,当我用我的付费方式收到的付款密钥,支付汇总仅显示网站重定向到沙箱审批页一排,上面写着faciliator帐户的试验店和总金额。

响应返回成功code,再加上我看到,其他参数,如BuisnessName(在DisplayOptions)都出现在页面上。

以下是code我想执行(该参数是通过映射到实际的帐户,网址,金额等实际值替换)。 谁能告诉我什么,我做错了什么?

谢谢!

  AdaptivePaymentsService服务=新AdaptivePaymentsService();
        RequestEnvelope envelopeRequest =新RequestEnvelope();
        envelopeRequest.errorLanguage =EN_US;

        名单<受话器和GT; listReceiver =新的名单,其中,接收器>();
        接收器收到=新的接收器((十进制)300.15);
        receive.email =receiver@mail.com;
        listReceiver.Add(接收);
        ReceiverList listOfReceivers =新ReceiverList(listReceiver);

        PayRequest reqPay =新PayRequest(envelopeRequest,创建,URL,
            USD,listOfReceivers,URL);
        reqPay.sender =新SenderIdentifier();
        reqPay.sender.email =sender@mail.com;

        PayResponse responsePay = service.Pay(reqPay);

        如果(responsePay = NULL和放大器;!&安培;。responsePay.responseEnvelope.ack.ToString()修剪()ToUpper的()等于(SUCCESS))
        {
            SetPaymentOptionsRequest payOptionsReq =新SetPaymentOptionsRequest();
            payOptionsReq.displayOptions =新DisplayOptions()
            {
                BUSINESSNAME =我的企业名称
            };
            payOptionsReq.payKey = responsePay.payKey;
            payOptionsReq.requestEnvelope = envelopeRequest;
            payOptionsReq.receiverOptions =新的名单,其中,ReceiverOptions>()
                {
                    新ReceiverOptions()
                    {
                        接收器=新ReceiverIdentifier()
                        {
                            电子邮件=receiver@mail.com
                        },
                        说明=发票测试,
                        invoiceData =新InvoiceData()
                        {
                            项目=新的名单,其中,InvoiceItem>()
                            {
                                新InvoiceItem()
                                {
                                    标识符=1,
                                    ItemCount中= 2,
                                    ITEMPRICE =(十进制)100.0,
                                    NAME =测试,
                                    价格=(十进制)150.0
                                },
                                新InvoiceItem()
                                {
                                    标识符=2,
                                    ItemCount中= 1,
                                    ITEMPRICE =(十进制)100.0,
                                    NAME =测试2,
                                    价格=(十进制)150.15
                                }
                            },
                            totalShipping = 0,
                            totalTax = 0
                        }
                    }
                };

            SetPaymentOptionsResponse R = service.SetPaymentOptions(payOptionsReq);

            // ....
        }
 

解决方案

我使用的嵌入式结账自适应链接付款。

在使用自适应付款,你不能自定义付款页面超出你已经做了。

我对这个话题很是花了很多时间在电话中与贝宝。您在付款选项设置SenderOptions,ReceiverOptions和InvoiceData信息仅适用于即时付款通知可用。好消息是,IPN很容易实现。

http://www.$c$cproject.com/Tips/84538/Setting-up-PayPal-Instant-Payment-Notification-IPN

您可以解析IPN信息,并发送电子邮件到你的买家和卖家。

如果你想 PayPal的的电子邮件,包括任何其他信息,您仅限于PaymentRequest的备注字段。在您的例子:

  reqPay.sender =新SenderIdentifier();
reqPay.sender.email =sender@mail.com;
串备忘录=条目:+ ITEM_NAME ++ item_price + SOME_NONSENSE_DELIMITER;
requestPay.memo =备忘录;
PayResponse responsePay = service.Pay(reqPay);
 

SOME_NONSENSE_DELIMITER是需要充当结束的线,因为,不幸的是,换行和H​​TML被忽略,但至少一些显示在PayPal的对应于接收器的方式。

I'm working with Adaptive Payments using PayPal SDK for .Net. I'm trying to use SetPaymentOptions method to set the items I wish to display in the Payment Summary section, however, when I redirect the site to the sandbox approval page using the pay key I received from the Pay method, the payment summary only shows one row that says "faciliator account's Test Store" and the total amount.

The response returns a success code, plus I see that other parameters, such as BuisnessName (in DisplayOptions) are showing up on the page.

Following is the code I'm trying to execute (the parameters are replaced by real values that map to actual accounts, urls, amounts, etc.). Can anybody tell me what I'm doing wrong?

Thanks!

        AdaptivePaymentsService service = new AdaptivePaymentsService();
        RequestEnvelope envelopeRequest = new RequestEnvelope();
        envelopeRequest.errorLanguage = "en_US";

        List<Receiver> listReceiver = new List<Receiver>();
        Receiver receive = new Receiver((decimal)300.15);
        receive.email = "receiver@mail.com";
        listReceiver.Add(receive);
        ReceiverList listOfReceivers = new ReceiverList(listReceiver);

        PayRequest reqPay = new PayRequest(envelopeRequest, "CREATE", "url",
            "USD", listOfReceivers, "url");
        reqPay.sender = new SenderIdentifier();
        reqPay.sender.email = "sender@mail.com";

        PayResponse responsePay = service.Pay(reqPay);

        if (responsePay != null && responsePay.responseEnvelope.ack.ToString().Trim().ToUpper().Equals("SUCCESS"))
        {
            SetPaymentOptionsRequest payOptionsReq = new SetPaymentOptionsRequest();
            payOptionsReq.displayOptions = new DisplayOptions()
            {
                businessName = "My business name"
            };
            payOptionsReq.payKey = responsePay.payKey;
            payOptionsReq.requestEnvelope = envelopeRequest;
            payOptionsReq.receiverOptions = new List<ReceiverOptions>()
                {
                    new ReceiverOptions()
                    {
                        receiver = new ReceiverIdentifier()
                        {
                            email = "receiver@mail.com"
                        },
                        description = "invoice test",
                        invoiceData = new InvoiceData()
                        {
                            item = new List<InvoiceItem>()
                            {
                                new InvoiceItem()
                                {
                                    identifier = "1",
                                    itemCount = 2,
                                    itemPrice = (decimal)100.0,
                                    name = "test",
                                    price = (decimal)150.0
                                },
                                new InvoiceItem()
                                {
                                    identifier = "2",
                                    itemCount = 1,
                                    itemPrice = (decimal)100.0,
                                    name = "test2",
                                    price = (decimal)150.15
                                }
                            },
                            totalShipping = 0,
                            totalTax = 0
                        }
                    }
                };

            SetPaymentOptionsResponse r = service.SetPaymentOptions(payOptionsReq);

            // ....
        }

解决方案

I am using adaptive chained payments with embedded checkout.

When using adaptive payments, you cannot customize payment pages beyond what you have already done.

I have spent quite a lot of time on the phone with PayPal on this topic. SenderOptions, ReceiverOptions and InvoiceData information that you set in Payment Options are only available in Instant Payment Notifications. The good news is that IPN is easy to implement.

http://www.codeproject.com/Tips/84538/Setting-up-PayPal-Instant-Payment-Notification-IPN

You can parse the IPN info and send emails to your buyer and seller.

If you want PayPal's emails to include any additional information, you are limited to the memo field of the PaymentRequest. In your example:

reqPay.sender = new SenderIdentifier();
reqPay.sender.email = "sender@mail.com";
string memo = "Item: " + item_name + " " + item_price + SOME_NONSENSE_DELIMITER;
requestPay.memo = memo;
PayResponse responsePay = service.Pay(reqPay);

SOME_NONSENSE_DELIMITER is needed to act as an end-of-line because, unfortunately, line feeds and html are ignored, but at least something shows up in PayPal's correspondence to the receiver that way.

这篇关于贝宝 - 支付综述不显示被SetPaymentOptions设置项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆