commercetools / commercetools-payment-integration-java

Module to handle payment transactions
Apache License 2.0
6 stars 4 forks source link

Consider extension of CreatePaymentTransactionDataBuilder with optional payment object and not its ID only #24

Open butenkor opened 8 years ago

butenkor commented 8 years ago

In general front end will mostly load payment object in order to provide payment ID to CreatePaymentTransactionDataBuilder. This payment ID is used in turn by PaymentAdapterServiceImpl to load it again from API. We could save an additional unnecessary request by providing optional payment object within CreatePaymentTransactionDataBuilder. If payment object is set than existing object is reused otherwise paymentRef is used to refetch payment object.