Created
August 14, 2013 19:00
-
-
Save msulima/6234359 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Transaction createTransaction(Sale sale, Customer customer) { | |
Transaction transaction = new Transaction(); | |
populatePaymentDetails(transaction, sale, customer); | |
populateCustomerDetails(transaction, customer); | |
sale.setProcessed(true); | |
return transaction; | |
} | |
private void populatePaymentDetails(Transaction transaction, Sale sale, Customer customer) { | |
transaction.setPayerId(customer.getId()); | |
transaction.setCurrency(sale.getCurrency()); | |
transaction.setAmount(sale.getAmount()); | |
} | |
private void populateCustomerDetails(Transaction transaction, Customer customer) { | |
/** ... */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment