Interface SapDigitalPaymentService
- All Known Implementing Classes:
DefaultSapDigitalPaymentService,MockSapDigitalPaymentService
public interface SapDigitalPaymentService
Defines payment related services
-
Method Summary
Modifier and TypeMethodDescriptionauthorize(String merchantTransactionCode, String paymentProvider, AddressModel deliveryAddress, CisSapDigitalPaymentAuthorizationResult cisSapDigitalPaymentAuthorizationResult) Requests a payment authorizationcapture(PaymentTransactionModel transaction) Requests a payment capturecreatePaymentSubscription(CCPaymentInfoData paymentInfoData, Map<String, Object> params) creates payment subscriptionvoidcreatePollRegisteredCardProcess(String sessionId) triggers a process which polls backend for a cardRequests card registration URL from Digital paymentGets Digital Payments card registration URLgetRegistrationUrl(String redirectUrl) Gets Digital Payments card registration URL and user will be redirected to redirectUrl after transaction is completedbooleanCheck if the Transaction is SAP Digital payment transactionPolls the payment card registration url and return statuspollAndSave(String sessionId) Polls the payment card registration url and return statusrefund(PaymentTransactionModel transaction, BigDecimal amountToRefund) Requests a payment refundbooleansaveCreditCardPaymentDetailsToCart(String paymentInfoId, Map<String, Object> params) save credit card details to the cart
-
Method Details
-
authorize
PaymentTransactionEntryModel authorize(String merchantTransactionCode, String paymentProvider, AddressModel deliveryAddress, CisSapDigitalPaymentAuthorizationResult cisSapDigitalPaymentAuthorizationResult) Requests a payment authorization- Parameters:
merchantTransactionCode- - merchant transaction codepaymentProvider- - payment service providerdeliveryAddress- - delivery addresscisSapDigitalPaymentAuthorizationResult- - payment authorization result- Returns:
- PaymentTransactionEntryModel
-
capture
PaymentTransactionEntryModel capture(PaymentTransactionModel transaction) throws SapDigitalPaymentCaptureException Requests a payment capture- Parameters:
transaction- - payment transaction- Returns:
PaymentTransactionEntryModel- Throws:
SapDigitalPaymentCaptureException- - Capture payment exception
-
refund
PaymentTransactionEntryModel refund(PaymentTransactionModel transaction, BigDecimal amountToRefund) throws SapDigitalPaymentRefundException Requests a payment refund- Parameters:
transaction- - payment transactionamountToRefund- - amount to refund- Returns:
PaymentTransactionEntryModel- Throws:
SapDigitalPaymentRefundException- - Payment refund exception
-
getCardRegistrationUrl
String getCardRegistrationUrl()Requests card registration URL from Digital payment- Returns:
- registration URL
-
createPollRegisteredCardProcess
triggers a process which polls backend for a card- Parameters:
sessionId- - sessionId w.r.t registered card
-
createPaymentSubscription
CreditCardPaymentInfoModel createPaymentSubscription(CCPaymentInfoData paymentInfoData, Map<String, Object> params) creates payment subscription- Parameters:
paymentInfoData- has card informationparams- contains card and user details- Returns:
- credit card details from backend
-
saveCreditCardPaymentDetailsToCart
save credit card details to the cart- Parameters:
paymentInfoId- - paymentIDparams- - contains card and user details- Returns:
- success or failure
-
isSapDigitalPaymentTransaction
Check if the Transaction is SAP Digital payment transaction- Parameters:
txn- - Payment Transaction- Returns:
- success or failure
-
pollAndSave
Polls the payment card registration url and return status- Parameters:
sessionId- session id of card registration- Returns:
- poll model
-
getRegistrationUrl
DigitalPaymentsRegistrationModel getRegistrationUrl()Gets Digital Payments card registration URL- Returns:
- registration mode
-
getRegistrationUrl
Gets Digital Payments card registration URL and user will be redirected to redirectUrl after transaction is completed- Parameters:
redirectUrl- - URL to redirect- Returns:
- registration mode
-
poll
Polls the payment card registration url and return status- Parameters:
sessionId- session id of card registration- Returns:
- poll model
-