use of org.killbill.billing.client.model.PaymentMethodPluginDetail in project killbill by killbill.
the class TestCache method createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoiceWithInputOptions.
private void createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoiceWithInputOptions(final RequestOptions inputOptions) throws Exception {
Account account = killBillClient.createAccount(getAccount(), inputOptions);
final PaymentMethodPluginDetail info = new PaymentMethodPluginDetail();
info.setProperties(null);
final PaymentMethod paymentMethodJson = new PaymentMethod(null, UUID.randomUUID().toString(), account.getAccountId(), true, PLUGIN_NAME, info);
killBillClient.createPaymentMethod(paymentMethodJson, inputOptions);
final Subscription subscription = new Subscription();
subscription.setAccountId(account.getAccountId());
subscription.setExternalKey(UUID.randomUUID().toString());
subscription.setProductName("Sports");
subscription.setProductCategory(ProductCategory.BASE);
subscription.setBillingPeriod(BillingPeriod.MONTHLY);
subscription.setPriceList(PriceListSet.DEFAULT_PRICELIST_NAME);
clock.resetDeltaFromReality();
clock.setDay(new LocalDate(2013, 3, 1));
final Subscription subscriptionJson = killBillClient.createSubscription(subscription, clock.getUTCToday(), DEFAULT_WAIT_COMPLETION_TIMEOUT_SEC, inputOptions);
assertNotNull(subscriptionJson);
clock.addDays(32);
crappyWaitForLackOfProperSynchonization();
}
Aggregations