【问题标题】:how do I reduce the elapsed time for a billing cycle with PayPal's merchant-sdk-java?如何使用 PayPal 的 Merchant-sdk-java 减少计费周期的经过时间?
【发布时间】:2013-03-12 22:24:01
【问题描述】:

根据有关"Testing Recurring Payments"的文档

当您指定 Day 时,计费周期每 n 分钟发生一次 沙盒,其中n代表频率;

这就是我所做的:

DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:'000Z'");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
RecurringPaymentsProfileDetailsType profileDetails = new RecurringPaymentsProfileDetailsType(df.format(new Date()));

BillingPeriodDetailsType trialPeriod = new BillingPeriodDetailsType(BillingPeriodType.DAY, 1, new BasicAmountType(CurrencyCodeType.USD, "40"));
trialPeriod.setTotalBillingCycles(1);

ScheduleDetailsType scheduleDetails = new ScheduleDetailsType();
scheduleDetails.setPaymentPeriod(new BillingPeriodDetailsType(BillingPeriodType.DAY, 1, new BasicAmountType(CurrencyCodeType.USD, "40")));
scheduleDetails.setDescription(agreementDescription);
scheduleDetails.setTrialPeriod(trialPeriod);

CreateRecurringPaymentsProfileRequestDetailsType reqDetails = new CreateRecurringPaymentsProfileRequestDetailsType(profileDetails, scheduleDetails);
reqDetails.setToken(token);

CreateRecurringPaymentsProfileRequestType reqType = new CreateRecurringPaymentsProfileRequestType();
reqType.setCreateRecurringPaymentsProfileRequestDetails(reqDetails);

CreateRecurringPaymentsProfileReq req = new CreateRecurringPaymentsProfileReq();
req.setCreateRecurringPaymentsProfileRequest(reqType);

return service.createRecurringPaymentsProfile(req);

除了不能加快进程的问题(对我来说是个大问题)之外,这段代码效果很好。没有它,就不可能测试 IPN定期付款

根据这个other forum post,我可能需要为我的沙盒业务帐户启用“测试模式”,但我无法在新的沙盒站点中找到该选项。

我错过了什么?

【问题讨论】:

    标签: paypal paypal-ipn paypal-sandbox


    【解决方案1】:

    不幸的是,这是一项已推出的功能,并在短时间内被删除。您能够测试的唯一方法是将定期付款设置为每天计费。解决此问题的一种方法是创建一个包含您要发送的所有变量的表单帖子,然后让它将数据发布到您的脚本并执行它应该做的事情。你只需要绕过让它验证的逻辑。但是,一旦您完成了所有测试,您就可以返回并运行一些测试以确保您的脚本验证帖子。使用表单将变量发布到您的脚本中,您可以根据需要进行尽可能多的测试,而无需每天等待定期付款结算。

    【讨论】:

    • 哦,太可惜了!不过感谢您的回答。
    猜你喜欢
    • 2015-12-30
    • 1970-01-01
    • 2017-07-12
    • 1970-01-01
    • 2014-06-20
    • 2020-06-05
    • 1970-01-01
    • 2015-10-04
    • 2015-05-22
    相关资源
    最近更新 更多