有没有人可以告诉我如何以连锁支付的方式自动执行延迟付款(假设是在主收款方收到付款后5天)?关键是自动执行,而不必手动审批和支付辅助接收方。请用一些示例代码来说明。
我使用了"actionType“=> "PAY_PRIMARY”,这样主接收者就可以得到钱了。
但是,我如何编码才能让辅助接收器获得资金呢?
发布于 2012-02-26 04:01:11
查看this answer中的解决方案。
发布于 2012-02-15 15:20:36
actionType是PAY_PPRIMARY,然后您触发此付款在90天内。它是延迟的,但没有时间流逝。
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf
发布于 2013-05-23 14:20:22
好吧,也许为时已晚,但它肯定会在未来帮助某些人。由于我们集成了paypal延迟连锁支付,您可以设置一个主帐户,其中所有的金额都将去,您也可以设置辅助帐户,一旦他们通过主帐户持有人的批准,帐户将被转移。
string endpoint = Constants_Common.endpoint + "Pay";
NVPHelper NVPRequest = new NVPHelper();
NVPRequest[SampleNVPConstant.requestEnvelopeerrorLanguage] = "en_US";
//NVPRequest[SampleNVPConstant.Pay2.actionType] = "PAY";
//the above one is for simple adoptive payment payment
NVPRequest[SampleNVPConstant.Pay2.actionType] = "PAY_PRIMARY";
//the above one for deleayed chained payment
NVPRequest[SampleNVPConstant.Pay2.currencyCode] = "USD";
NVPRequest[SampleNVPConstant.Pay2.feesPayer] = "EACHRECEIVER";
NVPRequest[SampleNVPConstant.Pay2.memo] = "XXXXXXXX";现在我们必须设置主接收器和辅助接收器:
//primary account
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveramount_0] = TotalAmount;
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveremail_0] = "XXXx.xxxxx.com";
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiverprimary_0] = "true";
//secondary accounts
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveramount_1] = (somemoney out of total amount);
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveremail_1] = "xxxxx.xxxx.com";
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiverprimary_1] = "false";
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveramount_2] = (somemoney out of total amount);
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiveremail_2] = x.x.com;
NVPRequest[SampleNVPConstant.Pay2.receiverListreceiverprimary_2] = "false";不要忘记,你必须给一个有效的贝宝帐户,同时使用延迟连锁付款。现在你得到了你的pay_key,你必须使用它来执行你的付款在90天内,以便其他次级接收者获得资金。以下是工作代码:
String endpoint = Constants_Common.endpoint + "ExecutePayment";
NVPHelper NVPRequest = new NVPHelper();
//requestEnvelope.errorLanguage is common for all the request
NVPRequest[SampleNVPConstant.requestEnvelopeerrorLanguage] = "en_US";
NVPRequest[SampleNVPConstant.ExecutePayment.payKey] = "your pay key";
string strrequestforNvp = NVPRequest.Encode();
//calling Call method where actuall API call is made, NVP string, header value adne end point are passed as the input.
CallerServices_NVP CallerServices = new CallerServices_NVP();
string stresponsenvp = CallerServices.Call(strrequestforNvp, Constants_Common.headers(), endpoint);
//Response is send to Decoder method where it is decoded to readable hash table
NVPHelper decoder = new NVPHelper();
decoder.Decode(stresponsenvp);
if (decoder != null && decoder["responseEnvelope.ack"].Equals("Success") && decoder["paymentExecStatus"].Equals("COMPLETED"))
{
//do something
}希望它能帮助到一些人。
https://stackoverflow.com/questions/9255585
复制相似问题