Class OrderPaymentServiceImpl
- All Implemented Interfaces:
OrderPaymentService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AddressServiceprotected CustomerPaymentServiceprotected OrderPaymentDao -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create aCustomerPaymenttoken for the passed in Customer given aPaymentTransaction.createOrderPaymentFromCustomerPayment(Order order, CustomerPayment customerPayment, Money amount) Create anOrderPaymentwith a singlePaymentTransactionType.UNCONFIRMEDPaymentTransactioninitialized with the passed in amount and order.voiddelete(OrderPayment payment) Deletes a payment from the system.voidpopulateCustomerPaymentToken(CustomerPayment customerPayment, PaymentTransaction transaction) Will attempt to populate theCustomerPayment.setPaymentToken(String)by looking at thePaymentTransaction.getAdditionalFields()for keyPaymentAdditionalFieldType.TOKEN.readPaymentById(Long paymentId) readPaymentsForOrder(Order order) readTransactionById(Long transactionId) save(OrderPayment payment) save(PaymentTransaction transaction)
-
Field Details
-
paymentDao
-
customerPaymentService
-
addressService
-
-
Constructor Details
-
OrderPaymentServiceImpl
public OrderPaymentServiceImpl()
-
-
Method Details
-
save
- Specified by:
savein interfaceOrderPaymentService
-
save
@Transactional("blTransactionManager") public PaymentTransaction save(PaymentTransaction transaction) - Specified by:
savein interfaceOrderPaymentService
-
readPaymentById
- Specified by:
readPaymentByIdin interfaceOrderPaymentService
-
readPaymentsForOrder
- Specified by:
readPaymentsForOrderin interfaceOrderPaymentService
-
create
- Specified by:
createin interfaceOrderPaymentService
-
delete
Description copied from interface:OrderPaymentServiceDeletes a payment from the system. Note that this is just a soft-delete and simply archives this entity- Specified by:
deletein interfaceOrderPaymentService
-
createTransaction
- Specified by:
createTransactionin interfaceOrderPaymentService
-
readTransactionById
- Specified by:
readTransactionByIdin interfaceOrderPaymentService
-
createOrderPaymentFromCustomerPayment
@Transactional("blTransactionManager") public OrderPayment createOrderPaymentFromCustomerPayment(Order order, CustomerPayment customerPayment, Money amount) Description copied from interface:OrderPaymentServiceCreate an
OrderPaymentwith a singlePaymentTransactionType.UNCONFIRMEDPaymentTransactioninitialized with the passed in amount and order.Used typically during the payment flow of checkout, where a customer intends to pay for their order with a saved payment token.
- Specified by:
createOrderPaymentFromCustomerPaymentin interfaceOrderPaymentService- Returns:
-
createCustomerPaymentFromPaymentTransaction
@Transactional("blTransactionManager") public CustomerPayment createCustomerPaymentFromPaymentTransaction(PaymentTransaction transaction) Description copied from interface:OrderPaymentServiceCreate a
CustomerPaymenttoken for the passed in Customer given aPaymentTransaction. This assumes that the token and any additional request attributes needed to do another transaction for this specific gateway has already been persisted to thePaymentTransaction.getAdditionalFields()map. Specifically, thePaymentAdditionalFieldType.TOKENhas been set.Used typically during the complete checkout flow when a token needs to be saved from a "confirmed" transaction
- Specified by:
createCustomerPaymentFromPaymentTransactionin interfaceOrderPaymentService- Returns:
-
populateCustomerPaymentToken
public void populateCustomerPaymentToken(CustomerPayment customerPayment, PaymentTransaction transaction) Description copied from interface:OrderPaymentServiceWill attempt to populate the
CustomerPayment.setPaymentToken(String)by looking at thePaymentTransaction.getAdditionalFields()for keyPaymentAdditionalFieldType.TOKEN.Usually used during a checkout flow when there is a direct response from the gateway (e.g. transparent redirect).
- Specified by:
populateCustomerPaymentTokenin interfaceOrderPaymentService
-