summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-09 20:56:27 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-09 20:56:27 +0000
commitefbe10d638749023e99ede390e6a4c38b791f18f (patch)
tree6e4ad1809a79288dbce729773880eb86727e2c1d /sandbox
parentfe69aac2897cb85aeac2ee593e540aec9c6b4d46 (diff)
Add property to component
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@792687 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/travelsample/contributions/payment-spring-contribution/src/main/java/payment/PaymentImpl.java7
-rw-r--r--sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/Payment-context.xml1
-rw-r--r--sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/payment.composite1
3 files changed, 9 insertions, 0 deletions
diff --git a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/java/payment/PaymentImpl.java b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/java/payment/PaymentImpl.java
index 48f829ae0f..d3bcb94053 100644
--- a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/java/payment/PaymentImpl.java
+++ b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/java/payment/PaymentImpl.java
@@ -31,6 +31,7 @@ public class PaymentImpl implements Payment {
private CreditCardPayment creditCardPayment;
private EmailGateway emailGateway;
+ private float transactionFee;
public void setCreditCardPayment(CreditCardPayment creditCardPayment) {
this.creditCardPayment = creditCardPayment;
@@ -40,6 +41,10 @@ public class PaymentImpl implements Payment {
this.emailGateway = emailGateway;
}
+ public void setTransactionFee(Float transactionFee) {
+ this.transactionFee = transactionFee;
+ }
+
public String makePaymentMember(String customerId, float amount) {
ObjectFactory objectFactory = new ObjectFactory();
@@ -49,6 +54,8 @@ public class PaymentImpl implements Payment {
ccOwner.setName(customerId);
ccDetails.setCardOwner(ccOwner);
+ amount += transactionFee;
+
String status = creditCardPayment.authorize(ccDetails, amount);
scatours.emailgateway.ObjectFactory emailFactory = new scatours.emailgateway.ObjectFactory();
diff --git a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/Payment-context.xml b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/Payment-context.xml
index e786e15d55..976a24ce3a 100644
--- a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/Payment-context.xml
+++ b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/Payment-context.xml
@@ -26,6 +26,7 @@
<bean id="Payment" class="payment.PaymentImpl">
<property name="creditCardPayment" ref="creditCardPaymentReference"/>
<property name="emailGateway" ref="EmailGateway"/>
+ <property name="transactionFee" value="0.5f"/>
</bean>
<bean id="EmailGateway" class="scatours.emailgateway.EmailGatewayImpl">
diff --git a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/payment.composite b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/payment.composite
index 9035e712d0..f192bf9659 100644
--- a/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/payment.composite
+++ b/sandbox/travelsample/contributions/payment-spring-contribution/src/main/resources/payment.composite
@@ -31,6 +31,7 @@
<reference name="creditCardPaymentReference">
<binding.ws uri="http://localhost:8082/CreditCardPayment"/>
</reference>
+ <property name="transactionFee">1.23</property>
</component>
</composite>