com.ning.billing.osgi.bundles.test
Class TestPaymentPluginApi

java.lang.Object
  extended by com.ning.billing.osgi.bundles.test.TestPaymentPluginApi
All Implemented Interfaces:
PaymentPluginApi, PaymentPluginApiWithTestControl

public class TestPaymentPluginApi
extends Object
implements PaymentPluginApiWithTestControl


Constructor Summary
TestPaymentPluginApi(String name)
           
 
Method Summary
 void addPaymentMethod(UUID kbAccountId, UUID kbPaymentMethodId, PaymentMethodPlugin paymentMethodProps, boolean setDefault, CallContext context)
           
 void deletePaymentMethod(UUID accountId, UUID kbPaymentMethodId, CallContext context)
           
 PaymentInfoPlugin getPaymentInfo(UUID accountId, UUID kbPaymentId, TenantContext context)
           
 PaymentMethodPlugin getPaymentMethodDetail(UUID kbAccountId, UUID kbPaymentMethodId, TenantContext context)
           
 List<PaymentMethodInfoPlugin> getPaymentMethods(UUID kbAccountId, boolean refreshFromGateway, CallContext context)
           
 List<RefundInfoPlugin> getRefundInfo(UUID kbAccountId, UUID kbPaymentId, TenantContext context)
           
 PaymentInfoPlugin processPayment(UUID accountId, UUID kbPaymentId, UUID kbPaymentMethodId, BigDecimal amount, Currency currency, CallContext context)
           
 RefundInfoPlugin processRefund(UUID accountId, UUID kbPaymentId, BigDecimal refundAmount, Currency currency, CallContext context)
           
 void resetPaymentMethods(UUID accountId, List<PaymentMethodInfoPlugin> paymentMethods)
           
 void resetToNormalbehavior()
           
 Pagination<PaymentMethodPlugin> searchPaymentMethods(String searchKey, Long offset, Long limit, TenantContext tenantContext)
           
 void setDefaultPaymentMethod(UUID accountId, UUID kbPaymentMethodId, CallContext context)
           
 void setPaymentPluginApiExceptionOnNextCalls(PaymentPluginApiException e)
           
 void setPaymentRuntimeExceptionOnNextCalls(RuntimeException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestPaymentPluginApi

public TestPaymentPluginApi(String name)
Method Detail

processPayment

public PaymentInfoPlugin processPayment(UUID accountId,
                                        UUID kbPaymentId,
                                        UUID kbPaymentMethodId,
                                        BigDecimal amount,
                                        Currency currency,
                                        CallContext context)
                                 throws PaymentPluginApiException
Specified by:
processPayment in interface PaymentPluginApi
Throws:
PaymentPluginApiException

getPaymentInfo

public PaymentInfoPlugin getPaymentInfo(UUID accountId,
                                        UUID kbPaymentId,
                                        TenantContext context)
                                 throws PaymentPluginApiException
Specified by:
getPaymentInfo in interface PaymentPluginApi
Throws:
PaymentPluginApiException

processRefund

public RefundInfoPlugin processRefund(UUID accountId,
                                      UUID kbPaymentId,
                                      BigDecimal refundAmount,
                                      Currency currency,
                                      CallContext context)
                               throws PaymentPluginApiException
Specified by:
processRefund in interface PaymentPluginApi
Throws:
PaymentPluginApiException

getRefundInfo

public List<RefundInfoPlugin> getRefundInfo(UUID kbAccountId,
                                            UUID kbPaymentId,
                                            TenantContext context)
Specified by:
getRefundInfo in interface PaymentPluginApi

addPaymentMethod

public void addPaymentMethod(UUID kbAccountId,
                             UUID kbPaymentMethodId,
                             PaymentMethodPlugin paymentMethodProps,
                             boolean setDefault,
                             CallContext context)
                      throws PaymentPluginApiException
Specified by:
addPaymentMethod in interface PaymentPluginApi
Throws:
PaymentPluginApiException

deletePaymentMethod

public void deletePaymentMethod(UUID accountId,
                                UUID kbPaymentMethodId,
                                CallContext context)
                         throws PaymentPluginApiException
Specified by:
deletePaymentMethod in interface PaymentPluginApi
Throws:
PaymentPluginApiException

getPaymentMethodDetail

public PaymentMethodPlugin getPaymentMethodDetail(UUID kbAccountId,
                                                  UUID kbPaymentMethodId,
                                                  TenantContext context)
                                           throws PaymentPluginApiException
Specified by:
getPaymentMethodDetail in interface PaymentPluginApi
Throws:
PaymentPluginApiException

setDefaultPaymentMethod

public void setDefaultPaymentMethod(UUID accountId,
                                    UUID kbPaymentMethodId,
                                    CallContext context)
                             throws PaymentPluginApiException
Specified by:
setDefaultPaymentMethod in interface PaymentPluginApi
Throws:
PaymentPluginApiException

getPaymentMethods

public List<PaymentMethodInfoPlugin> getPaymentMethods(UUID kbAccountId,
                                                       boolean refreshFromGateway,
                                                       CallContext context)
                                                throws PaymentPluginApiException
Specified by:
getPaymentMethods in interface PaymentPluginApi
Throws:
PaymentPluginApiException

searchPaymentMethods

public Pagination<PaymentMethodPlugin> searchPaymentMethods(String searchKey,
                                                            Long offset,
                                                            Long limit,
                                                            TenantContext tenantContext)
                                                     throws PaymentPluginApiException
Specified by:
searchPaymentMethods in interface PaymentPluginApi
Throws:
PaymentPluginApiException

resetPaymentMethods

public void resetPaymentMethods(UUID accountId,
                                List<PaymentMethodInfoPlugin> paymentMethods)
                         throws PaymentPluginApiException
Specified by:
resetPaymentMethods in interface PaymentPluginApi
Throws:
PaymentPluginApiException

setPaymentPluginApiExceptionOnNextCalls

public void setPaymentPluginApiExceptionOnNextCalls(PaymentPluginApiException e)
Specified by:
setPaymentPluginApiExceptionOnNextCalls in interface PaymentPluginApiWithTestControl

setPaymentRuntimeExceptionOnNextCalls

public void setPaymentRuntimeExceptionOnNextCalls(RuntimeException e)
Specified by:
setPaymentRuntimeExceptionOnNextCalls in interface PaymentPluginApiWithTestControl

resetToNormalbehavior

public void resetToNormalbehavior()
Specified by:
resetToNormalbehavior in interface PaymentPluginApiWithTestControl


Copyright © 2010-2013. All Rights Reserved.