Package com.hybris.cis.service.impl
Class DefaultCisClientPaymentService
- java.lang.Object
-
- com.hybris.cis.service.impl.DefaultCisClientPaymentService
-
- All Implemented Interfaces:
CisClientPaymentService,CisClientService
public class DefaultCisClientPaymentService extends java.lang.Object implements CisClientPaymentService
Default implementation ofCisClientPaymentService
-
-
Constructor Summary
Constructors Constructor Description DefaultCisClientPaymentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.hybris.charon.RawResponse<CisPaymentProfileResult>addCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String documentId, CisExternalPaymentRequest cisExternalPayment)Add a customer profileCisPaymentTransactionResultauthorizeWithProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation, CisPaymentAuthorization cisPaymentAuthorization)Requests an authorization of a paymentCisPaymentTransactionResultcapture(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)Captures a payment based on the given propertiesjava.lang.StringdeleteCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation)Deletes a given customer profileprotected java.lang.StringextractLastUriParam(java.net.URI uri)Extracts the last part of the URIprotected PaymentClientgetCisPaymentClient()CisPaymentTransactionResulthandleExternalAuthorization(java.lang.String xCisClientRef, java.lang.String tenantId, CisExternalPaymentRequest cisExternalPayment)Requests a payment authorizationCisTokenizedPaymentTransactionResultinitPaymentSession(java.lang.String xCisClientRef, java.lang.String tenantId, CisPaymentSessionInitRequest cisPaymentSessionInitRequest)Initialize the payment sessionCisTokenizedPaymentTransactionResultpaymentOrderSetup(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, CisTokenizedPaymentAuthorization cisTokenizedPaymentAuthorization)Setup order paymentbooleanping(java.lang.String xCisClientRef, java.lang.String tenantId)Checks if service is functioning and connecting with current credentials.com.hybris.charon.RawResponse<java.lang.String>pspUrl(java.lang.String xCisClientRef, java.lang.String tenantId)Retrieves the payment service url for a given client and tenantCisPaymentTransactionResultrefund(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI captureLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)Refunds a payment transactionCisPaymentTransactionResultreverse(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)Reverses a payment based on the given propertiesvoidsetCisPaymentClient(PaymentClient cisPaymentClient)CisTokenizedPaymentTransactionResulttokenizedPaymentAuthorization(java.lang.String xCisClientRef, java.lang.String tenantId, CisTokenizedPaymentAuthorization cisTokenizedPaymentAuthorization)Tokenized Payment AuthorizationCisTokenizedPaymentTransactionResulttokenizedPaymentCapture(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentCapture cisTokenizedPaymentCapture)Tokenized Payment CaptureCisTokenizedPaymentTransactionResulttokenizedPaymentRefund(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentRefund cisTokenizedPaymentRefund)Tokenized Payment RefundCisTokenizedPaymentTransactionResulttokenizedPaymentReverse(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentReverse cisTokenizedPaymentReverse)Tokenized Payment ReverseCisPaymentProfileResultupdateCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation, CisPaymentProfileRequest cisPaymentProfileRequest)Updates a customer profile
-
-
-
Method Detail
-
pspUrl
public com.hybris.charon.RawResponse<java.lang.String> pspUrl(java.lang.String xCisClientRef, java.lang.String tenantId)Description copied from interface:CisClientPaymentServiceRetrieves the payment service url for a given client and tenant- Specified by:
pspUrlin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifier- Returns:
- a raw response with the psp url in the location attribute of the header
-
handleExternalAuthorization
public CisPaymentTransactionResult handleExternalAuthorization(java.lang.String xCisClientRef, java.lang.String tenantId, CisExternalPaymentRequest cisExternalPayment)
Description copied from interface:CisClientPaymentServiceRequests a payment authorization- Specified by:
handleExternalAuthorizationin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifiercisExternalPayment- the external payment request- Returns:
- the result of the payment transaction
-
authorizeWithProfile
public CisPaymentTransactionResult authorizeWithProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation, CisPaymentAuthorization cisPaymentAuthorization)
Description copied from interface:CisClientPaymentServiceRequests an authorization of a payment- Specified by:
authorizeWithProfilein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierprofileLocation- the URI of the profile to be authorizedcisPaymentAuthorization- the payment authorization to be authorized- Returns:
-
capture
public CisPaymentTransactionResult capture(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)
Description copied from interface:CisClientPaymentServiceCaptures a payment based on the given properties- Specified by:
capturein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifiertransactionId- the transaction identifier to be capturedpaymentRequest- the corresponding payment request- Returns:
- the payment transaction result
-
reverse
public CisPaymentTransactionResult reverse(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)
Description copied from interface:CisClientPaymentServiceReverses a payment based on the given properties- Specified by:
reversein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierauthorizationLocation- the location of the granted authorizationtransactionId- the transaction identifier to be reversedpaymentRequest- the corresponding payment request- Returns:
- the reversal payment transaction result
-
refund
public CisPaymentTransactionResult refund(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI captureLocation, java.lang.String transactionId, CisPaymentRequest paymentRequest)
Description copied from interface:CisClientPaymentServiceRefunds a payment transaction- Specified by:
refundin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifiercaptureLocation- the URI of the captured locationtransactionId- the transaction identifier to be reversedpaymentRequest- the corresponding payment request- Returns:
- the result of the refund payment transaction
-
addCustomerProfile
public com.hybris.charon.RawResponse<CisPaymentProfileResult> addCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String documentId, CisExternalPaymentRequest cisExternalPayment)
Description copied from interface:CisClientPaymentServiceAdd a customer profile- Specified by:
addCustomerProfilein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierdocumentId- the document identifiercisExternalPayment- the external payment request- Returns:
- a raw response with the payment profile created
-
updateCustomerProfile
public CisPaymentProfileResult updateCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation, CisPaymentProfileRequest cisPaymentProfileRequest)
Description copied from interface:CisClientPaymentServiceUpdates a customer profile- Specified by:
updateCustomerProfilein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierprofileLocation- the URI of the profile locationcisPaymentProfileRequest- the payment profile request- Returns:
- the profile payment updated
-
deleteCustomerProfile
public java.lang.String deleteCustomerProfile(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI profileLocation)Description copied from interface:CisClientPaymentServiceDeletes a given customer profile- Specified by:
deleteCustomerProfilein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierprofileLocation- the URI of the profile to delete- Returns:
-
initPaymentSession
public CisTokenizedPaymentTransactionResult initPaymentSession(java.lang.String xCisClientRef, java.lang.String tenantId, CisPaymentSessionInitRequest cisPaymentSessionInitRequest)
Description copied from interface:CisClientPaymentServiceInitialize the payment session- Specified by:
initPaymentSessionin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifiercisPaymentSessionInitRequest- the payment session request- Returns:
CisTokenizedPaymentTransactionResult
-
paymentOrderSetup
public CisTokenizedPaymentTransactionResult paymentOrderSetup(java.lang.String xCisClientRef, java.lang.String tenantId, java.net.URI authorizationLocation, CisTokenizedPaymentAuthorization cisTokenizedPaymentAuthorization)
Description copied from interface:CisClientPaymentServiceSetup order payment- Specified by:
paymentOrderSetupin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierauthorizationLocation- the URI of the authorization- Returns:
CisTokenizedPaymentTransactionResult
-
tokenizedPaymentAuthorization
public CisTokenizedPaymentTransactionResult tokenizedPaymentAuthorization(java.lang.String xCisClientRef, java.lang.String tenantId, CisTokenizedPaymentAuthorization cisTokenizedPaymentAuthorization)
Description copied from interface:CisClientPaymentServiceTokenized Payment Authorization- Specified by:
tokenizedPaymentAuthorizationin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifier- Returns:
CisTokenizedPaymentTransactionResult
-
tokenizedPaymentCapture
public CisTokenizedPaymentTransactionResult tokenizedPaymentCapture(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentCapture cisTokenizedPaymentCapture)
Description copied from interface:CisClientPaymentServiceTokenized Payment Capture- Specified by:
tokenizedPaymentCapturein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierauthGroupId- the authentication group identifierauthId- the authentication identifier- Returns:
CisTokenizedPaymentTransactionResult
-
tokenizedPaymentRefund
public CisTokenizedPaymentTransactionResult tokenizedPaymentRefund(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentRefund cisTokenizedPaymentRefund)
Description copied from interface:CisClientPaymentServiceTokenized Payment Refund- Specified by:
tokenizedPaymentRefundin interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierauthGroupId- the authentication group identifierauthId- the authentication identifier- Returns:
CisTokenizedPaymentTransactionResult
-
tokenizedPaymentReverse
public CisTokenizedPaymentTransactionResult tokenizedPaymentReverse(java.lang.String xCisClientRef, java.lang.String tenantId, java.lang.String authGroupId, java.lang.String authId, CisTokenizedPaymentReverse cisTokenizedPaymentReverse)
Description copied from interface:CisClientPaymentServiceTokenized Payment Reverse- Specified by:
tokenizedPaymentReversein interfaceCisClientPaymentService- Parameters:
xCisClientRef- the client referencetenantId- the tenant identifierauthGroupId- the authentication group identifierauthId- the authentication identifier- Returns:
CisTokenizedPaymentTransactionResult
-
ping
public boolean ping(java.lang.String xCisClientRef, java.lang.String tenantId)Description copied from interface:CisClientServiceChecks if service is functioning and connecting with current credentials.- Specified by:
pingin interfaceCisClientService- Parameters:
xCisClientRef- client ref to pass in the headertenantId- tenantId to pass in the header- Returns:
- flag if the service is accessible or not
-
extractLastUriParam
protected java.lang.String extractLastUriParam(java.net.URI uri)
Extracts the last part of the URI- Parameters:
uri- the URI for which we want to extract the last parameter- Returns:
- the last parameter of the URI
-
getCisPaymentClient
protected PaymentClient getCisPaymentClient()
- Returns:
- the cisPaymentClient
-
setCisPaymentClient
public void setCisPaymentClient(PaymentClient cisPaymentClient)
- Parameters:
cisPaymentClient- the cisPaymentClient to set
-
-