diff options
Diffstat (limited to 'sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main')
3 files changed, 10 insertions, 8 deletions
diff --git a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/java/scatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/java/scatours/payment/creditcard/impl/CreditCardPaymentImpl.java index 54a6f722de..6605c23bcd 100644 --- a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/java/scatours/payment/creditcard/impl/CreditCardPaymentImpl.java +++ b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/java/scatours/payment/creditcard/impl/CreditCardPaymentImpl.java @@ -45,6 +45,7 @@ public class CreditCardPaymentImpl implements CreditCardPayment { }
public String authorize(CreditCardDetailsType creditCard, float amount) {
+ float charge = amount;
if (creditCard != null) {
try {
print(creditCard);
@@ -58,12 +59,13 @@ public class CreditCardPaymentImpl implements CreditCardPayment { + " for amount "
+ amount
+ " EUR");
- amount = convertCurrency(amount);
+ charge = convertCurrency(amount);
} else {
System.out.println("Credit card is null");
+ return "FAILURE: Invalid Credit Card Number";
}
- return "SUCCESS: Confirmation Code=" + UUID.randomUUID() + " ($" + amount + ")";
+ return "SUCCESS: Auth Code=" + UUID.randomUUID() + " (EUR"+amount+"->USD" + charge + ")";
}
private void print(CreditCardDetailsType creditCard) throws JAXBException, PropertyException {
diff --git a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/CreditCardPayment.wsdl b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/CreditCardPayment.wsdl index a2e882d2d2..d50a63ac42 100644 --- a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/CreditCardPayment.wsdl +++ b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/CreditCardPayment.wsdl @@ -108,7 +108,7 @@ </wsdl:binding>
<wsdl:service name="CreditCardPaymentService">
<wsdl:port name="CreditCardPaymentPort" binding="tns:CreditCardPaymentBinding">
- <soap:address location="http://localhost:8086/CreditCardPayment" />
+ <soap:address location="http://localhost:8082/CreditCardPayment" />
</wsdl:port>
</wsdl:service>
diff --git a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/OSGI-INF/sca/bundle.composite b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/OSGI-INF/sca/bundle.composite index 0bb37a02e8..7b12b36368 100644 --- a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/OSGI-INF/sca/bundle.composite +++ b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/main/resources/OSGI-INF/sca/bundle.composite @@ -26,21 +26,21 @@ <component name="CreditCardPaymentComponent">
<tuscany:implementation.osgi bundleSymbolicName="scatours.creditcard.payment" bundleVersion="1.0.0" />
<service name="CreditCardPayment">
- <binding.ws uri="http://localhost:8086/CreditCardPayment"/>
+ <binding.ws uri="http://localhost:8082/CreditCardPayment"/>
</service>
<reference name="currencyConverter">
- <tuscany:binding.rmi uri="rmi://localhost:8085/CurrencyConverter"/>
+ <tuscany:binding.rmi uri="rmi://localhost:8089/CurrencyConverter"/>
</reference>
</component>
<!-- Other components can be declared here too -->
-
+<!--
<component name="CurrencyConverterComponent">
<implementation.java class="scatours.currency.impl.CurrencyConverterImpl" />
<service name="CurrencyConverter">
- <tuscany:binding.rmi uri="rmi://localhost:8085/CurrencyConverter" />
+ <tuscany:binding.rmi uri="rmi://localhost:8089/CurrencyConverter" />
</service>
</component>
-
+-->
</composite>
|