use of org.killbill.billing.client.model.Account in project killbill by killbill.
the class KillbillClient method createAccountNoPMBundleAndSubscriptionAndWaitForFirstInvoice.
protected Account createAccountNoPMBundleAndSubscriptionAndWaitForFirstInvoice() throws Exception {
// Create an account with no payment method
final Account accountJson = createAccount();
assertNotNull(accountJson);
// Add a bundle, subscription and move the clock to get the first invoice
final Subscription subscriptionJson = createEntitlement(accountJson.getAccountId(), UUID.randomUUID().toString(), "Shotgun", ProductCategory.BASE, BillingPeriod.MONTHLY, true);
assertNotNull(subscriptionJson);
clock.addMonths(1);
crappyWaitForLackOfProperSynchonization();
return accountJson;
}
use of org.killbill.billing.client.model.Account in project killbill by killbill.
the class KillbillClient method createAccountWithExternalPaymentMethod.
protected Account createAccountWithExternalPaymentMethod() throws Exception {
final Account input = createAccount();
final PaymentMethodPluginDetail info = new PaymentMethodPluginDetail();
final PaymentMethod paymentMethodJson = new PaymentMethod(null, UUIDs.randomUUID().toString(), input.getAccountId(), true, ExternalPaymentProviderPlugin.PLUGIN_NAME, info);
killBillClient.createPaymentMethod(paymentMethodJson, requestOptions);
return killBillClient.getAccount(input.getExternalKey(), requestOptions);
}
use of org.killbill.billing.client.model.Account in project killbill by killbill.
the class KillbillClient method createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoice.
protected Account createAccountWithPMBundleAndSubscriptionAndWaitForFirstInvoice() throws Exception {
final Account accountJson = createAccountWithDefaultPaymentMethod();
assertNotNull(accountJson);
// Add a bundle, subscription and move the clock to get the first invoice
final Subscription subscriptionJson = createEntitlement(accountJson.getAccountId(), UUID.randomUUID().toString(), "Shotgun", ProductCategory.BASE, BillingPeriod.MONTHLY, true);
assertNotNull(subscriptionJson);
clock.addDays(32);
crappyWaitForLackOfProperSynchonization();
return accountJson;
}
use of org.killbill.billing.client.model.Account in project killbill by killbill.
the class KillbillClient method createAccountWithExternalPMBundleAndSubscriptionAndManualPayTagAndWaitForFirstInvoice.
protected Account createAccountWithExternalPMBundleAndSubscriptionAndManualPayTagAndWaitForFirstInvoice() throws Exception {
final Account accountJson = createAccountWithExternalPaymentMethod();
assertNotNull(accountJson);
final Tags accountTag = killBillClient.createAccountTag(accountJson.getAccountId(), ControlTagType.MANUAL_PAY.getId(), requestOptions);
assertNotNull(accountTag);
assertEquals(accountTag.get(0).getTagDefinitionId(), ControlTagType.MANUAL_PAY.getId());
// Add a bundle, subscription and move the clock to get the first invoice
final Subscription subscriptionJson = createEntitlement(accountJson.getAccountId(), UUID.randomUUID().toString(), "Shotgun", ProductCategory.BASE, BillingPeriod.MONTHLY, true);
assertNotNull(subscriptionJson);
clock.addDays(32);
crappyWaitForLackOfProperSynchonization();
return accountJson;
}
use of org.killbill.billing.client.model.Account in project killbill by killbill.
the class TestAccount method testAccountWithBalance.
@Test(groups = "slow", description = "Can retrieve the account balance")
public void testAccountWithBalance() throws Exception {
final Account accountJson = createAccountNoPMBundleAndSubscriptionAndWaitForFirstInvoice();
final Account accountWithBalance = killBillClient.getAccount(accountJson.getAccountId(), true, false, requestOptions);
final BigDecimal accountBalance = accountWithBalance.getAccountBalance();
Assert.assertTrue(accountBalance.compareTo(BigDecimal.ZERO) > 0);
}
Aggregations