谁能告诉我如何以链式付款方式自动执行延迟付款(假设是主要收款人收到付款后的 5 天)?关键是自动执行,无需手动批准和支付二级接收方。请用一些示例代码进行说明。
我使用了“actionType”=>“PAY_PRIMARY”,以便主要接收者获得资金。
但是我如何编码才能让第二个接收者赚钱呢?
检查此答案以获取解决方案。基本上,您只需要在 90 天内执行ExecutePayment
操作即可将付款发送给辅助方。payKey
可能为时已晚,但它肯定会在未来帮助某人。由于我们集成了贝宝延迟链式支付,您可以设置一个主账户,所有金额都将进入,您也可以设置辅助账户,一旦主账户持有人批准,账户将转移到该账户。
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
}
希望它会帮助某人。
actionType 是 PAY_PPRIMARY 您然后在 90 天内触发此付款。它延迟了,但没有过时。
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf