我的客户不想处理信用卡数据,因此我实施了2个选项,1)带有托管页面的PayPal高级版,以及2)PayPal Pro透明重定向。我可以通过
创建定期付款PayPal要求我向用户提供使用PayPal帐户付款的选项,但是当我将该付款转换为RBP然后让它创建一个事务时,转换失败,结果为7 - 字段格式错误。我注意到创建的RBP没有帐号。
对于选项1,我认为我运气不好?
使用选项2,我使用Payflow.net dll来处理工作正常的EC(参见代码示例)。是否有关于如何使用令牌而不是CC num或BAID创建RBP的代码示例?
...
partner = pageSettings.PageSettings["PayPalPartner"];
vendor = pageSettings.PageSettings["PayPalLogin"];
user = pageSettings.PageSettings["PayPalUser"];
pwd = Utilities.DecryptSettingValue(pageSettings.PageSettings["PayPalPassword"])
UserInfo creds = new UserInfo(user, vendor, partner, pwd);
string url = ConfigurationManager.AppSettings.Get("PayflowLive");
PayflowConnectionData connection = new PayflowConnectionData(url);
ECDoRequest doRequest = new ECDoRequest(token, payerID);
PayPalTender tender = new PayPalTender(doRequest);
Invoice inv = new Invoice();
inv.Amt = new Currency(amount, "USD");
inv.Comment1 = fundName;
SaleTransaction trans = new SaleTransaction(creds, connection, inv, tender, PayflowUtility.RequestId);
Response resp = trans.SubmitTransaction();
答案 0 :(得分:2)
我没有代码,但我可以指导您如何使用PayPal付款创建定期个人资料。它包括四个步骤:
<强> 1。调用SetExpressCheckout API
VENDOR=XXXXXXX&PARTNER=XXXXXXX&USER=XXXXXXXXX&PWD=XXXXXX&TRXTYPE=A&ACTION=S&TENDER=P&RETURNURL=http://return.com&CANCELURL=http://cancel.com&AMT=0.00&BA_DESC=purchase Time magazine&BILLINGTYPE=MerchantInitiatedBilling&PAYMENTTYPE=any&BA_CUSTOM=magazine subscription
NVP Response:
RESULT=0
RESPMSG=Verified
TOKEN=EC-8DA60888D41196708
CORRELATIONID=f4df94a3345b6
2.使用生成的令牌重定向客户:
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-8DA60888D41196708
第3。买方接受协议后,请使用令牌获取结算协议ID
NVP Request:
VENDOR=XXXXXX&PARTNER=XXXXXXX&USER=XXXXXXXX&PWD=XXXXX&TRXTYPE=A&ACTION=X&TENDER=P&TOKEN=EC-8DA60888D41196708
NVP Response:
RESULT=0
PNREF=B1PP7A2F8154
RESPMSG=Approved
TOKEN=EC-8DA60888D41196708
CORRELATIONID=49d6b0037408
BAID=B-6A290557S1180001J
<强> 4。获得BAID后,拨打电话以使用BAID
创建定期结算NVP Request:
VENDOR=XXXX&PARTNER=XXXX&USER=XXXXXX&PWD=XXXXX&TRXTYPE=R&TENDER=P&ACTION=A&PROFILENAME=RegularSubscription&AMT=4.46&BAID=B-6A290557S1180001J&START=09212014&PAYPERIOD=WEEK&TERM=12&MAXFAILPAYMENTS=1&RETRYNUMDAYS=1&CURRENCY=USD
NVP Response:
RESULT=0
RPREF=R1P57A2F8538
PROFILEID=RT0000000010
RESPMSG=Approved