Package de.hybris.platform.payment
Interface PaymentService
-
- All Known Subinterfaces:
ChinesePaymentService
- All Known Implementing Classes:
DefaultAlipayPaymentService,DefaultPaymentServiceImpl,DefaultWeChatPayPaymentService
public interface PaymentServiceservice can serve payments based on orders
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidattachPaymentInfo(PaymentTransactionModel paymentTransactionModel, UserModel userModel, CardInfo cardInfo, java.math.BigDecimal amount)Attaches PaymentInfo to the assigned PaymentTransactionModel instance.PaymentTransactionEntryModelauthorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)authorize paymentPaymentTransactionEntryModelauthorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)authorize paymentPaymentTransactionEntryModelauthorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID, java.lang.String paymentProvider)authorize paymentPaymentTransactionEntryModelauthorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)authorize paymentPaymentTransactionEntryModelauthorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)authorize paymentPaymentTransactionEntryModelauthorize(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 paymentPaymentTransactionEntryModelcancel(PaymentTransactionEntryModel transaction)Cancel paymentPaymentTransactionEntryModelcapture(PaymentTransactionModel transaction)capture paymentNewSubscriptioncreateSubscription(PaymentTransactionModel transaction, AddressModel paymentAddress, CardInfo card)Creates a subscription at the payment provider side and stores sensitive data there.NewSubscriptioncreateSubscription(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.PaymentTransactionEntryModeldeleteSubscription(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider)Deletes the subscription at the payment provider.java.lang.StringgetNewPaymentTransactionEntryCode(PaymentTransactionModel transaction, PaymentTransactionType paymentTransactionType)A new code for aPaymentTransactionEntryModelbased on thePaymentTransactionModelassociated to it and the number of entries.PaymentTransactionModelgetPaymentTransaction(java.lang.String code)GetPaymentTransactionModelby codePaymentTransactionEntryModelgetPaymentTransactionEntry(java.lang.String code)GetPaymentTransactionEntryModelby codePaymentTransactionEntryModelgetSubscriptionData(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider, BillingInfo billingInfo, CardInfo card)Gets the stored card info or payment addressPaymentTransactionEntryModelpartialCapture(PaymentTransactionModel transaction, java.math.BigDecimal amount)Take a partial capture of authorized transactionPaymentTransactionEntryModelrefundFollowOn(PaymentTransactionModel transaction, java.math.BigDecimal amount)Refund transactionPaymentTransactionEntryModelrefundStandalone(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)default PaymentTransactionEntryModelrefundStandalone(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)PaymentTransactionEntryModelupdateSubscription(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.
-
-
-
Method Detail
-
authorize
PaymentTransactionEntryModel authorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)
authorize payment- Parameters:
merchantTransactionCode- the transaction codeamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)subscriptionID- the subscriptionID- Returns:
- Payment Transaction Entry
-
authorize
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- Parameters:
merchantTransactionCode- the transaction codeamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)subscriptionID- the subscriptionIDcv2- card verification valuepaymentProvider- code of payment provider- Returns:
- Payment Transaction Entry
-
authorize
PaymentTransactionEntryModel authorize(java.lang.String merchantTransactionCode, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)
authorize payment- Parameters:
merchantTransactionCode- the transaction codeamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)paymentAddress- the payment addresscard- the card- Returns:
- Payment Transaction Entry
-
authorize
PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID, java.lang.String paymentProvider)
authorize payment- Parameters:
transaction- the payment transactionamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)subscriptionID- the subscriptionIDpaymentProvider- code of payment provider- Returns:
- Payment Transaction Entry
-
authorize
PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, java.lang.String subscriptionID)
authorize payment- Parameters:
transaction- the payment transactionamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)subscriptionID- the subscriptionID- Returns:
- Payment Transaction Entry
-
authorize
PaymentTransactionEntryModel authorize(PaymentTransactionModel transaction, java.math.BigDecimal amount, java.util.Currency currency, AddressModel deliveryAddress, AddressModel paymentAddress, CardInfo card)
authorize payment- Parameters:
transaction- the payment transactionamount- the amountcurrency- the currencydeliveryAddress- the delivery address (paymentAddress is used if null)paymentAddress- the payment addresscard- the card- Returns:
- Payment Transaction Entry
-
capture
PaymentTransactionEntryModel capture(PaymentTransactionModel transaction)
capture payment- Parameters:
transaction- payment transaction- Returns:
- payment transaction entry
-
cancel
PaymentTransactionEntryModel cancel(PaymentTransactionEntryModel transaction)
Cancel payment- Parameters:
transaction- payment transaction- Returns:
- payment transaction entry
-
refundFollowOn
PaymentTransactionEntryModel refundFollowOn(PaymentTransactionModel transaction, java.math.BigDecimal amount)
Refund transaction- Parameters:
transaction- payment transactionamount- amount to refund- Returns:
- payment transaction entry
-
refundStandalone
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)- Parameters:
merchantTransactionCode- any code to locate transactionamount- amount to refundcurrency- currency, used for refundingpaymentAddress- address to refundcard- card to refund- Returns:
- payment transaction entry
-
refundStandalone
default 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)- Parameters:
merchantTransactionCode- any code to locate transactionamount- amount to refundcurrency- currency, used for refundingpaymentAddress- address to refundcard- card to refundproviderName- name of the payment providersubscriptionId- subscription identifier- Returns:
- payment transaction entry
-
partialCapture
PaymentTransactionEntryModel partialCapture(PaymentTransactionModel transaction, java.math.BigDecimal amount)
Take a partial capture of authorized transaction- Parameters:
transaction- authorized transactionamount- value to capture- Returns:
- payment transaction entry
-
getPaymentTransaction
PaymentTransactionModel getPaymentTransaction(java.lang.String code)
GetPaymentTransactionModelby code- Parameters:
code- the code of thePaymentTransactionModelwe were looking for- Returns:
- the
PaymentTransactionModel
-
getPaymentTransactionEntry
PaymentTransactionEntryModel getPaymentTransactionEntry(java.lang.String code)
GetPaymentTransactionEntryModelby code- Parameters:
code- the code of thePaymentTransactionModelwe were looking for- Returns:
- the instance of
PaymentTransactionEntryModel
-
attachPaymentInfo
void attachPaymentInfo(PaymentTransactionModel paymentTransactionModel, UserModel userModel, CardInfo cardInfo, java.math.BigDecimal amount)
Attaches PaymentInfo to the assigned PaymentTransactionModel instance.- Parameters:
paymentTransactionModel- the payment transactionuserModel- the usercardInfo- the card infoamount- the amount expressed asBigDecimal
-
createSubscription
NewSubscription createSubscription(PaymentTransactionModel transaction, AddressModel paymentAddress, CardInfo card)
Creates a subscription at the payment provider side and stores sensitive data there. Future payment authorization and refundStandalone calls will not have to provide the sensitive information, subscriptionID would be sufficient. Call this method after a successful authorize txn and provide THE SAME billing and card info. Please note: the card and billing info is not saved in the returning PaymentTransactionEntryModel from authorize method call ON PURPOSE.- Parameters:
transaction- a previous recent successful authorize payment transactionpaymentAddress- the same billing address as for the authorize txncard- the same card as for the authorize txn- Returns:
- instance of
NewSubscription
-
createSubscription
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. Future payment authorization and refundStandalone calls will not have to provide the sensitive information, subscriptionID would be sufficient. This method does not need an authorized payment transaction, the authorization is expected to be done implicitly by the payment provider.- Parameters:
merchantTransactionCode- 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 txn- Returns:
- new subscription object (instance of
NewSubscription)
-
updateSubscription
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.- Parameters:
merchantTransactionCode- the transactionCodesubscriptionID- the subscription IDpaymentProvider- the paymentProvider who holds the subscription. You get this value from thePaymentTransactionModelof 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 null- Returns:
- instance of
PaymentTransactionEntryModel
-
getSubscriptionData
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- Parameters:
merchantTransactionCode- the transactionCodesubscriptionID- the subscription IDpaymentProvider- the paymentProvider who holds the subscription. You get this value from thePaymentTransactionModelof 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 DTO- Returns:
- instance of
PaymentTransactionEntryModel
-
deleteSubscription
PaymentTransactionEntryModel deleteSubscription(java.lang.String merchantTransactionCode, java.lang.String subscriptionID, java.lang.String paymentProvider)
Deletes the subscription at the payment provider. Warning: Deleting a customer profile is permanent. You cannot recover a deleted customer profile.- Parameters:
merchantTransactionCode- the transactionCodesubscriptionID- the subscription IDpaymentProvider- the paymentProvider who holds the subscription. You get this value from thePaymentTransactionModelof the createSubscription command. You might also have just one payment provider in your implementation.- Returns:
- instance of
PaymentTransactionEntryModel
-
getNewPaymentTransactionEntryCode
java.lang.String getNewPaymentTransactionEntryCode(PaymentTransactionModel transaction, PaymentTransactionType paymentTransactionType)
A new code for aPaymentTransactionEntryModelbased on thePaymentTransactionModelassociated to it and the number of entries.- Parameters:
transaction- An associated Payment transactionpaymentTransactionType- A type of entry.- Returns:
- A new unique code withing a transaction context.
-
-