当前位置: 首页>>代码示例>>Java>>正文


Java Account.getId方法代码示例

本文整理汇总了Java中org.killbill.billing.account.api.Account.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Account.getId方法的具体用法?Java Account.getId怎么用?Java Account.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.killbill.billing.account.api.Account的用法示例。


在下文中一共展示了Account.getId方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createInvoiceItem

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public static InvoiceItem createInvoiceItem(Account account, Invoice invoice,
        InvoiceItemType type, String planName, DateTime createdDate, LocalDate startDate,
        LocalDate endDate, BigDecimal amount, Currency currency) {
    UUID id = UUID.randomUUID();
    UUID accountId = account.getId();
    UUID invoiceId = invoice.getId();
    InvoiceItem item = Mockito.mock(InvoiceItem.class,
            Mockito.withSettings().defaultAnswer(RETURNS_SMART_NULLS.get()));
    when(item.getId()).thenReturn(id);
    when(item.getAccountId()).thenReturn(accountId);
    when(item.getCreatedDate()).thenReturn(createdDate);
    when(item.getCurrency()).thenReturn(currency);
    when(item.getAmount()).thenReturn(amount);
    when(item.getInvoiceId()).thenReturn(invoiceId);
    when(item.getInvoiceItemType()).thenReturn(type);
    when(item.getPlanName()).thenReturn(planName);
    when(item.getStartDate()).thenReturn(startDate);
    when(item.getEndDate()).thenReturn(endDate);
    return item;
}
 
开发者ID:SolarNetwork,项目名称:killbill-easytax-plugin,代码行数:21,代码来源:EasyTaxTestUtils.java

示例2: shouldSupportNullListOfCustomFields

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
@Test(groups = "fast")
public void shouldSupportNullListOfCustomFields() throws Exception {
    // Given
    Account accountWithNullCustomFields = createAccount(FR);
    UUID accountId = accountWithNullCustomFields.getId();
    when(accountUserApi.getAccountById(accountId, context)).thenReturn(accountWithNullCustomFields);

    Invoice invoice = new InvoiceBuilder(accountWithNullCustomFields)//
            .withItem(new InvoiceItemBuilder().withType(RECURRING).withAmount(SIX)).build();

    when(invoiceUserApi.getInvoicesByAccount(accountId, context))//
            .thenReturn(asList(invoice));
    when(customFieldUserApi.getCustomFieldsForAccountType(accountId, INVOICE_ITEM, context))//
            .thenReturn(null);

    // When
    List<InvoiceItem> items = plugin.getAdditionalInvoiceItems(invoice, properties, context);

    // Then
    assertEquals(items.size(), 0);
}
 
开发者ID:bgandon,项目名称:killbill-simple-tax-plugin,代码行数:22,代码来源:TestSimpleTaxPlugin.java

示例3: shouldAllowEmptyListOfCustomFields

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
@Test(groups = "fast")
public void shouldAllowEmptyListOfCustomFields() throws Exception {
    // Given
    Account accountNoCustomFields = createAccount(FR);
    UUID accountId = accountNoCustomFields.getId();
    when(accountUserApi.getAccountById(accountId, context)).thenReturn(accountNoCustomFields);

    Invoice invoice = new InvoiceBuilder(accountNoCustomFields)//
            .withItem(new InvoiceItemBuilder().withType(RECURRING).withAmount(SIX)).build();

    when(invoiceUserApi.getInvoicesByAccount(accountId, context))//
            .thenReturn(asList(invoice));
    when(customFieldUserApi.getCustomFieldsForAccountType(accountId, INVOICE_ITEM, context))//
            .thenReturn(ImmutableList.<CustomField> of());

    // When
    List<InvoiceItem> items = plugin.getAdditionalInvoiceItems(invoice, properties, context);

    // Then
    assertEquals(items.size(), 0);
}
 
开发者ID:bgandon,项目名称:killbill-simple-tax-plugin,代码行数:22,代码来源:TestSimpleTaxPlugin.java

示例4: shouldAllowNonTaxRelatedCustomFields

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
@Test(groups = "fast")
public void shouldAllowNonTaxRelatedCustomFields() throws Exception {
    // Given
    Account accountNonTaxFields = createAccount(FR);
    UUID accountId = accountNonTaxFields.getId();
    when(accountUserApi.getAccountById(accountId, context)).thenReturn(accountNonTaxFields);

    Promise<InvoiceItem> item = holder();
    Invoice invoice = new InvoiceBuilder(accountNonTaxFields)//
            .withItem(new InvoiceItemBuilder().withType(RECURRING).withAmount(SIX).thenSaveTo(item)).build();

    when(invoiceUserApi.getInvoicesByAccount(accountId, context))//
            .thenReturn(asList(invoice));
    when(customFieldUserApi.getCustomFieldsForAccountType(accountId, INVOICE_ITEM, context))//
            .thenReturn(asList(new CustomFieldBuilder()//
                    .withObjectType(INVOICE_ITEM).withObjectId(item.get().getId())//
                    .withFieldName("no-tax-field-name").withFieldValue(VAT_20_0).build()));

    // When
    List<InvoiceItem> items = plugin.getAdditionalInvoiceItems(invoice, properties, context);

    // Then
    assertEquals(items.size(), 0);
}
 
开发者ID:bgandon,项目名称:killbill-simple-tax-plugin,代码行数:25,代码来源:TestSimpleTaxPlugin.java

示例5: BusinessFieldModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessFieldModelDao(final Account account,
                             final Long accountRecordId,
                             final CustomField customField,
                             final Long customFieldRecordId,
                             @Nullable final AuditLog creationAuditLog,
                             final Long tenantRecordId,
                             @Nullable final ReportGroup reportGroup) {
    this(customFieldRecordId,
         customField.getFieldName(),
         customField.getFieldValue(),
         customField.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:22,代码来源:BusinessFieldModelDao.java

示例6: BusinessTagModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessTagModelDao(final Account account,
                           final Long accountRecordId,
                           final Tag tag,
                           final Long tagRecordId,
                           final TagDefinition tagDefinition,
                           @Nullable final AuditLog creationAuditLog,
                           final Long tenantRecordId,
                           @Nullable final ReportGroup reportGroup) {
    this(tagRecordId,
         tagDefinition.getName(),
         tag.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:22,代码来源:BusinessTagModelDao.java

示例7: BusinessAccountTransitionModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessAccountTransitionModelDao(final Account account,
                                         final Long accountRecordId,
                                         final String service,
                                         final String state,
                                         final LocalDate startDate,
                                         final Long blockingStateRecordId,
                                         final LocalDate endDate,
                                         @Nullable final AuditLog creationAuditLog,
                                         final Long tenantRecordId,
                                         @Nullable final ReportGroup reportGroup) {
    this(blockingStateRecordId,
         service,
         state,
         startDate,
         endDate,
         creationAuditLog != null ? creationAuditLog.getCreatedDate() : null,
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:27,代码来源:BusinessAccountTransitionModelDao.java

示例8: withTaxCountryOf

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
private void withTaxCountryOf(String taxCountry, Account account) {
    UUID accountId = account.getId();
    when(
            customFieldService.findFieldByNameAndAccountAndTenant(eq(TAX_COUNTRY_CUSTOM_FIELD_NAME), eq(accountId),
                    any(TenantContext.class)))//
            .thenReturn(new CustomFieldBuilder()//
                    .withObjectType(ACCOUNT)//
                    .withObjectId(accountId)//
                    .withFieldName(TAX_COUNTRY_CUSTOM_FIELD_NAME)//
                    .withFieldValue(taxCountry)//
                    .build());
}
 
开发者ID:bgandon,项目名称:killbill-simple-tax-plugin,代码行数:13,代码来源:TestSimpleTaxPlugin.java

示例9: shouldSurviveNoCustomFieldForTaxCountry

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
@Test(groups = "fast")
public void shouldSurviveNoCustomFieldForTaxCountry() throws Exception {
    // Given
    CallContext context = mock(CallContext.class);
    initCatalogStub();

    Account account = createAccount("ZZ-boom!");
    UUID accountId = account.getId();
    when(
            customFieldService.findFieldByNameAndAccountAndTenant(eq(TAX_COUNTRY_CUSTOM_FIELD_NAME), eq(accountId),
                    any(TenantContext.class)))//
            .thenReturn(null);
    when(accountUserApi.getAccountById(eq(accountId), eq(context))).thenReturn(account);

    Promise<InvoiceItem> taxable = holder();
    Invoice newInvoice = new InvoiceBuilder(account)//
            .withItem(new InvoiceItemBuilder()//
                    .withType(RECURRING).withPlanName("planA").withAmount(SIX)//
                    .withStartDate(lastMonth).withEndDate(today)//
                    .thenSaveTo(taxable))//
            .withItem(new InvoiceItemBuilder()//
                    .withType(ITEM_ADJ).withLinkedItem(taxable).withAmount(ONE.negate()))//
            .build();
    withInvoices(newInvoice);

    // When
    List<InvoiceItem> items = plugin.getAdditionalInvoiceItems(newInvoice, properties, context);

    // Then
    assertEquals(items.size(), 0);

    verify(customFieldUserApi, never()).addCustomFields(anyListOf(CustomField.class), eq(context));
    verifyZeroInteractions(logService);
}
 
开发者ID:bgandon,项目名称:killbill-simple-tax-plugin,代码行数:35,代码来源:TestSimpleTaxPlugin.java

示例10: BusinessBundleModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessBundleModelDao(final Account account,
                              final Long accountRecordId,
                              final SubscriptionBundle bundle,
                              final Long bundleRecordId,
                              final Integer bundleAccountRank,
                              final Boolean latestForBundleExternalKey,
                              final LocalDate chargedThroughDate,
                              final BusinessSubscriptionTransitionModelDao bst,
                              final CurrencyConverter currencyConverter,
                              @Nullable final AuditLog creationAuditLog,
                              final Long tenantRecordId,
                              @Nullable final ReportGroup reportGroup) {
    this(bundleRecordId,
         bundle.getId(),
         bundle.getExternalKey(),
         bst.getSubscriptionId(),
         bundleAccountRank,
         latestForBundleExternalKey,
         chargedThroughDate,
         bst,
         currencyConverter.getConvertedCurrency(),
         bundle.getOriginalCreatedDate(),
         bundle.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:34,代码来源:BusinessBundleModelDao.java

示例11: BusinessInvoiceModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessInvoiceModelDao(final Account account,
                               final Long accountRecordId,
                               final Invoice invoice,
                               final Long invoiceRecordId,
                               final CurrencyConverter currencyConverter,
                               @Nullable final AuditLog creationAuditLog,
                               final Long tenantRecordId,
                               @Nullable final ReportGroup reportGroup) {
    this(invoiceRecordId,
         invoice.getId(),
         invoice.getInvoiceNumber(),
         invoice.getInvoiceDate(),
         invoice.getTargetDate(),
         invoice.getCurrency() == null ? null : invoice.getCurrency().toString(),
         invoice.getBalance(),
         currencyConverter.getConvertedValue(invoice.getBalance(), invoice),
         invoice.getPaidAmount(),
         currencyConverter.getConvertedValue(invoice.getPaidAmount(), invoice),
         invoice.getChargedAmount(),
         currencyConverter.getConvertedValue(invoice.getChargedAmount(), invoice),
         invoice.getOriginalChargedAmount(),
         currencyConverter.getConvertedValue(invoice.getOriginalChargedAmount(), invoice),
         invoice.getCreditedAmount(),
         currencyConverter.getConvertedValue(invoice.getCreditedAmount(), invoice),
         invoice.getRefundedAmount(),
         currencyConverter.getConvertedValue(invoice.getRefundedAmount(), invoice),
         currencyConverter.getConvertedCurrency(),
         invoice.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:39,代码来源:BusinessInvoiceModelDao.java

示例12: BusinessSubscriptionTransitionModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessSubscriptionTransitionModelDao(final Account account,
                                              final Long accountRecordId,
                                              final SubscriptionBundle bundle,
                                              final SubscriptionEvent transition,
                                              final Long subscriptionEventRecordId,
                                              final BusinessSubscriptionEvent event,
                                              @Nullable final BusinessSubscription previousSubscription,
                                              final BusinessSubscription nextSubscription,
                                              final CurrencyConverter currencyConverter,
                                              @Nullable final AuditLog creationAuditLog,
                                              final Long tenantRecordId,
                                              @Nullable final ReportGroup reportGroup) {
    this(subscriptionEventRecordId,
         bundle.getId(),
         bundle.getExternalKey(),
         transition.getEntitlementId(),
         transition.getEffectiveDate(),
         event,
         previousSubscription,
         nextSubscription,
         currencyConverter.getConvertedCurrency(),
         creationAuditLog != null ? creationAuditLog.getCreatedDate() : null,
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:33,代码来源:BusinessSubscriptionTransitionModelDao.java

示例13: BusinessInvoiceItemBaseModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessInvoiceItemBaseModelDao(final Account account,
                                       final Long accountRecordId,
                                       final Invoice invoice,
                                       final InvoiceItem invoiceItem,
                                       @Nullable final ItemSource itemSource,
                                       final Long invoiceItemRecordId,
                                       final Long secondInvoiceItemRecordId,
                                       @Nullable final SubscriptionBundle bundle,
                                       @Nullable final Plan plan,
                                       @Nullable final PlanPhase planPhase,
                                       final CurrencyConverter currencyConverter,
                                       @Nullable final AuditLog creationAuditLog,
                                       final Long tenantRecordId,
                                       @Nullable final ReportGroup reportGroup) {
    this(invoiceItemRecordId,
         secondInvoiceItemRecordId,
         invoiceItem.getId(),
         invoice.getId(),
         invoice.getInvoiceNumber(),
         invoice.getCreatedDate(),
         invoice.getInvoiceDate(),
         invoice.getTargetDate(),
         invoice.getCurrency() == null ? null : invoice.getCurrency().toString(),
         invoice.getBalance(),
         currencyConverter.getConvertedValue(invoice.getBalance(), invoice),
         invoice.getPaidAmount(),
         currencyConverter.getConvertedValue(invoice.getPaidAmount(), invoice),
         invoice.getChargedAmount(),
         currencyConverter.getConvertedValue(invoice.getChargedAmount(), invoice),
         invoice.getOriginalChargedAmount(),
         currencyConverter.getConvertedValue(invoice.getOriginalChargedAmount(), invoice),
         invoice.getCreditedAmount(),
         currencyConverter.getConvertedValue(invoice.getCreditedAmount(), invoice),
         invoice.getRefundedAmount(),
         currencyConverter.getConvertedValue(invoice.getRefundedAmount(), invoice),
         invoiceItem.getInvoiceItemType().toString(),
         itemSource,
         bundle == null ? null : bundle.getId(),
         bundle == null ? null : bundle.getExternalKey(),
         (plan != null && plan.getProduct() != null) ? plan.getProduct().getName() : null,
         (plan != null && plan.getProduct() != null) ? plan.getProduct().getCatalogName() : null,
         (plan != null && plan.getProduct().getCategory() != null) ? plan.getProduct().getCategory().toString() : null,
         planPhase != null ? planPhase.getName() : null,
         invoiceItem.getUsageName(),
         (planPhase != null && planPhase.getPhaseType() != null) ? planPhase.getPhaseType().toString() : null,
         (planPhase != null && planPhase.getRecurring() != null && planPhase.getRecurring().getBillingPeriod() != null) ? planPhase.getRecurring().getBillingPeriod().toString() : null,
         invoiceItem.getStartDate(),
         /* Populate end date for fixed items for convenience (null in invoice_items table) */
         BusinessInvoiceItemUtils.computeServicePeriodEndDate(invoiceItem, planPhase, bundle),
         invoiceItem.getAmount(),
         currencyConverter.getConvertedValue(invoiceItem, invoice),
         invoiceItem.getCurrency() == null ? null : invoiceItem.getCurrency().toString(),
         invoiceItem.getLinkedItemId(),
         currencyConverter.getConvertedCurrency(),
         invoiceItem.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:66,代码来源:BusinessInvoiceItemBaseModelDao.java

示例14: BusinessAccountModelDao

import org.killbill.billing.account.api.Account; //导入方法依赖的package包/类
public BusinessAccountModelDao(final Account account,
                               final Account parentAccount,
                               final Long accountRecordId,
                               final BigDecimal balance,
                               @Nullable final Invoice oldestUnpaidInvoice,
                               @Nullable final Invoice lastInvoice,
                               @Nullable final PaymentTransaction lastCaptureOrPurchaseTransaction,
                               final Integer nbActiveBundles,
                               final CurrencyConverter currencyConverter,
                               @Nullable final AuditLog creationAuditLog,
                               final Long tenantRecordId,
                               @Nullable final ReportGroup reportGroup) {
    this(account.getEmail(),
         account.getFirstNameLength(),
         account.getCurrency() == null ? null : account.getCurrency().toString(),
         account.getBillCycleDayLocal(),
         account.getPaymentMethodId(),
         account.getTimeZone() == null ? null : account.getTimeZone().toString(),
         account.getLocale(),
         account.getAddress1(),
         account.getAddress2(),
         account.getCompanyName(),
         account.getCity(),
         account.getStateOrProvince(),
         account.getCountry(),
         account.getPostalCode(),
         account.getPhone(),
         account.isMigrated(),
         account.isNotifiedForInvoices(),
         account.getUpdatedDate(),
         balance,
         currencyConverter.getConvertedValue(balance, account),
         oldestUnpaidInvoice == null ? null : oldestUnpaidInvoice.getInvoiceDate(),
         oldestUnpaidInvoice == null ? null : oldestUnpaidInvoice.getBalance(),
         oldestUnpaidInvoice == null ? null : oldestUnpaidInvoice.getCurrency().toString(),
         currencyConverter.getConvertedValue(oldestUnpaidInvoice),
         oldestUnpaidInvoice == null ? null : oldestUnpaidInvoice.getId(),
         lastInvoice == null ? null : lastInvoice.getInvoiceDate(),
         lastInvoice == null ? null : lastInvoice.getBalance(),
         lastInvoice == null ? null : lastInvoice.getCurrency().toString(),
         currencyConverter.getConvertedValue(lastInvoice),
         lastInvoice == null ? null : lastInvoice.getId(),
         lastCaptureOrPurchaseTransaction == null ? null : lastCaptureOrPurchaseTransaction.getEffectiveDate(),
         lastCaptureOrPurchaseTransaction == null ? null : lastCaptureOrPurchaseTransaction.getTransactionStatus().toString(),
         nbActiveBundles,
         currencyConverter.getConvertedCurrency(),
         account.getCreatedDate(),
         creationAuditLog != null ? creationAuditLog.getUserName() : null,
         creationAuditLog != null ? creationAuditLog.getReasonCode() : null,
         creationAuditLog != null ? creationAuditLog.getComment() : null,
         account.getId(),
         account.getName(),
         account.getExternalKey(),
         parentAccount != null ? parentAccount.getId() : null,
         parentAccount != null ? parentAccount.getName() : null,
         parentAccount != null ? parentAccount.getExternalKey() : null,
         accountRecordId,
         tenantRecordId,
         reportGroup);
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:61,代码来源:BusinessAccountModelDao.java


注:本文中的org.killbill.billing.account.api.Account.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。