@Override public List<Payment> call() throws Exception { return paymentApi.getAccountPayments(accountId, false, false, ImmutableList.<PluginProperty>of(), tenantContext); } };
@TimedResource @GET @Path("/{paymentId:" + UUID_PATTERN + "}/" + TAGS) @Produces(APPLICATION_JSON) @ApiOperation(value = "Retrieve payment payment tags", response = TagJson.class, responseContainer = "List", nickname = "getPaymentTags") @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment id supplied"), @ApiResponse(code = 404, message = "Invoice not found")}) public Response getTags(@PathParam(ID_PARAM_NAME) final UUID paymentId, @QueryParam(QUERY_TAGS_INCLUDED_DELETED) @DefaultValue("false") final Boolean includedDeleted, @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode, @javax.ws.rs.core.Context final HttpServletRequest request) throws TagDefinitionApiException, PaymentApiException { final TenantContext tenantContext = context.createTenantContextNoAccountId(request); final Payment payment = paymentApi.getPayment(paymentId, false, false, ImmutableList.<PluginProperty>of(), tenantContext); return super.getTags(payment.getAccountId(), paymentId, auditMode, includedDeleted, tenantContext); }
case AUTHORIZE: if (paymentOptions == null) { createdPayment = osgiKillbillAPI.getPaymentApi().createAuthorization(account, kbPaymentMethodId, kbPaymentId, context); } else { createdPayment = osgiKillbillAPI.getPaymentApi().createAuthorizationWithPaymentControl(account, kbPaymentMethodId, kbPaymentId, case CAPTURE: if (paymentOptions == null) { createdPayment = osgiKillbillAPI.getPaymentApi().createCapture(account, kbPaymentId, amount, createdPayment = osgiKillbillAPI.getPaymentApi().createCaptureWithPaymentControl(account, kbPaymentId, amount, case CHARGEBACK: if (paymentOptions == null) { createdPayment = osgiKillbillAPI.getPaymentApi().createChargeback(account, kbPaymentId, amount, context);
protected Payment getPaymentByIdOrKey(@Nullable final UUID paymentId, @Nullable final String externalKey, final Iterable<PluginProperty> pluginProperties, final TenantContext tenantContext) throws PaymentApiException { Preconditions.checkArgument(paymentId != null || externalKey != null, "Need to set either paymentId or payment externalKey"); if (paymentId != null) { return paymentApi.getPayment(paymentId, false, false, pluginProperties, tenantContext); } else { return paymentApi.getPaymentByExternalKey(externalKey, false, false, pluginProperties, tenantContext); } }
@TimedResource @DELETE @Produces(APPLICATION_JSON) @Path("/{paymentMethodId:" + UUID_PATTERN + "}") @ApiOperation(value = "Delete a payment method") @ApiResponses(value = {@ApiResponse(code = 204, message = "Successful operation"), @ApiResponse(code = 400, message = "Invalid paymentMethodId supplied"), @ApiResponse(code = 404, message = "Account or payment method not found")}) public Response deletePaymentMethod(@PathParam("paymentMethodId") final UUID paymentMethodId, @QueryParam(QUERY_DELETE_DEFAULT_PM_WITH_AUTO_PAY_OFF) @DefaultValue("false") final Boolean deleteDefaultPaymentMethodWithAutoPayOff, @QueryParam(QUERY_FORCE_DEFAULT_PM_DELETION) @DefaultValue("false") final Boolean forceDefaultPaymentMethodDeletion, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws PaymentApiException, AccountApiException { final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request); final PaymentMethod paymentMethod = paymentApi.getPaymentMethodById(paymentMethodId, false, false, pluginProperties, callContext); final Account account = accountUserApi.getAccountById(paymentMethod.getAccountId(), callContext); paymentApi.deletePaymentMethod(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, forceDefaultPaymentMethodDeletion, pluginProperties, callContext); return Response.status(Status.NO_CONTENT).build(); }
final BigDecimal requestedAmount = BigDecimal.TEN; Payment payment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, Currency.USD, null,UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); final Iterable<PluginProperty> pendingPluginProperties = ImmutableList.<PluginProperty>of(new PluginProperty(MockPaymentProviderPlugin.PLUGIN_PROPERTY_PAYMENT_PLUGIN_STATUS_OVERRIDE, PaymentPluginStatus.PENDING, false)); payment = paymentApi.createCaptureWithPaymentControl(account, payment.getId(), requestedAmount, payment.getCurrency(), null,paymentTransactionExternalKey, pendingPluginProperties, PAYMENT_OPTIONS, callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); Currency.USD); payment = paymentApi.createCapture(account, payment.getId(), requestedAmount, payment.getCurrency(), null,paymentTransactionExternalKey, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); Assert.assertEquals(payment.getCapturedAmount().compareTo(requestedAmount), 0);
switch (pendingTransaction.getTransactionType()) { case AUTHORIZE: paymentApi.createAuthorizationWithPaymentControl(account, initialPayment.getPaymentMethodId(), initialPayment.getId(), amount, currency, null, initialPayment.getExternalKey(), pendingTransaction.getExternalKey(), pluginProperties, paymentOptions, callContext); break; case CAPTURE: paymentApi.createCaptureWithPaymentControl(account, initialPayment.getId(), amount, currency, null, pendingTransaction.getExternalKey(), pluginProperties, paymentOptions, callContext); break; case PURCHASE: paymentApi.createPurchaseWithPaymentControl(account, initialPayment.getPaymentMethodId(), initialPayment.getId(), amount, currency, null, initialPayment.getExternalKey(), pendingTransaction.getExternalKey(), pluginProperties, paymentOptions, callContext); break; case CREDIT: paymentApi.createCreditWithPaymentControl(account, initialPayment.getPaymentMethodId(), initialPayment.getId(), amount, currency, null, initialPayment.getExternalKey(), pendingTransaction.getExternalKey(), pluginProperties, paymentOptions, callContext); break; case REFUND: paymentApi.createRefundWithPaymentControl(account, initialPayment.getId(), amount, currency, null, pendingTransaction.getExternalKey(), pluginProperties, paymentOptions, callContext); break;
@Test(groups = "slow") public void testAuthSuccessWithPaymentControlNullPaymentMethodId() throws Exception { final AccountData accountData = getAccountData(1); final Account account = accountUserApi.createAccount(accountData, callContext); // Add non-default payment method final PaymentMethodPlugin info = createPaymentMethodPlugin(); final UUID paymentMethodId = paymentApi.addPaymentMethod(account, UUID.randomUUID().toString(), BeatrixIntegrationModule.NON_OSGI_PLUGIN_NAME, false, info, PLUGIN_PROPERTIES, callContext); testPaymentControlWithControl.setAdjustedPaymentMethodId(paymentMethodId); busHandler.pushExpectedEvents(NextEvent.PAYMENT); final Payment payment = paymentApi.createAuthorizationWithPaymentControl(account, null, null, BigDecimal.ONE, account.getCurrency(), null, null, null, properties, paymentOptions, callContext); assertListenerStatus(); final Payment paymentWithAttempts = paymentApi.getPayment(payment.getId(), false, true, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentWithAttempts.getPaymentMethodId(), paymentMethodId); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().size(), 1); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().get(0).getPaymentMethodId(), paymentMethodId); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().get(0).getStateName(), "SUCCESS"); }
@Test(groups = "slow") public void testUnknownEntries() throws PaymentApiException, InvoiceApiException, EventBusException { final BigDecimal requestedAmount = BigDecimal.TEN; final String paymentExternalKey = "qwru"; final String transactionExternalKey = "lkjdsf"; testListener.pushExpectedEvent(NextEvent.PAYMENT); final Payment payment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, account.getCurrency(), null, paymentExternalKey, transactionExternalKey, ImmutableList.<PluginProperty>of(), callContext); testListener.assertListenerStatus(); // Artificially move the transaction status to UNKNOWN final String paymentStateName = paymentSMHelper.getErroredStateForTransaction(TransactionType.AUTHORIZE).toString(); testListener.pushExpectedEvent(NextEvent.PAYMENT_PLUGIN_ERROR); paymentDao.updatePaymentAndTransactionOnCompletion(account.getId(), null, payment.getId(), TransactionType.AUTHORIZE, paymentStateName, paymentStateName, payment.getTransactions().get(0).getId(), TransactionStatus.UNKNOWN, requestedAmount, account.getCurrency(), "foo", "bar", internalCallContext); testListener.assertListenerStatus(); // Move clock for notification to be processed testListener.pushExpectedEvent(NextEvent.PAYMENT); clock.addDeltaFromReality(5 * 60 * 1000); assertNotificationsCompleted(internalCallContext, 5); testListener.assertListenerStatus(); final Payment updatedPayment = paymentApi.getPayment(payment.getId(), false, false, ImmutableList.<PluginProperty>of(), callContext); assertEquals(updatedPayment.getTransactions().get(0).getTransactionStatus(), TransactionStatus.SUCCESS); }
final Payment initialPayment = paymentApi.getPayment(paymentId, false, false, pluginProperties, callContext); final PaymentTransaction pendingOrSuccessTransaction = lookupPendingOrSuccessTransaction(initialPayment, json != null ? json.getTransactionId() : null, switch (transactionType) { case AUTHORIZE: result = paymentApi.createAuthorizationWithPaymentControl(account, paymentMethodId, paymentId, json.getAmount(), currency, json.getEffectiveDate(), json.getPaymentExternalKey(), json.getTransactionExternalKey(), pluginProperties, paymentOptions, callContext); break; case PURCHASE: result = paymentApi.createPurchaseWithPaymentControl(account, paymentMethodId, paymentId, json.getAmount(), currency, json.getEffectiveDate(), json.getPaymentExternalKey(), json.getTransactionExternalKey(), pluginProperties, paymentOptions, callContext); break; case CREDIT: result = paymentApi.createCreditWithPaymentControl(account, paymentMethodId, paymentId, json.getAmount(), currency, json.getEffectiveDate(), json.getPaymentExternalKey(), json.getTransactionExternalKey(), pluginProperties, paymentOptions, callContext);
@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); } }
public static Payment buildPayment(final UUID accountId, final UUID paymentMethodId, final UUID paymentId, final Currency currency, final String paymentExternalKey, @Nullable final OSGIKillbill killbillApi) throws PaymentApiException { final Payment payment = Mockito.mock(Payment.class); Mockito.when(payment.getId()).thenReturn(paymentId); Mockito.when(payment.getExternalKey()).thenReturn(paymentExternalKey); Mockito.when(payment.getAccountId()).thenReturn(accountId); Mockito.when(payment.getPaymentMethodId()).thenReturn(paymentMethodId); Mockito.when(payment.getPaymentNumber()).thenReturn(1); Mockito.when(payment.getCapturedAmount()).thenReturn(new BigDecimal("199999")); Mockito.when(payment.getRefundedAmount()).thenReturn(new BigDecimal("199998")); Mockito.when(payment.getCurrency()).thenReturn(currency); Mockito.when(payment.getTransactions()).thenReturn(new LinkedList<PaymentTransaction>()); Mockito.when(payment.getCreatedDate()).thenReturn(new DateTime(2016, 1, 22, 10, 56, 56, DateTimeZone.UTC)); if (killbillApi != null) { Mockito.when(killbillApi.getPaymentApi().getPayment(Mockito.eq(payment.getId()), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.<Iterable<PluginProperty>>any(), Mockito.<TenantContext>any())).thenReturn(payment); final List<Payment> payments = MoreObjects.firstNonNull(killbillApi.getPaymentApi().getAccountPayments(accountId, false, false, ImmutableList.<PluginProperty>of(), Mockito.mock(TenantContext.class)), new LinkedList<Payment>()); payments.add(payment); Mockito.when(killbillApi.getPaymentApi().getAccountPayments(Mockito.eq(accountId), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.<Iterable<PluginProperty>>any(), Mockito.<TenantContext>any())).thenReturn(payments); } return payment; }
@Test(groups = "slow") public void testCreateAuthPendingWithControlCompleteNoControl() throws PaymentApiException { final String paymentTransactionExternalKey = UUID.randomUUID().toString(); final BigDecimal requestedAmount = BigDecimal.TEN; final Iterable<PluginProperty> pendingPluginProperties = ImmutableList.<PluginProperty>of(new PluginProperty(MockPaymentProviderPlugin.PLUGIN_PROPERTY_PAYMENT_PLUGIN_STATUS_OVERRIDE, PaymentPluginStatus.PENDING, false)); Payment payment = paymentApi.createAuthorizationWithPaymentControl(account, account.getPaymentMethodId(), null, requestedAmount, Currency.USD, null,UUID.randomUUID().toString(), paymentTransactionExternalKey, pendingPluginProperties, PAYMENT_OPTIONS, callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(BigDecimal.ZERO), 0); Assert.assertEquals(payment.getCapturedAmount().compareTo(BigDecimal.ZERO), 0); Assert.assertEquals(payment.getTransactions().size(), 1); Assert.assertNotNull(((DefaultPaymentTransaction) payment.getTransactions().get(0)).getAttemptId()); verifyOnSuccess(payment.getId(), payment.getExternalKey(), payment.getTransactions().get(0).getId(), payment.getTransactions().get(0).getExternalKey(), requestedAmount, Currency.USD); payment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), payment.getId(), requestedAmount, payment.getCurrency(), null,payment.getExternalKey(), payment.getTransactions().get(0).getExternalKey(), ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); Assert.assertEquals(payment.getCapturedAmount().compareTo(BigDecimal.ZERO), 0); Assert.assertEquals(payment.getTransactions().size(), 1); Assert.assertNotNull(((DefaultPaymentTransaction) payment.getTransactions().get(0)).getAttemptId()); Assert.assertEquals(payment.getTransactions().get(0).getExternalKey(), paymentTransactionExternalKey); }
@Test(groups = "slow") public void testAuthCaptureWithPaymentControl() throws Exception { final AccountData accountData = getAccountData(1); final Account account = createAccountWithNonOsgiPaymentMethod(accountData); busHandler.pushExpectedEvents(NextEvent.PAYMENT); final Payment payment = paymentApi.createAuthorizationWithPaymentControl(account, account.getPaymentMethodId(), null, BigDecimal.ONE, account.getCurrency(), null, null, null, properties, paymentOptions, callContext); assertListenerStatus(); Payment paymentWithAttempts = paymentApi.getPayment(payment.getId(), false, true, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().size(), 1); Assert.assertEquals(paymentWithAttempts.getExternalKey(), paymentWithAttempts.getPaymentAttempts().get(0).getPaymentExternalKey()); Assert.assertEquals(paymentWithAttempts.getTransactions().get(0).getExternalKey(), paymentWithAttempts.getPaymentAttempts().get(0).getTransactionExternalKey()); // Verify fix for https://github.com/killbill/killbill/issues/349 when no external key is set Assert.assertEquals(paymentWithAttempts.getId().toString(), paymentWithAttempts.getPaymentAttempts().get(0).getPaymentExternalKey()); Assert.assertEquals(paymentWithAttempts.getTransactions().get(0).getId().toString(), paymentWithAttempts.getPaymentAttempts().get(0).getTransactionExternalKey()); busHandler.pushExpectedEvents(NextEvent.PAYMENT); paymentApi.createCaptureWithPaymentControl(account, payment.getId(), BigDecimal.ONE, account.getCurrency(), null, null, properties, paymentOptions, callContext); assertListenerStatus(); paymentWithAttempts = paymentApi.getPayment(payment.getId(), false, true, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().size(), 2); Assert.assertEquals(paymentWithAttempts.getTransactions().get(1).getExternalKey(), paymentWithAttempts.getPaymentAttempts().get(1).getTransactionExternalKey()); Assert.assertEquals(paymentWithAttempts.getTransactions().get(1).getId().toString(), paymentWithAttempts.getPaymentAttempts().get(1).getTransactionExternalKey()); Assert.assertEquals(testPaymentControlWithControl.getCalls().size(), 2); Assert.assertEquals(testPaymentControlWithControl.getCalls().get(TransactionType.AUTHORIZE.toString()), new Integer(1)); Assert.assertEquals(testPaymentControlWithControl.getCalls().get(TransactionType.CAPTURE.toString()), new Integer(1)); }
final Payment payment = paymentApi.createAuthorizationWithPaymentControl(account, account.getPaymentMethodId(), null, BigDecimal.ONE, account.getCurrency(), null, paymentExternalKey, paymentTransactionExternalKey, properties, paymentOptions, callContext); assertListenerStatus(); Payment paymentWithAttempts = paymentApi.getPayment(payment.getId(), false, true, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().size(), 1); Assert.assertEquals(paymentWithAttempts.getExternalKey(), paymentExternalKey); paymentApi.createVoidWithPaymentControl(account, payment.getId(), null, paymentTransactionExternalKey2, properties, paymentOptions, callContext); assertListenerStatus(); paymentWithAttempts = paymentApi.getPayment(payment.getId(), false, true, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentWithAttempts.getPaymentAttempts().size(), 2); Assert.assertEquals(paymentWithAttempts.getTransactions().get(1).getExternalKey(), paymentTransactionExternalKey2);
final Payment payment = paymentApi.createPurchase(account, account.getPaymentMethodId(), null, final Payment payment2 = paymentApi.createChargeback(account, payment.getId(), requestedAmount, paymentApi.createRefund(account, payment.getId(), requestedAmount, final Payment payment3 = paymentApi.createChargebackReversal(account, payment.getId(), null, final Payment payment4 = paymentApi.createRefund(account, payment.getId(), refundAmount, final Payment payment5 = paymentApi.createChargeback(account, payment.getId(), secondChargebackAmount, paymentApi.createRefund(account, payment.getId(), refundAmount, final Payment payment6 = paymentApi.createChargebackReversal(account,
@Test(groups = "slow") public void testCreateAuthNoControlCaptureWithControl() throws PaymentApiException { final BigDecimal requestedAmount = BigDecimal.TEN; Payment payment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, Currency.USD, null,UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); Assert.assertEquals(payment.getCapturedAmount().compareTo(BigDecimal.ZERO), 0); Assert.assertEquals(payment.getTransactions().size(), 1); Assert.assertNull(((DefaultPaymentTransaction) payment.getTransactions().get(0)).getAttemptId()); payment = paymentApi.createCaptureWithPaymentControl(account, payment.getId(), payment.getAuthAmount(), payment.getCurrency(), null,UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), PAYMENT_OPTIONS, callContext); Assert.assertEquals(payment.getAuthAmount().compareTo(requestedAmount), 0); Assert.assertEquals(payment.getCapturedAmount().compareTo(requestedAmount), 0); Assert.assertEquals(payment.getTransactions().size(), 2); Assert.assertNull(((DefaultPaymentTransaction) payment.getTransactions().get(0)).getAttemptId()); Assert.assertNotNull(((DefaultPaymentTransaction) payment.getTransactions().get(1)).getAttemptId()); verifyOnSuccessForFollowOnTransaction(payment.getId(), payment.getExternalKey(), payment.getTransactions().get(1).getId(), payment.getTransactions().get(1).getExternalKey(), requestedAmount, Currency.USD); }
@Test(groups = "slow") public void testAddPaymentMethodWithControl() throws PaymentApiException { final PaymentMethodPlugin paymentMethodInfo = new DefaultNoOpPaymentMethodPlugin(UUID.randomUUID().toString(), false, null); testPaymentControlPluginApi.setNewPaymentMethodName(MockPaymentProviderPlugin.PLUGIN_NAME); final UUID newPaymentMethodId = paymentApi.addPaymentMethodWithPaymentControl(account, null, "SomeDummyValueToBeChanged", false, paymentMethodInfo, ImmutableList.<PluginProperty>of(), PAYMENT_OPTIONS, callContext); final PaymentMethod paymentMethod = paymentApi.getPaymentMethodById(newPaymentMethodId, false, false, ImmutableList.<PluginProperty>of(), callContext); Assert.assertEquals(paymentMethod.getPluginName(), MockPaymentProviderPlugin.PLUGIN_NAME); final Payment payment = paymentApi.createAuthorizationWithPaymentControl(account, newPaymentMethodId, null, BigDecimal.TEN, Currency.USD, null,UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.<PluginProperty>of(), PAYMENT_OPTIONS, callContext); Assert.assertEquals(payment.getPaymentMethodId(), newPaymentMethodId); verifyOnSuccess(payment.getId(), payment.getExternalKey(), payment.getTransactions().get(0).getId(), payment.getTransactions().get(0).getExternalKey(), BigDecimal.TEN, Currency.USD); }
@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); }
final List<PaymentMethod> accountPaymentMethods = paymentApi.getAccountPaymentMethods(account.getId(), false, false, ImmutableList.<PluginProperty>of(), callContext); return paymentApi.addPaymentMethod(account, paymentMethodJson.getExternalKey(), paymentMethodJson.getPluginName(), isDefault, paymentData.getPluginDetail(), pluginProperties, callContext);