public class DefaultPaymentServiceImpl extends Object implements PaymentService
| Constructor and Description |
|---|
DefaultPaymentServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachPaymentInfo(PaymentTransactionModel paymentTransactionModel,
UserModel userModel,
CardInfo cardInfo,
BigDecimal amount)
Attaches PaymentInfo to the assigned PaymentTransactionModel instance by using the configured
PaymentInfoCreatorStrategy.
|
PaymentTransactionEntryModel |
authorize(OrderModel order,
CardInfo card)
Deprecated.
|
PaymentTransactionEntryModel |
authorize(PaymentTransactionModel transaction,
BigDecimal amount,
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,
BigDecimal amount,
Currency currency,
AddressModel deliveryAddress,
String subscriptionID)
authorize payment
|
PaymentTransactionEntryModel |
authorize(PaymentTransactionModel transaction,
BigDecimal amount,
Currency currency,
AddressModel deliveryAddress,
String subscriptionID,
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(String merchantTransactionCode,
BigDecimal amount,
Currency currency,
AddressModel deliveryAddress,
AddressModel paymentAddress,
CardInfo card)
authorize payment
|
PaymentTransactionEntryModel |
authorize(String merchantTransactionCode,
BigDecimal amount,
Currency currency,
AddressModel deliveryAddress,
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(String merchantTransactionCode,
BigDecimal amount,
Currency currency,
AddressModel deliveryAddress,
String subscriptionID,
String cv2,
String paymentProvider)
authorize payment
|
protected PaymentTransactionEntryModel |
authorizeInternal(PaymentTransactionModel transaction,
BigDecimal amount,
Currency currency,
BillingInfo shippingInfo,
CardInfo card,
String subscriptionID,
String cv2,
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(String merchantTransactionCode,
String paymentProvider,
Currency currency,
AddressModel paymentAddress,
CardInfo card)
Creates a subscription at the payment provider side and stores sensitive data there.
|
PaymentTransactionEntryModel |
deleteSubscription(String merchantTransactionCode,
String subscriptionID,
String paymentProvider)
Deletes the subscription at the payment provider.
|
CardPaymentService |
getCardPaymentService() |
String |
getNewPaymentTransactionEntryCode(PaymentTransactionModel transaction,
PaymentTransactionType paymentTransactionType)
Generate new merchant transaction code for payment transaction entries based on code for whole transaction
|
PaymentInfoCreatorStrategy |
getPaymentInfoCreator() |
PaymentTransactionModel |
getPaymentTransaction(String code)
Get
PaymentTransactionModel by code |
PaymentTransactionEntryModel |
getPaymentTransactionEntry(String code)
Get
PaymentTransactionEntryModel by code |
PaymentTransactionEntryModel |
getSubscriptionData(String merchantTransactionCode,
String subscriptionID,
String paymentProvider,
BillingInfo billingInfo,
CardInfo card)
Gets the stored card info or payment address
|
TransactionCodeGenerator |
getTransactionCodeGenerator() |
PaymentTransactionEntryModel |
partialCapture(PaymentTransactionModel transaction,
BigDecimal amount)
Take a partial capture of authorized transaction
|
PaymentTransactionEntryModel |
refundFollowOn(PaymentTransactionModel transaction,
BigDecimal amount)
Refund transaction
|
PaymentTransactionEntryModel |
refundStandalone(StandaloneRefundRequest request)
Deprecated.
|
PaymentTransactionEntryModel |
refundStandalone(String merchantTransactionCode,
BigDecimal amount,
Currency currency,
AddressModel paymentAddress,
CardInfo card)
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 merchantTransactionCode) |
PaymentTransactionEntryModel |
updateSubscription(String merchantTransactionCode,
String subscriptionID,
String paymentProvider,
AddressModel paymentAddress,
CardInfo card)
Updates the data of the subscription at the payment provider.
|
public PaymentInfoCreatorStrategy getPaymentInfoCreator()
public void setPaymentInfoCreator(PaymentInfoCreatorStrategy paymentInfoCreator)
public TransactionCodeGenerator getTransactionCodeGenerator()
public void setTransactionCodeGenerator(TransactionCodeGenerator merchantTransactionCode)
merchantTransactionCode - the merchantTransactionCode to setpublic void setCardPaymentService(CardPaymentService cardPaymentService)
cardPaymentService - the cardPaymentService to setpublic CardPaymentService getCardPaymentService()
public void setCommonI18NService(CommonI18NService commonI18NService)
public void setModelService(ModelService modelService)
modelService - the modelService to setpublic PaymentTransactionEntryModel authorize(String merchantTransactionCode, BigDecimal amount, Currency currency, AddressModel deliveryAddress, 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(String merchantTransactionCode, BigDecimal amount, Currency currency, AddressModel deliveryAddress, String subscriptionID, String cv2, String paymentProvider) throws AdapterException
PaymentServiceauthorize in interface PaymentServicemerchantTransactionCode - the transaction codeamount - the amountcurrency - the currencydeliveryAddress - the delivery address (paymentAddress is used if null)subscriptionID - the subscriptionIDAdapterExceptionpublic PaymentTransactionEntryModel authorize(String merchantTransactionCode, BigDecimal amount, 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, BigDecimal amount, Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card) throws AdapterException
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, BigDecimal amount, Currency currency, AddressModel deliveryAddress, String subscriptionID, String paymentprovider) throws AdapterException
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)AdapterExceptionpublic PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, BigDecimal amount, Currency currency, AddressModel deliveryAddress, String subscriptionID) throws AdapterException
PaymentServiceauthorize in interface PaymentServicetransaction - the payment transactionamount - the amountcurrency - the currencydeliveryAddress - the delivery address (paymentAddress is used if null)subscriptionID - the subscriptionIDAdapterExceptionprotected PaymentTransactionEntryModel authorizeInternal(PaymentTransactionModel transaction, BigDecimal amount, Currency currency, BillingInfo shippingInfo, CardInfo card, String subscriptionID, String cv2, String paymentProvider) throws AdapterException
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 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) throws AdapterException
TransactionCodeGenerator will be used
for determining the 'merchant transaction code' .authorize in interface PaymentServiceorder - the ordercard - the cardAdapterExceptionpublic PaymentTransactionEntryModel capture(PaymentTransactionModel transaction) throws AdapterException
PaymentServicecapture in interface PaymentServicetransaction - payment transactionAdapterExceptionpublic PaymentTransactionEntryModel cancel(PaymentTransactionEntryModel transaction) throws AdapterException
PaymentServicecancel in interface PaymentServicetransaction - payment transactionAdapterExceptionpublic PaymentTransactionEntryModel refundFollowOn(PaymentTransactionModel transaction, BigDecimal amount) throws AdapterException
PaymentServicerefundFollowOn in interface PaymentServicetransaction - payment transactionamount - amount to refundAdapterException@Deprecated public PaymentTransactionEntryModel refundStandalone(StandaloneRefundRequest request) throws AdapterException
PaymentServicerefundStandalone in interface PaymentServiceAdapterExceptionpublic PaymentTransactionEntryModel refundStandalone(String merchantTransactionCode, BigDecimal amount, Currency currency, AddressModel paymentAddress, CardInfo card) throws AdapterException
PaymentServicerefundStandalone in interface PaymentServicemerchantTransactionCode - any code to locate transactionamount - amount to refundcurrency - currencypaymentAddress - address to refundcard - card to refundAdapterExceptionpublic PaymentTransactionEntryModel partialCapture(PaymentTransactionModel transaction, BigDecimal amount) throws AdapterException
PaymentServicepartialCapture in interface PaymentServicetransaction - authorized transactionamount - value to captureAdapterExceptionpublic PaymentTransactionModel getPaymentTransaction(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(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, BigDecimal amount)
attachPaymentInfo in interface PaymentServicepaymentTransactionModel - the payment transactionuserModel - the usercardInfo - the card infoamount - the amountpublic NewSubscription createSubscription(PaymentTransactionModel transaction, AddressModel paymentAddress, CardInfo card) throws AdapterException
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 txnAdapterExceptionpublic NewSubscription createSubscription(String merchantTransactionCode, String paymentProvider, Currency currency, AddressModel paymentAddress, CardInfo card) throws AdapterException
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 txnAdapterExceptionpublic PaymentTransactionEntryModel updateSubscription(String merchantTransactionCode, String subscriptionID, String paymentProvider, AddressModel paymentAddress, CardInfo card) throws AdapterException
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 nullAdapterExceptionpublic PaymentTransactionEntryModel getSubscriptionData(String merchantTransactionCode, String subscriptionID, String paymentProvider, BillingInfo billingInfo, CardInfo card) throws AdapterException
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 DTOAdapterExceptionpublic PaymentTransactionEntryModel deleteSubscription(String merchantTransactionCode, String subscriptionID, String paymentProvider) throws AdapterException
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.AdapterExceptionpublic void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Copyright © 2017 SAP SE. All Rights Reserved.