Search in sources :

Example 1 with PaymentMethodPluginDetail

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();
}
Also used : Account(org.killbill.billing.client.model.Account) PaymentMethodPluginDetail(org.killbill.billing.client.model.PaymentMethodPluginDetail) PaymentMethod(org.killbill.billing.client.model.PaymentMethod) Subscription(org.killbill.billing.client.model.Subscription) LocalDate(org.joda.time.LocalDate)

Aggregations

LocalDate (org.joda.time.LocalDate)1 Account (org.killbill.billing.client.model.Account)1 PaymentMethod (org.killbill.billing.client.model.PaymentMethod)1 PaymentMethodPluginDetail (org.killbill.billing.client.model.PaymentMethodPluginDetail)1 Subscription (org.killbill.billing.client.model.Subscription)1