cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Madu <andrewm...@gmail.com>
Subject Re: Cast type in flowscript
Date Thu, 23 Feb 2006 14:31:55 GMT
Jason,

> Can you paste the flowscript surrounding that line so we can get
> some context?

here is the code in full:

	importClass(Packages.com.paypal.sdk.exceptions.PayPalException);
	importClass(Packages.com.paypal.sdk.profiles.APIProfile);
	importClass(Packages.com.paypal.sdk.profiles.ProfileFactory);
	importClass(Packages.com.paypal.sdk.services.CallerServices);
	importPackage(Packages.com.paypal.soap.api);


         var caller = new CallerServices();
	var profile = ProfileFactory.createAPIProfile();

     	profile.setAPIUsername("andrew_api2.beyarecords.com");
     	profile.setAPIPassword("mypassword");
     	profile.setCertificateFile("/Library/jboss-4.0.2/server/default/ 
cert/paypal_cert.p12");
     	profile.setPrivateKeyPassword("mypassword");
     	profile.setEnvironment("sandbox");
     	caller.setAPIProfile(profile);
     	
         var request = new DoDirectPaymentRequestType();
	var details = new DoDirectPaymentRequestDetailsType();
	
	var creditCard = new CreditCardDetailsType();
	creditCard.setCreditCardNumber("4721930402892796");
	creditCard.setCreditCardType(CreditCardTypeType.Visa);
	creditCard.setCVV2("000");
	creditCard.setExpMonth(11);
	creditCard.setExpYear(2007);
	
	var cardOwner = new PayerInfoType();
	cardOwner.setPayerCountry(CountryCodeType.US);
	
	var address = new AddressType();
	address.setPostalCode("95101");
	address.setStateOrProvince("CA");
	address.setStreet1("123 Main St");
	address.setCountryName("US");
	address.setCountry(CountryCodeType.US);
	address.setCityName("San Jose");
	cardOwner.setAddress(address);
	
	var payerName = new PersonNameType();
	payerName.setFirstName("SDK");
	payerName.setLastName("Buyer");
	cardOwner.setPayerName(payerName);

	creditCard.setCardOwner(cardOwner);
	details.setCreditCard(creditCard);

	details.setIPAddress("12.36.5.78");
	details.setMerchantSessionId("456977");
	details.setPaymentAction(PaymentActionCodeType.Sale);
	var payment = new PaymentDetailsType();

	var orderTotal = new BasicAmountType();
	orderTotal.setCurrencyID(CurrencyCodeType.USD);
	orderTotal.set_value("20.00");
	payment.setOrderTotal(orderTotal);

	
	details.setPaymentDetails(payment);
	request.setDoDirectPaymentRequestDetails(details);
	
	var response = new DoDirectPaymentResponseType();
	response = caller.call("DoDirectPayment", request);

regards


Andrew
Mime
View raw message