Tabnine Logo
DefaultNoOpPaymentMethodPlugin
Code IndexAdd Tabnine to your IDE (free)

How to use
DefaultNoOpPaymentMethodPlugin
in
com.ning.billing.payment.provider

Best Java code snippets using com.ning.billing.payment.provider.DefaultNoOpPaymentMethodPlugin (Showing top 9 results out of 315)

origin: com.ning.billing/killbill-payment

@Override
public PaymentMethodPlugin getPaymentMethodDetail(final UUID kbAccountId, final UUID kbPaymentMethodId, final TenantContext context) throws PaymentPluginApiException {
  return new DefaultNoOpPaymentMethodPlugin(kbPaymentMethodId, "unknown", false, Collections.<PaymentMethodKVInfo>emptyList());
}
origin: com.ning.billing/killbill-payment

@Override
public void addPaymentMethod(final UUID kbAccountId, final UUID kbPaymentMethodId, final PaymentMethodPlugin paymentMethodProps, final boolean setDefault, final CallContext context) throws PaymentPluginApiException {
  final PaymentMethodPlugin realWithID = new DefaultNoOpPaymentMethodPlugin(kbPaymentMethodId, paymentMethodProps);
  List<PaymentMethodPlugin> pms = paymentMethods.get(kbPaymentMethodId.toString());
  if (pms == null) {
    pms = new LinkedList<PaymentMethodPlugin>();
    paymentMethods.put(kbPaymentMethodId.toString(), pms);
  }
  pms.add(realWithID);
}
origin: com.ning.billing/killbill-payment

public ExternalPaymentProviderPlugin getExternalPaymentProviderPlugin(final Account account, final InternalCallContext context) throws PaymentApiException {
  // Check if this account has already used the external payment plugin
  // If not, it's the first time - add a payment method for it
  if (getExternalPaymentMethod(account, context) == null) {
    final DefaultNoOpPaymentMethodPlugin props = new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), false, ImmutableList.<PaymentMethodKVInfo>of());
    addPaymentMethod(ExternalPaymentProviderPlugin.PLUGIN_NAME, account, false, props, context);
  }
  return (ExternalPaymentProviderPlugin) getPaymentPluginApi(ExternalPaymentProviderPlugin.PLUGIN_NAME);
}
origin: com.ning.billing/killbill-payment

@Test(groups = "fast")
public void testEquals() throws Exception {
  final String externalId = UUID.randomUUID().toString();
  final boolean isDefault = false;
  final List<PaymentMethodKVInfo> props = ImmutableList.<PaymentMethodKVInfo>of(new PaymentMethodKVInfo(UUID.randomUUID().toString(), UUID.randomUUID().toString(), false));
  final DefaultNoOpPaymentMethodPlugin paymentMethod = new DefaultNoOpPaymentMethodPlugin(externalId, isDefault, props);
  Assert.assertEquals(paymentMethod, paymentMethod);
  final DefaultNoOpPaymentMethodPlugin samePaymentMethod = new DefaultNoOpPaymentMethodPlugin(externalId, isDefault, props);
  Assert.assertEquals(samePaymentMethod, paymentMethod);
  final DefaultNoOpPaymentMethodPlugin otherPaymentMethod = new DefaultNoOpPaymentMethodPlugin(externalId, isDefault, ImmutableList.<PaymentMethodKVInfo>of());
  Assert.assertNotEquals(otherPaymentMethod, paymentMethod);
}
origin: com.ning.billing/killbill-payment

@BeforeMethod(groups = "fast")
public void beforeMethod() throws Exception {
  super.beforeMethod();
  final PaymentMethodPlugin paymentMethodInfo = new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), true, null);
  testHelper.addTestPaymentMethod(account, paymentMethodInfo);
}
origin: com.ning.billing/killbill-payment

public Account createTestAccount(final String email, final boolean addPaymentMethod) throws Exception {
  final String name = "First" + UUID.randomUUID().toString() + " " + "Last" + UUID.randomUUID().toString();
  final String externalKey = UUID.randomUUID().toString();
  final Account account = Mockito.mock(Account.class);
  Mockito.when(account.getId()).thenReturn(UUID.randomUUID());
  Mockito.when(account.getExternalKey()).thenReturn(externalKey);
  Mockito.when(account.getName()).thenReturn(name);
  Mockito.when(account.getFirstNameLength()).thenReturn(10);
  Mockito.when(account.getPhone()).thenReturn("123-456-7890");
  Mockito.when(account.getEmail()).thenReturn(email);
  Mockito.when(account.getCurrency()).thenReturn(Currency.USD);
  Mockito.when(account.getBillCycleDayLocal()).thenReturn(1);
  Mockito.when(account.isMigrated()).thenReturn(false);
  Mockito.when(account.isNotifiedForInvoices()).thenReturn(false);
  Mockito.when(AccountApi.getAccountById(Mockito.<UUID>any(), Mockito.<InternalTenantContext>any())).thenReturn(account);
  Mockito.when(AccountApi.getAccountByKey(Mockito.anyString(), Mockito.<InternalTenantContext>any())).thenReturn(account);
  if (addPaymentMethod) {
    final PaymentMethodPlugin pm = new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), true, null);
    addTestPaymentMethod(account, pm);
  }
  return account;
}
origin: com.ning.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, 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.<PaymentMethodKVInfo>of()), false, callContext);
  // Verify that the refresh does indeed show 2 PMs
  final List<PaymentMethod> methods = paymentMethodProcessor.refreshPaymentMethods(MockPaymentProviderPlugin.PLUGIN_NAME, account, internalCallContext);
  Assert.assertEquals(methods.size(), 2);
  checkPaymentMethodExistsWithStatus(methods, existingPMId, true);
  checkPaymentMethodExistsWithStatus(methods, newPmId, true);
}
origin: com.ning.billing/killbill-payment

assertEquals(initDefaultMethod.getId(), account.getPaymentMethodId());
final PaymentMethodPlugin newPaymenrMethod = new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), true, null);
final UUID newPaymentMethodId = paymentApi.addPaymentMethod(MockPaymentProviderPlugin.PLUGIN_NAME, account, true, newPaymenrMethod, callContext);
Mockito.when(account.getPaymentMethodId()).thenReturn(newPaymentMethodId);
origin: com.ning.billing/killbill-payment

@Test(groups = "slow")
public void testRefreshWithDeletedPaymentMethod() throws Exception {
  final Account account = testHelper.createTestAccount("super@bar.com", true);
  Assert.assertEquals(getPluginApi().getPaymentMethods(account.getId(), true, callContext).size(), 1);
  final UUID firstPmId = account.getPaymentMethodId();
  final UUID secondPmId = paymentApi.addPaymentMethod(MockPaymentProviderPlugin.PLUGIN_NAME, account, true, new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), false, null), callContext);
  Assert.assertEquals(getPluginApi().getPaymentMethods(account.getId(), true, callContext).size(), 2);
  Assert.assertEquals(paymentApi.getPaymentMethods(account, false, callContext).size(), 2);
  // Remove second PM from plugin
  getPluginApi().deletePaymentMethod(account.getId(), secondPmId, callContext);
  Assert.assertEquals(getPluginApi().getPaymentMethods(account.getId(), true, callContext).size(), 1);
  Assert.assertEquals(paymentApi.getPaymentMethods(account, false, callContext).size(), 2);
  // Verify that the refresh sees that PM as being deleted now
  final List<PaymentMethod> methods = paymentMethodProcessor.refreshPaymentMethods(MockPaymentProviderPlugin.PLUGIN_NAME, account, internalCallContext);
  Assert.assertEquals(methods.size(), 1);
  checkPaymentMethodExistsWithStatus(methods, firstPmId, true);
  PaymentMethodModelDao deletedPMModel =  paymentDao.getPaymentMethodIncludedDeleted(secondPmId, internalCallContext);
  Assert.assertNotNull(deletedPMModel);
  Assert.assertFalse(deletedPMModel.isActive());
}
com.ning.billing.payment.providerDefaultNoOpPaymentMethodPlugin

Most used methods

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Top plugins for Android Studio
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