public class DefaultPaymentServiceImpl extends java.lang.Object implements PaymentService
| Constructor and Description |
|---|
DefaultPaymentServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachPaymentInfo(PaymentTransactionModel paymentTransactionModel,
UserModel userModel,
CardInfo cardInfo,
java.math.BigDecimal amount)
Attaches PaymentInfo to the assigned PaymentTransactionModel instance by using the configured
PaymentInfoCreatorStrategy.
|
PaymentTransactionEntryModel |
authorize(OrderModel order,
CardInfo card)
Deprecated.
Since 4.2.2 use any of the other authorize methods
|
PaymentTransactionEntryModel |
authorize(PaymentTransactionModel transaction,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
AddressModel paymentAddress,
CardInfo card)
authorize payment
note: the code of the assigned payment transaction will be used as code-basecode during the PaymentTransactionEntryModel.CODE code generation process, which represents the main benefit of this
method. |
PaymentTransactionEntryModel |
authorize(PaymentTransactionModel transaction,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
java.lang.String subscriptionID)
authorize payment
|
PaymentTransactionEntryModel |
authorize(PaymentTransactionModel transaction,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
java.lang.String subscriptionID,
java.lang.String paymentprovider)
authorize payment
note: the code of the assigned payment transaction will be used as code-basecode during the PaymentTransactionEntryModel.CODE code generation process, which represents the main benefit of this
method. |
PaymentTransactionEntryModel |
authorize(java.lang.String merchantTransactionCode,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
AddressModel paymentAddress,
CardInfo card)
authorize payment
|
PaymentTransactionEntryModel |
authorize(java.lang.String merchantTransactionCode,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
java.lang.String subscriptionID)
Authorize payment.
Status, transaction and request related informations are available via the related PaymentTransactionEntryModel,/Informations about the related order will be accessible via the referenced PaymentTransactionModel (see:
PaymentTransactionEntryModel.getPaymentTransaction() and
PaymentTransactionEntryModel.setPaymentTransaction(PaymentTransactionModel) |
PaymentTransactionEntryModel |
authorize(java.lang.String merchantTransactionCode,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel deliveryAddress,
java.lang.String subscriptionID,
java.lang.String cv2,
java.lang.String paymentProvider)
authorize payment
|
protected PaymentTransactionEntryModel |
authorizeInternal(PaymentTransactionModel transaction,
java.math.BigDecimal amount,
java.util.Currency currency,
BillingInfo shippingInfo,
CardInfo card,
java.lang.String subscriptionID,
java.lang.String cv2,
java.lang.String paymentProvider)
...
|
PaymentTransactionEntryModel |
cancel(PaymentTransactionEntryModel transaction)
Cancel payment
|
PaymentTransactionEntryModel |
capture(PaymentTransactionModel transaction)
capture payment
|
protected BillingInfo |
createBillingInfo(AddressModel address)
address DTO 2 address DTO
|
protected BillingInfo |
createBillingInfo(AddressModel deliveryAddress,
AddressModel paymentAddress,
CardInfo card)
creates the billing info based on the assigned delivery address instance.
|
NewSubscription |
createSubscription(PaymentTransactionModel transaction,
AddressModel paymentAddress,
CardInfo card)
Creates a subscription at the payment provider side and stores sensitive data there.
|
NewSubscription |
createSubscription(java.lang.String merchantTransactionCode,
java.lang.String paymentProvider,
java.util.Currency currency,
AddressModel paymentAddress,
CardInfo card)
Creates a subscription at the payment provider side and stores sensitive data there.
|
PaymentTransactionEntryModel |
deleteSubscription(java.lang.String merchantTransactionCode,
java.lang.String subscriptionID,
java.lang.String paymentProvider)
Deletes the subscription at the payment provider.
|
protected CardPaymentService |
getCardPaymentService() |
protected CommonI18NService |
getCommonI18NService() |
protected FlexibleSearchService |
getFlexibleSearchService() |
protected ModelService |
getModelService() |
java.lang.String |
getNewPaymentTransactionEntryCode(PaymentTransactionModel transaction,
PaymentTransactionType paymentTransactionType)
Generate new merchant transaction code for payment transaction entries based on code for whole transaction
|
protected PaymentInfoCreatorStrategy |
getPaymentInfoCreator() |
PaymentTransactionModel |
getPaymentTransaction(java.lang.String code)
Get
PaymentTransactionModel by code |
PaymentTransactionEntryModel |
getPaymentTransactionEntry(java.lang.String code)
Get
PaymentTransactionEntryModel by code |
PaymentTransactionEntryModel |
getSubscriptionData(java.lang.String merchantTransactionCode,
java.lang.String subscriptionID,
java.lang.String paymentProvider,
BillingInfo billingInfo,
CardInfo card)
Gets the stored card info or payment address
|
protected TransactionCodeGenerator |
getTransactionCodeGenerator() |
PaymentTransactionEntryModel |
partialCapture(PaymentTransactionModel transaction,
java.math.BigDecimal amount)
Take a partial capture of authorized transaction
|
PaymentTransactionEntryModel |
refundFollowOn(PaymentTransactionModel transaction,
java.math.BigDecimal amount)
Refund transaction
|
PaymentTransactionEntryModel |
refundStandalone(StandaloneRefundRequest request)
Deprecated.
Since 4.2.2 use
refundStandalone(String, BigDecimal, Currency, AddressModel, CardInfo) instead |
PaymentTransactionEntryModel |
refundStandalone(java.lang.String merchantTransactionCode,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel paymentAddress,
CardInfo card)
Refund value to a card (no transaction is obligatory)
|
PaymentTransactionEntryModel |
refundStandalone(java.lang.String merchantTransactionCode,
java.math.BigDecimal amount,
java.util.Currency currency,
AddressModel paymentAddress,
CardInfo card,
java.lang.String providerName,
java.lang.String subscriptionId)
Refund value to a card (no transaction is obligatory)
|
void |
setCardPaymentService(CardPaymentService cardPaymentService) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setModelService(ModelService modelService) |
void |
setPaymentInfoCreator(PaymentInfoCreatorStrategy paymentInfoCreator) |
void |
setTransactionCodeGenerator(TransactionCodeGenerator transactionCodeGenerator) |
PaymentTransactionEntryModel |
updateSubscription(java.lang.String merchantTransactionCode,
java.lang.String subscriptionID,
java.lang.String paymentProvider,
AddressModel paymentAddress,
CardInfo card)
Updates the data of the subscription at the payment provider.
|
public PaymentTransactionEntryModel authorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)
PaymentTransactionEntryModel,/PaymentTransactionModel (see:
PaymentTransactionEntryModel.getPaymentTransaction() and
PaymentTransactionEntryModel.setPaymentTransaction(PaymentTransactionModel)authorize in interface PaymentServicemerchantTransactionCode - the transaction code. Code of the internally generated PaymentTransactionModel and code-base of
the final PaymentTransactionEntryModel.CODE which will be generated by using the injected
TransactionCodeGeneratoramount - the amountcurrency - the currencydeliveryAddress - the delivery addresssubscriptionID - the subscriptionIDAdapterExceptionpublic PaymentTransactionEntryModel authorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID, java.lang.String cv2, java.lang.String paymentProvider)
PaymentServiceauthorize in interface PaymentServicemerchantTransactionCode - the transaction codeamount - the amountcurrency - the currencydeliveryAddress - the delivery address (paymentAddress is used if null)subscriptionID - the subscriptionIDcv2 - card verification valuepaymentProvider - code of payment providerpublic PaymentTransactionEntryModel authorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)
PaymentServiceauthorize in interface PaymentServicemerchantTransactionCode - the transaction codeamount - the amountcurrency - the currencydeliveryAddress - the delivery address (paymentAddress is used if null)paymentAddress - the payment addresscard - the cardpublic PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)
PaymentTransactionEntryModel.CODE code generation process, which represents the main benefit of this
method.authorize in interface PaymentServicetransaction - the payment transactionamount - the amountcurrency - the currencydeliveryAddress - the delivery addresspaymentAddress - the payment addresscard - the cardAdapterExceptionpublic PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID, java.lang.String paymentprovider)
PaymentTransactionEntryModel.CODE code generation process, which represents the main benefit of this
method.authorize in interface PaymentServicetransaction - the payment transactionamount - the amountcurrency - the currencydeliveryAddress - the delivery addresssubscriptionID - will be used for identifying the user profile (see payment tokenization)paymentprovider - code of payment providerAdapterExceptionpublic PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)
PaymentServiceauthorize in interface PaymentServicetransaction - the payment transactionamount - the amountcurrency - the currencydeliveryAddress - the delivery address (paymentAddress is used if null)subscriptionID - the subscriptionIDprotected PaymentTransactionEntryModel authorizeInternal(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, BillingInfo shippingInfo, CardInfo card, java.lang.String subscriptionID, java.lang.String cv2, java.lang.String paymentProvider)
transaction - the payment transactionamount - the amount we ant to authorizecurrency - the related currency of the amountshippingInfo - the shipping infocard - the card infosubscriptionID - will be used for identifying the user profile (see payment tokenization)AdapterExceptionpublic java.lang.String getNewPaymentTransactionEntryCode(PaymentTransactionModel transaction, PaymentTransactionType paymentTransactionType)
getNewPaymentTransactionEntryCode in interface PaymentServicetransaction - An associated Payment transactionpaymentTransactionType - A type of entry.protected BillingInfo createBillingInfo(AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)
deliveryAddress - the delivery addresspaymentAddress - the payment addresscard - the card infoprotected BillingInfo createBillingInfo(AddressModel address)
@Deprecated public PaymentTransactionEntryModel authorize(OrderModel order, CardInfo card)
TransactionCodeGenerator will be used
for determining the 'merchant transaction code' .authorize in interface PaymentServiceorder - the ordercard - the cardAdapterExceptionpublic PaymentTransactionEntryModel capture(PaymentTransactionModel transaction)
PaymentServicecapture in interface PaymentServicetransaction - payment transactionpublic PaymentTransactionEntryModel cancel(PaymentTransactionEntryModel transaction)
PaymentServicecancel in interface PaymentServicetransaction - payment transactionpublic PaymentTransactionEntryModel refundFollowOn(PaymentTransactionModel transaction, java.math.BigDecimal amount)
PaymentServicerefundFollowOn in interface PaymentServicetransaction - payment transactionamount - amount to refund@Deprecated public PaymentTransactionEntryModel refundStandalone(StandaloneRefundRequest request)
refundStandalone(String, BigDecimal, Currency, AddressModel, CardInfo) insteadPaymentServicerefundStandalone in interface PaymentServicerequest - instance of StandaloneRefundRequest for a refund detailspublic PaymentTransactionEntryModel refundStandalone(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel paymentAddress, CardInfo card)
PaymentServicerefundStandalone in interface PaymentServicemerchantTransactionCode - any code to locate transactionamount - amount to refundcurrency - currency, used for refundingpaymentAddress - address to refundcard - card to refundpublic PaymentTransactionEntryModel refundStandalone(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel paymentAddress, CardInfo card, java.lang.String providerName, java.lang.String subscriptionId)
PaymentServicerefundStandalone in interface PaymentServicemerchantTransactionCode - any code to locate transactionamount - amount to refundcurrency - currency, used for refundingpaymentAddress - address to refundcard - card to refundproviderName - name of the payment providersubscriptionId - subscription identifierpublic PaymentTransactionEntryModel partialCapture(PaymentTransactionModel transaction, java.math.BigDecimal amount)
PaymentServicepartialCapture in interface PaymentServicetransaction - authorized transactionamount - value to capturepublic PaymentTransactionModel getPaymentTransaction(java.lang.String code)
PaymentTransactionModel by codegetPaymentTransaction in interface PaymentServicecode - the code of the PaymentTransactionModel we were looking forPaymentTransactionModelModelNotFoundException - if nothing was foundAmbiguousIdentifierException - if by the given searchparams to many models where foundpublic PaymentTransactionEntryModel getPaymentTransactionEntry(java.lang.String code)
PaymentTransactionEntryModel by codegetPaymentTransactionEntry in interface PaymentServicecode - the code of the PaymentTransactionModel we were looking forPaymentTransactionModelModelNotFoundException - if nothing was foundAmbiguousIdentifierException - if by the given searchparams to many models where foundpublic void attachPaymentInfo(PaymentTransactionModel paymentTransactionModel, UserModel userModel, CardInfo cardInfo, java.math.BigDecimal amount)
attachPaymentInfo in interface PaymentServicepaymentTransactionModel - the payment transactionuserModel - the usercardInfo - the card infoamount - the amountpublic NewSubscription createSubscription(PaymentTransactionModel transaction, AddressModel paymentAddress, CardInfo card)
PaymentServicecreateSubscription in interface PaymentServicetransaction - a previous recent successful authorize payment transactionpaymentAddress - the same billing address as for the authorize txncard - the same card as for the authorize txnNewSubscriptionpublic NewSubscription createSubscription(java.lang.String merchantTransactionCode, java.lang.String paymentProvider, java.util.Currency currency, AddressModel paymentAddress, CardInfo card)
PaymentServicecreateSubscription in interface PaymentServicemerchantTransactionCode - the transactionCodepaymentProvider - the paymentProvider who will hold the subscription. You might also have just one payment provider in
your implementation.currency - the default customer's currencypaymentAddress - the same billing address as for the authorize txncard - the same card as for the authorize txnNewSubscription)public PaymentTransactionEntryModel updateSubscription(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider, AddressModel paymentAddress, CardInfo card)
PaymentServiceupdateSubscription in interface PaymentServicemerchantTransactionCode - the transactionCodesubscriptionID - the subscription IDpaymentProvider - the paymentProvider who holds the subscription. You get this value from the
PaymentTransactionModel of the createSubscription command. You might also have just one payment
provider in your implementation.paymentAddress - the new billing address, could be nullcard - the updated card, could be nullPaymentTransactionEntryModelpublic PaymentTransactionEntryModel getSubscriptionData(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider, BillingInfo billingInfo, CardInfo card)
PaymentServicegetSubscriptionData in interface PaymentServicemerchantTransactionCode - the transactionCodesubscriptionID - the subscription IDpaymentProvider - the paymentProvider who holds the subscription. You get this value from the
PaymentTransactionModel of the createSubscription command. You might also have just one payment
provider in your implementation.billingInfo - the billing address is returned in this DTOcard - the card information is returned in this DTOPaymentTransactionEntryModelpublic PaymentTransactionEntryModel deleteSubscription(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider)
PaymentServicedeleteSubscription in interface PaymentServicemerchantTransactionCode - the transactionCodesubscriptionID - the subscription IDpaymentProvider - the paymentProvider who holds the subscription. You get this value from the
PaymentTransactionModel of the createSubscription command. You might also have just one payment
provider in your implementation.PaymentTransactionEntryModelprotected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
protected PaymentInfoCreatorStrategy getPaymentInfoCreator()
public void setPaymentInfoCreator(PaymentInfoCreatorStrategy paymentInfoCreator)
protected TransactionCodeGenerator getTransactionCodeGenerator()
public void setTransactionCodeGenerator(TransactionCodeGenerator transactionCodeGenerator)
protected CardPaymentService getCardPaymentService()
public void setCardPaymentService(CardPaymentService cardPaymentService)
Copyright © 2018 SAP SE. All Rights Reserved.