Package com.clover.sdk.v3.payments
Class ServiceFeeConnector
- java.lang.Object
-
- com.clover.sdk.v1.ServiceConnector<IServiceFeeService>
-
- com.clover.sdk.v3.payments.ServiceFeeConnector
-
- All Implemented Interfaces:
ServiceConnection
public class ServiceFeeConnector extends ServiceConnector<IServiceFeeService>
Manages billing service fees to an alternative MID. The general use case applies to government agencies who collect fees via credit card plus a service fee that goes to a third party. Your merchant has to be specifically configured to use this service - it is not generically available.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.clover.sdk.v1.ServiceConnector
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
-
-
Field Summary
-
Fields inherited from class com.clover.sdk.v1.ServiceConnector
mAccount, mClient, mConnected, mContext, mHandler, mService
-
-
Constructor Summary
Constructors Constructor Description ServiceFeeConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Constructs a ServiceFeeConnector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getServiceIntentAction()
protected String
getServiceIntentPackage()
The package which hosts the service to connect to.protected IServiceFeeService
getServiceInterface(IBinder binder)
PaymentResponse
payServiceFee(ServiceFeeRequest request)
Calling this method will result in a payment being submitted on behalf of the associated MID that collects the service fees for your merchant.RefundResponse
refundServiceFee(ServiceFeeRefundRequest request)
Calling this method will refund the service fee previously charged-
Methods inherited from class com.clover.sdk.v1.ServiceConnector
connect, disconnect, execute, execute, execute, execute, getService, getServiceIntentVersion, getStartIntent, isConnected, isInstalled, notifyServiceConnected, notifyServiceDisconnected, onServiceConnected, onServiceDisconnected, postResults, throwOnFailure, waitForConnection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface android.content.ServiceConnection
onBindingDied, onNullBinding
-
-
-
-
Constructor Detail
-
ServiceFeeConnector
public ServiceFeeConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Constructs a ServiceFeeConnector. This connector users theIServiceFeeService
- Parameters:
context
- the Context object, required for establishing a connection to the service.account
- the Account to use with the service.client
- an optional object implementing the OnServiceConnectedListener
-
-
Method Detail
-
getServiceIntentAction
protected String getServiceIntentAction()
- Specified by:
getServiceIntentAction
in classServiceConnector<IServiceFeeService>
-
getServiceInterface
protected IServiceFeeService getServiceInterface(IBinder binder)
- Specified by:
getServiceInterface
in classServiceConnector<IServiceFeeService>
-
getServiceIntentPackage
protected String getServiceIntentPackage()
Description copied from class:ServiceConnector
The package which hosts the service to connect to. Returning null is OK for api target < 21. Once you try to build with 21 or higher returning null will cause an illegal argument exception- Overrides:
getServiceIntentPackage
in classServiceConnector<IServiceFeeService>
-
payServiceFee
public PaymentResponse payServiceFee(ServiceFeeRequest request) throws RemoteException, ClientException, ServiceException, BindingException
Calling this method will result in a payment being submitted on behalf of the associated MID that collects the service fees for your merchant.- Parameters:
request
- The request object must contain the amount, the source payment id (that the service fee is related to), and the populated vaulted card object including the token The orderId will be populated internal to the implementation- Returns:
- PaymentResponse -The PaymentResponse will indicate if the request was successful or no. If successful, it will contain a payment object, if not, it should include an error message
- Throws:
RemoteException
ClientException
ServiceException
BindingException
-
refundServiceFee
public RefundResponse refundServiceFee(ServiceFeeRefundRequest request) throws RemoteException, ClientException, ServiceException, BindingException
Calling this method will refund the service fee previously charged- Parameters:
request
- The ServiceFeeRefundRequest.refund object must be populated as below: refund.amount : must match the amount of the original service charge refund.payment : populated with the original payment- Returns:
- RefundResponse - The RefundResponse object will indicate success or failure. In the case of failure there will be an error message set. In the case of success the refund object will be echo'ed back with additional attributes (e.g id) populated
- Throws:
RemoteException
ClientException
ServiceException
BindingException
-
-