Interface OrderPaymentService
- All Known Implementing Classes:
OrderPaymentServiceImpl
-
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)
-
Method Details
-
save
-
save
-
readPaymentById
-
readPaymentsForOrder
-
create
OrderPayment create() -
delete
Deletes a payment from the system. Note that this is just a soft-delete and simply archives this entity -
createTransaction
PaymentTransaction createTransaction() -
readTransactionById
-
createOrderPaymentFromCustomerPayment
OrderPayment createOrderPaymentFromCustomerPayment(Order order, CustomerPayment customerPayment, Money amount) Create 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.
- Parameters:
order-customerPayment-amount-- Returns:
-
createCustomerPaymentFromPaymentTransaction
Create 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
- Parameters:
transaction-- Returns:
-
populateCustomerPaymentToken
Will 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).
- Parameters:
customerPayment-transaction-
-