根据有关“测试定期付款”的文档
指定 Day 时,在 Sandbox 中每 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的Recurring Payments。
根据this other forum post,我可能需要为我的沙盒业务帐户启用“测试模式”,但我无法在新的沙盒站点中找到该选项。
我错过了什么?