首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >延迟连锁付款

延迟连锁付款
EN

Stack Overflow用户
提问于 2012-02-13 12:24:05
回答 3查看 2.7K关注 0票数 1

有没有人可以告诉我如何以连锁支付的方式自动执行延迟付款(假设是在主收款方收到付款后5天)?关键是自动执行,而不必手动审批和支付辅助接收方。请用一些示例代码来说明。

我使用了"actionType“=> "PAY_PRIMARY”,这样主接收者就可以得到钱了。

但是,我如何编码才能让辅助接收器获得资金呢?

EN

回答 3

Stack Overflow用户

发布于 2012-02-26 04:01:11

查看this answer中的解决方案。

票数 2
EN

Stack Overflow用户

发布于 2012-02-15 15:20:36

actionType是PAY_PPRIMARY,然后您触发此付款在90天内。它是延迟的,但没有时间流逝。

https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf

票数 0
EN

Stack Overflow用户

发布于 2013-05-23 14:20:22

好吧,也许为时已晚,但它肯定会在未来帮助某些人。由于我们集成了paypal延迟连锁支付,您可以设置一个主帐户,其中所有的金额都将去,您也可以设置辅助帐户,一旦他们通过主帐户持有人的批准,帐户将被转移。

代码语言:javascript
复制
    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";

现在我们必须设置主接收器和辅助接收器:

代码语言:javascript
复制
    //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天内,以便其他次级接收者获得资金。以下是工作代码:

代码语言:javascript
复制
    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
    }

希望它能帮助到一些人。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9255585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档