Tabnine Logo
DefaultNoOpPaymentMethodPlugin.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using com.ning.billing.payment.provider.DefaultNoOpPaymentMethodPlugin.<init> (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<init>

Popular methods of DefaultNoOpPaymentMethodPlugin

    Popular in Java

    • Finding current android device location
    • compareTo (BigDecimal)
    • getSupportFragmentManager (FragmentActivity)
    • putExtra (Intent)
    • EOFException (java.io)
      Thrown when a program encounters the end of a file or stream during an input operation.
    • HttpURLConnection (java.net)
      An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
    • DateFormat (java.text)
      Formats or parses dates and times.This class provides factories for obtaining instances configured f
    • TreeMap (java.util)
      Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
    • ImageIO (javax.imageio)
    • Loader (org.hibernate.loader)
      Abstract superclass of object loading (and querying) strategies. This class implements useful common
    • Top PhpStorm 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