From 8c049462ff6387d8c3f69f4e42a4c4b36e38a90c Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 5 Nov 2009 21:14:49 +0000 Subject: Format the code git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@833174 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscanyscatours/payment/impl/PaymentImpl.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sandbox/travelsample/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl') diff --git a/sandbox/travelsample/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sandbox/travelsample/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java index 8dfe4b2b40..a35f761dc7 100644 --- a/sandbox/travelsample/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java +++ b/sandbox/travelsample/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -33,45 +33,45 @@ public class PaymentImpl implements Payment { private CustomerRegistry customerRegistry; private EmailGateway emailGateway; private float transactionFee; - + public void setCreditCardPayment(CreditCardPayment creditCardPayment) { this.creditCardPayment = creditCardPayment; } - + public void setCustomerRegistry(CustomerRegistry customerRegistry) { this.customerRegistry = customerRegistry; - } - + } + public void setEmailGateway(EmailGateway emailGateway) { this.emailGateway = emailGateway; } - + public void setTransactionFee(Float transactionFee) { this.transactionFee = transactionFee; } - + public String makePaymentMember(String customerId, float amount) { try { Customer customer = customerRegistry.getCustomer(customerId); - + amount += transactionFee; - + String status = creditCardPayment.authorize(customer.getCreditCard(), amount); - - com.tuscanyscatours.emailgateway.ObjectFactory emailFactory - = new com.tuscanyscatours.emailgateway.ObjectFactory(); + + com.tuscanyscatours.emailgateway.ObjectFactory emailFactory = + new com.tuscanyscatours.emailgateway.ObjectFactory(); EmailType email = emailFactory.createEmailType(); email.setTitle("Payment Received"); email.setTo(customerId); - + emailGateway.sendEmail(email); - + return status; } catch (CustomerNotFoundException ex) { return "Payment failed due to " + ex.getMessage(); } catch (Throwable t) { return "Payment failed due to system error " + t.getMessage(); - } + } } } -- cgit v1.2.3