Tabnine Logo
Account.getPaymentMethodId
Code IndexAdd Tabnine to your IDE (free)

How to use
getPaymentMethodId
method
in
org.killbill.billing.account.api.Account

Best Java code snippets using org.killbill.billing.account.api.Account.getPaymentMethodId (Showing top 20 results out of 315)

origin: killbill/killbill

@Test(groups = "fast", description = "Test if Account constructor can accept null values")
public void testConstructorAcceptsNullValues() throws Exception {
  final AccountData accountData = getNullAccountData();
  final Account account = new DefaultAccount(UUID.randomUUID(), accountData);
  Assert.assertNull(account.getExternalKey());
  Assert.assertNull(account.getEmail());
  Assert.assertNull(account.getName());
  Assert.assertNull(account.getFirstNameLength());
  Assert.assertNull(account.getCurrency());
  Assert.assertEquals(account.getBillCycleDayLocal(), (Integer) 0);
  Assert.assertNull(account.getPaymentMethodId());
  Assert.assertNull(account.getTimeZone());
  Assert.assertNull(account.getLocale());
  Assert.assertNull(account.getAddress1());
  Assert.assertNull(account.getAddress2());
  Assert.assertNull(account.getCompanyName());
  Assert.assertNull(account.getCity());
  Assert.assertNull(account.getStateOrProvince());
  Assert.assertNull(account.getCountry());
  Assert.assertNull(account.getPostalCode());
  Assert.assertNull(account.getPhone());
  Assert.assertNull(account.isMigrated());
}
origin: killbill/killbill

private void checkAccountEquals(final Account finalAccount, final Account delegateAccount) {
  Assert.assertEquals(finalAccount.getExternalKey(), delegateAccount.getExternalKey());
  Assert.assertEquals(finalAccount.getEmail(), delegateAccount.getEmail());
  Assert.assertEquals(finalAccount.getName(), delegateAccount.getName());
  Assert.assertEquals(finalAccount.getFirstNameLength(), delegateAccount.getFirstNameLength());
  Assert.assertEquals(finalAccount.getCurrency(), delegateAccount.getCurrency());
  Assert.assertEquals(finalAccount.getBillCycleDayLocal(), delegateAccount.getBillCycleDayLocal());
  Assert.assertEquals(finalAccount.getPaymentMethodId(), delegateAccount.getPaymentMethodId());
  Assert.assertEquals(finalAccount.getTimeZone(), delegateAccount.getTimeZone());
  Assert.assertEquals(finalAccount.getLocale(), delegateAccount.getLocale());
  Assert.assertEquals(finalAccount.getAddress1(), delegateAccount.getAddress1());
  Assert.assertEquals(finalAccount.getAddress2(), delegateAccount.getAddress2());
  Assert.assertEquals(finalAccount.getCompanyName(), delegateAccount.getCompanyName());
  Assert.assertEquals(finalAccount.getCity(), delegateAccount.getCity());
  Assert.assertEquals(finalAccount.getStateOrProvince(), delegateAccount.getStateOrProvince());
  Assert.assertEquals(finalAccount.getCountry(), delegateAccount.getCountry());
  Assert.assertEquals(finalAccount.getPostalCode(), delegateAccount.getPostalCode());
  Assert.assertEquals(finalAccount.getPhone(), delegateAccount.getPhone());
  Assert.assertEquals(finalAccount.getNotes(), delegateAccount.getNotes());
  Assert.assertEquals(finalAccount.isMigrated(), delegateAccount.isMigrated());
}
origin: killbill/killbill

Assert.assertEquals(updatedAccount2.getCurrency(), updatedAccount1.getCurrency());
Assert.assertEquals(updatedAccount2.getBillCycleDayLocal(), updatedAccount1.getBillCycleDayLocal());
Assert.assertEquals(updatedAccount2.getPaymentMethodId(), updatedAccount1.getPaymentMethodId());
Assert.assertEquals(updatedAccount2.getTimeZone(), updatedAccount1.getTimeZone());
Assert.assertEquals(updatedAccount2.getLocale(), updatedAccount1.getLocale());
origin: killbill/killbill

Assert.assertEquals(retrievedAccount.getBillCycleDayLocal(), account.getBillCycleDayLocal());
Assert.assertEquals(retrievedAccount.getCurrency(), account.getCurrency());
Assert.assertEquals(retrievedAccount.getPaymentMethodId(), account.getPaymentMethodId());
Assert.assertEquals(retrievedAccount.getTimeZone(), account.getTimeZone());
Assert.assertEquals(retrievedAccount.getLocale(), account.getLocale());
origin: killbill/killbill

  accountData.setFirstNameLength(firstNameLength);
accountData.setPaymentMethodId(paymentMethodId != null ? paymentMethodId : currentAccount.getPaymentMethodId());
accountData.setTimeZone(timeZone != null ? timeZone : currentAccount.getTimeZone());
accountData.setLocale(locale != null ? locale : currentAccount.getLocale());
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow", description = "Verify we can make a refund on  payment whose original payment method was deleted. See 694")
public void testRefundAfterDeletedPaymentMethod() throws PaymentApiException {
  final BigDecimal requestedAmount = BigDecimal.TEN;
  final Payment payment = paymentApi.createPurchase(account, account.getPaymentMethodId(), null, requestedAmount, Currency.EUR, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(),
                           ImmutableList.<PluginProperty>of(), callContext);
  paymentApi.deletePaymentMethod(account, account.getPaymentMethodId(), false, true, ImmutableList.<PluginProperty>of(), callContext);
  final Payment newPayment = paymentApi.createRefund(account, payment.getId(),requestedAmount,  Currency.EUR, null, UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext);
  Assert.assertEquals(newPayment.getTransactions().size(), 2);
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testCreatePurchaseWithControlPluginRuntimeException() throws Exception {
  mockPaymentControlProviderPlugin.throwsException(new IllegalStateException());
  final BigDecimal requestedAmount = BigDecimal.TEN;
  final String paymentExternalKey = "pay controle external key";
  final String transactionExternalKey = "txn control external key";
  try {
    paymentApi.createPurchaseWithPaymentControl(
        account, account.getPaymentMethodId(), null, requestedAmount, Currency.AED, null,
        paymentExternalKey, transactionExternalKey, ImmutableList.<PluginProperty>of(), CONTROL_PLUGIN_OPTIONS, callContext);
    fail();
  } catch (PaymentApiException e) {
    assertTrue(e.getCause() instanceof IllegalStateException);
  }
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testCreatePurchasePaymentPluginException() {
  mockPaymentProviderPlugin.makeNextPaymentFailWithException();
  final BigDecimal requestedAmount = BigDecimal.TEN;
  final String paymentExternalKey = "pay external key";
  final String transactionExternalKey = "txn external key";
  try {
    paymentApi.createPurchase(account, account.getPaymentMethodId(), null, requestedAmount, Currency.AED, null,
                 paymentExternalKey, transactionExternalKey, ImmutableList.<PluginProperty>of(), callContext);
    fail();
  } catch (PaymentApiException e) {
    assertTrue(e.getCause() instanceof PaymentPluginApiException);
  }
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testSimpleAuthCaptureWithInvalidPaymentId() throws Exception {
  final BigDecimal requestedAmount = new BigDecimal("80.0091");
  final Payment initialPayment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, account.getCurrency(), null,
                                 UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext);
  try {
    paymentApi.createCapture(account, UUID.randomUUID(), requestedAmount, account.getCurrency(), null, UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext);
    Assert.fail("Expected capture to fail...");
  } catch (final PaymentApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.PAYMENT_NO_SUCH_PAYMENT.getCode());
    final Payment latestPayment = paymentApi.getPayment(initialPayment.getId(), true, false, ImmutableList.<PluginProperty>of(), callContext);
    assertEquals(latestPayment, initialPayment);
  }
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testSimpleAuthCaptureWithInvalidCurrency() throws Exception {
  final BigDecimal requestedAmount = new BigDecimal("80.0091");
  final Payment initialPayment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, account.getCurrency(), null,
                                 UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext);
  try {
    paymentApi.createCapture(account, initialPayment.getId(), requestedAmount, Currency.AMD, null, UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext);
    Assert.fail("Expected capture to fail...");
  } catch (final PaymentApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.PAYMENT_INVALID_PARAMETER.getCode());
    final Payment latestPayment = paymentApi.getPayment(initialPayment.getId(), true, false, ImmutableList.<PluginProperty>of(), callContext);
    assertEquals(latestPayment, initialPayment);
  }
}
origin: org.kill-bill.billing.plugin.java/killbill-base-plugin

  @Override
  public Payment answer(final InvocationOnMock invocation) throws Throwable {
    final List<Payment> payments = paymentApi.getAccountPayments(account.getId(), false, false, ImmutableList.<PluginProperty>of(), (TenantContext) invocation.getArguments()[6]);
    final Payment payment;
    if (payments == null || payments.isEmpty()) {
      payment = buildPayment(account.getId(), account.getPaymentMethodId(), (Currency) invocation.getArguments()[3], killbillApi);
    } else {
      payment = payments.get(payments.size() - 1);
    }
    final PaymentTransaction chargeback = buildPaymentTransaction(payment, TransactionType.CHARGEBACK, (Currency) invocation.getArguments()[3]);
    Mockito.when(chargeback.getTransactionStatus()).thenReturn(TransactionStatus.SUCCESS);
    return payment;
  }
});
origin: org.kill-bill.billing/killbill-payment

@Override
public PriorPaymentControlResult priorCall(final PaymentControlContext paymentControlContext, final Iterable<PluginProperty> properties) throws PaymentControlApiException {
  return new DefaultPriorPaymentControlResult(aborted, account.getPaymentMethodId(), null, null, null, getAdjustedProperties(properties, newPriorCallProperties, removedPriorCallProperties));
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testAddRemovePaymentMethodWithForcedDeletion() throws Exception {
  final Long baseNbRecords = paymentApi.getPaymentMethods(0L, 1000L, false, ImmutableList.<PluginProperty>of(), callContext).getMaxNbRecords();
  Assert.assertEquals(baseNbRecords, (Long) 1L);
  final Account account = testHelper.createTestAccount(UUID.randomUUID().toString(), true);
  final UUID paymentMethodId = account.getPaymentMethodId();
  checkPaymentMethodPagination(paymentMethodId, baseNbRecords + 1, false);
  paymentApi.deletePaymentMethod(account, paymentMethodId, false, true, ImmutableList.<PluginProperty>of(), callContext);
  checkPaymentMethodPagination(paymentMethodId, baseNbRecords, true);
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testAddRemovePaymentMethodWithoutForcedDeletion() throws Exception {
  final Long baseNbRecords = paymentApi.getPaymentMethods(0L, 1000L, false, ImmutableList.<PluginProperty>of(), callContext).getMaxNbRecords();
  Assert.assertEquals(baseNbRecords, (Long) 1L);
  final Account account = testHelper.createTestAccount(UUID.randomUUID().toString(), true);
  final UUID paymentMethodId = account.getPaymentMethodId();
  try {
    paymentApi.deletePaymentMethod(account, paymentMethodId, false, false, ImmutableList.<PluginProperty>of(), callContext);
  } catch (final PaymentApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.PAYMENT_INTERNAL_ERROR.getCode());
  }
  checkPaymentMethodPagination(paymentMethodId, baseNbRecords + 1, false);
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testAddRemovePaymentMethod() throws Exception {
  final Long baseNbRecords = paymentApi.getPaymentMethods(0L, 1000L, false, ImmutableList.<PluginProperty>of(), callContext).getMaxNbRecords();
  Assert.assertEquals(baseNbRecords, (Long) 1L);
  final Account account = testHelper.createTestAccount(UUID.randomUUID().toString(), true);
  final UUID paymentMethodId = account.getPaymentMethodId();
  checkPaymentMethodPagination(paymentMethodId, baseNbRecords + 1, false);
  paymentApi.deletePaymentMethod(account, paymentMethodId, true, false, ImmutableList.<PluginProperty>of(), callContext);
  List<PaymentMethod> paymentMethods = paymentApi.getAccountPaymentMethods(account.getId(), false, false, ImmutableList.<PluginProperty>of(), callContext);
  assertEquals(paymentMethods.size(), 0);
  paymentMethods = paymentApi.getAccountPaymentMethods(account.getId(), true, false, ImmutableList.<PluginProperty>of(), callContext);
  assertEquals(paymentMethods.size(), 1);
  checkPaymentMethodPagination(paymentMethodId, baseNbRecords, true);
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testCreatePurchaseWithTimeout() throws Exception {
  final BigDecimal requestedAmount = BigDecimal.TEN;
  final String paymentExternalKey = "ohhhh";
  final String transactionExternalKey = "naaahhh";
  mockPaymentProviderPlugin.makePluginWaitSomeMilliseconds((int) (paymentConfig.getPaymentPluginTimeout().getMillis() + 100));
  try {
    paymentApi.createPurchase(account, account.getPaymentMethodId(), null, requestedAmount, Currency.AED, null,
                 paymentExternalKey, transactionExternalKey, ImmutableList.<PluginProperty>of(), callContext);
    fail();
  } catch (PaymentApiException e) {
    assertEquals(e.getCode(), ErrorCode.PAYMENT_PLUGIN_TIMEOUT.getCode());
  }
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testSetDefaultPaymentMethodSameAccount() throws Exception {
  final Account account = testHelper.createTestAccount("foo@bar.com", true);
  // Add new payment method
  final UUID newPaymentMethod = paymentMethodProcessor.createOrGetExternalPaymentMethod("pmExternalKey", account, PLUGIN_PROPERTIES, callContext, internalCallContext);
  paymentMethodProcessor.setDefaultPaymentMethod(account, newPaymentMethod, PLUGIN_PROPERTIES, callContext, internalCallContext);
  final Account accountById = accountApi.getAccountById(account.getId(), internalCallContext);
  Assert.assertEquals(accountById.getPaymentMethodId(), newPaymentMethod);
}
origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testRefreshWithNewPaymentMethod() throws Exception {
  final Account account = testHelper.createTestAccount("foo@bar.com", true);
  Assert.assertEquals(getPluginApi().getPaymentMethods(account.getId(), true, PLUGIN_PROPERTIES, callContext).size(), 1);
  final UUID existingPMId = account.getPaymentMethodId();
  // Add new payment in plugin directly
  final UUID newPmId = UUID.randomUUID();
  getPluginApi().addPaymentMethod(account.getId(), newPmId, new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), false, ImmutableList.<PluginProperty>of()), false, PLUGIN_PROPERTIES, callContext);
  // Verify that the refresh does indeed show 2 PMs
  final List<PaymentMethod> methods = paymentMethodProcessor.refreshPaymentMethods(MockPaymentProviderPlugin.PLUGIN_NAME, account, PLUGIN_PROPERTIES, callContext, internalCallContext);
  Assert.assertEquals(methods.size(), 2);
  checkPaymentMethodExistsWithStatus(methods, existingPMId, true);
  checkPaymentMethodExistsWithStatus(methods, newPmId, true);
}
origin: org.kill-bill.billing/killbill-beatrix

@Test(groups = "slow", description = "https://github.com/killbill/killbill/issues/255")
public void testRefundWithDeletedPaymentMethod() throws Exception {
  // delete payment method
  busHandler.pushExpectedEvent(NextEvent.TAG);
  paymentApi.deletePaymentMethod(account, account.getPaymentMethodId(), true, true, new ArrayList<PluginProperty>(), callContext);
  assertListenerStatus();
  // try to create a refund for a payment with its payment method deleted
  busHandler.pushExpectedEvent(NextEvent.PAYMENT);
  paymentApi.createRefund(account, payment.getId(), payment.getPurchasedAmount(), payment.getCurrency(), null,
              UUID.randomUUID().toString(), PLUGIN_PROPERTIES, callContext);
  assertListenerStatus();
}
origin: org.kill-bill.billing/killbill-beatrix

/**
 * ********************************************  ACCOUNT *******************************************************
 */
public void checkAccountCreated(final Account account, final CallContext context) {
  final AccountAuditLogs result = auditUserApi.getAccountAuditLogs(account.getId(), AuditLevel.FULL, context);
  checkAuditLog(ChangeType.INSERT, context, result.getAuditLogsForAccount().get(0), account.getId(), AccountSqlDao.class, true, true);
  // Payment method
  if (account.getPaymentMethodId() != null) {
    checkAuditLog(ChangeType.UPDATE, context, result.getAuditLogsForAccount().get(1), account.getId(), AccountSqlDao.class, true, true);
  }
}
org.killbill.billing.account.apiAccountgetPaymentMethodId

Popular methods of Account

  • getId
  • getExternalKey
  • getTimeZone
  • getEmail
  • getName
  • getCurrency
  • getFirstNameLength
  • getPhone
  • getReferenceTime
  • getBillCycleDayLocal
  • getLocale
  • getParentAccountId
  • getLocale,
  • getParentAccountId,
  • isPaymentDelegatedToParent,
  • getAddress1,
  • getAddress2,
  • getCity,
  • getCompanyName,
  • getCountry,
  • getPostalCode

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Reference (javax.naming)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now