Monday, April 23, 2007

[completeJava] Re: credit card authentication


--- In completeJava@yahoogroups.com, yousuf ahmed <yousuf_edu2005@...> wrote:
>
> received the message containing the solution for credit card validation..
> thanks for that.
> if we want to implement this using jsp, how should we go for it?
> thanks for all the responses.
> awaiting ur reply.
>
>
> ---------------------------------
> Check out what you're missing if you're not on Yahoo! Messenger
>
Hi,

If you want to validate credit card in JSP (means with JavaScript) you can refer

http://javascript.internet.com/forms/val-credit-card.html

http://www.braemoor.co.uk/software/creditcard.shtml

Bye,

Thirupathi B.

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Ads on Yahoo!

Learn more now.

Reach customers

searching for you.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

Re: [completeJava] Re: credit card authentication

received the message containing the solution for credit card validation..
thanks for that.
if we want to implement this using jsp, how should we go for it?
thanks for all the responses.
awaiting ur reply.


Check out what you're missing if you're not on Yahoo! Messenger

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Ads on Yahoo!

Learn more now.

Reach customers

searching for you.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

[completeJava] Re: credit card authentication


--- In completeJava@yahoogroups.com, yousuf ahmed <yousuf_edu2005@...> wrote:
>
> hello all,
> i wanted to know how credit card processing is done using java.
> plz reply.
> thanks
>
>
> ---------------------------------
> Check out what you're missing if you're not on Yahoo! Messenger
>

I Think the below code may help you

 

The CreditCardValidator

CreditCardValidator does pre-validation of credit card numbers before actually sending them off for authrorization. It is a very powerful validator that uses the Luhn algorithm to catch mistakes in credit card number input, all the way down to the user simply mistyping a single digit in the card number. As you can see, validation criteria for a validator package can be arbitrarily complex. Let's look at the source code for CreditCardValidator:

   import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JTextField; import java.util.regex.*;   /**  * A class for performing pre-validation on credit cards.  *   * @author Michael Urban  */   public class CreditCardValidator extends AbstractValidator {     public static final int MASTERCARD = 0, VISA = 1;     public static final int AMEX = 2, DISCOVER = 3, DINERS = 4;     private JDialog parent;     private Object form; 	     private static final String[] messages = {         "Not a valid number for MasterCard.",         "Not a valid number for Visa.",         "Not a valid number for American Express.",         "Not a valid number for Discover.",         "Not a valid number for Diner's Club"     }; 	     public CreditCardValidator(JDialog parent, Object form, JComponent c,         String message)      {         super(parent, c, message);         this.parent = parent;         this.form = form;     }       protected boolean validationCriteria(JComponent c) {         String number = ((JTextField)c).getText(); 		         if (number.equals("")) {             setMessage("Field cannnot be blank.");             return false;         } 		         Matcher m = Pattern.compile("[^\\d\\s.-]").matcher(number);                  if (m.find()) {             setMessage("Credit card number can only contain numbers, spaces, \"-\", and \".\"");             return false;         } 		         int type = ((CreditCardValidation)form).validateCreditCardType();         setMessage(messages[type]);         Matcher matcher = Pattern.compile("[\\s.-]").matcher(number);         number = matcher.replaceAll("");         return validate(number, type);     }       // Check that cards start with proper digits for     // selected card type and are also the right length.           private boolean validate(String number, int type) {         switch(type) { 		         case MASTERCARD:             if (number.length() != 16 ||                 Integer.parseInt(number.substring(0, 2)) < 51 ||                 Integer.parseInt(number.substring(0, 2)) > 55)             {                 return false;             }             break; 			         case VISA:             if ((number.length() != 13 && number.length() != 16) ||                     Integer.parseInt(number.substring(0, 1)) != 4)             {                 return false;             }             break; 			         case AMEX:             if (number.length() != 15 ||                 (Integer.parseInt(number.substring(0, 2)) != 34 &&                     Integer.parseInt(number.substring(0, 2)) != 37))             {                 return false;             }             break; 			         case DISCOVER:             if (number.length() != 16 ||                 Integer.parseInt(number.substring(0, 5)) != 6011)             {                 return false;             }             break; 			         case DINERS:             if (number.length() != 14 ||                 ((Integer.parseInt(number.substring(0, 2)) != 36 &&                     Integer.parseInt(number.substring(0, 2)) != 38) &&                     Integer.parseInt(number.substring(0, 3)) < 300 ||                         Integer.parseInt(number.substring(0, 3)) > 305))             {                 return false;             }             break;         }         return luhnValidate(number);     }       // The Luhn algorithm is basically a CRC type     // system for checking the validity of an entry.     // All major credit cards use numbers that will     // pass the Luhn check. Also, all of them are based     // on MOD 10. 	     private boolean luhnValidate(String numberString) {         char[] charArray = numberString.toCharArray();         int[] number = new int[charArray.length];         int total = 0; 		         for (int i=0; i < charArray.length; i++) {             number[i] = Character.getNumericValue(charArray[i]);         } 		         for (int i = number.length-2; i > -1; i-=2) {             number[i] *= 2; 			             if (number[i] > 9)                 number[i] -= 9;         } 		         for (int i=0; i < number.length; i++)             total += number[i]; 		             if (total % 10 != 0)                 return false; 		         return true;     } } 

Because we need to check the credit card type, notice that this validator requires an additional interface so that our validator can retrieve the credit card type from the form. That interface is CreditCardValidation:

   public interface CreditCardValidation {     int validateCreditCardType(); } 

Notice that in this validator, we provide context sensitive pop help messages and check for three different possible problems: Whether the the user left the credit card field blank; whether the user entered illegal characters in the credit card field; and whether or not the credit card type could be a valid credit card number for the card type in question.

CreditCardValidator is mostly just algorithm programming, so I am not going to go into details about how it works. But suffice it to say, it shows that the validation criteria we implement can be arbitrarily complex, and that in CreditCardValidator, all we had to focus on was writing the logic for our validator. We didn't haven't to worry about presenting validation results to the user at all. AbstractValidator we wrote earlier takes care of all those details for us.

 

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

[completeJava] credit card authentication

hello all,
i wanted to know how credit card processing is done using java.
plz reply.
thanks


Check out what you're missing if you're not on Yahoo! Messenger

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

[completeJava] Re: Urgent query regd Checkbox and Form submit



--- In completeJava@yahoogroups.com, "Amit Aggarwal" <sheetal.gupta@...>
wrote:
>
>
> Hi Guys,
>
> If my jsp page has 4 diff checkboxes of the form
> <input type="checkbox" name="abcCheckbox" <c:if
> test="${abcdef=='S'}">checked</c:if> > checkbox 1
>
> Based on the checkbox, I need to show certain sections of the page.
>
> How do I get the selected checkbox value on the same page,
> Without doing form submit?
>
> Please wish you could reply ASAP.
>
> Thanks,
> Sheetal Gupta
>
Hi,

If you want to display so and so section of the page based on the
selection you can make use of Client side Scripting (like JavaScript).
But if you want to show that info without submitting form then you sould
get all the required information then you store somewhere in a
javascript variable.

Other way of doing it is using AJAX.

Bye.

B. Thirupathi

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

[completeJava] Urgent query regd Checkbox and Form submit


Hi Guys,

If my jsp page has 4 diff checkboxes of the form
<input type="checkbox" name="abcCheckbox" <c:if
test="${abcdef=='S'}">checked</c:if> > checkbox 1

Based on the checkbox, I need to show certain sections of the page.

How do I get the selected checkbox value on the same page,
Without doing form submit?

Please wish you could reply ASAP.

Thanks,
Sheetal Gupta

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

Sunday, April 22, 2007

[completeJava] Systinet UDDI Registry

Systinet Registry  provides a simple and standards-based means for publishing and discovering reusable business services and SOA artifacts. Systinet Registry captures all the functional and non-functional service descriptions into a centrally managed, reliable, searchable location. Fully standards-compliant, Systinet Registry provides a highly scalable, standards-based index of services and metadata, exposing a subset of SOA information for other tools and technologies to discover in operation.

A proven and widely adopted product, Systinet Registry is the market share leader among business service registries, and is the choice of both BEA and Oracle as a key component of their SOA product strategies. Available as an independent product or as an integrated component of Systinet 2, Systinet Registry enables organizations to:

  • Publish of SOA business services - Service Providers have an easy way to publish their services and encourage reuse across and between organizations.
  • Discover of SOA business services - Service Consumers can easily discover reusable business services via intuitive and user-friendly searching and browsing.
  • Support run time look-up of services and other artifacts - providing a trusted source for run time applications to discover and bind to services as operations are invoked
  • Integrates with the Systinet 2 governance and lifecycle management platform - The market-leading registry integrates with the Systinet Information Manager to provide a complete "system of record" for all SOA information, supporting a rich set of capabilities for establishing the visibility, control, quality and trust critical for SOA success.


    (click to enlarge)

  • Ensure standards-based integration with SOA ecosystem - Systinet Registry is fully UDDI-compliant (including industry-first support for UDDI v3), leveraging this key SOA standard for service publication, categorization, and discovery. The Governance Interoperability Framework provides seamless integration with complementary tools in the SOA ecosystem, such as Web Service Management solutions.


    (click to enlarge)

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Search Ads

Get new customers.

List your web site

in Yahoo! Search.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

[completeJava] Sending Email Using Apache Commons

 

import org.apache.commons.mail .*;

public class  EmailDemo
{
 public static void main(String[] args) throws Exception
 {
  sendSimpleEmail();
 }
 public static void sendSimpleEmail(){
  SimpleEmail email = new SimpleEmail();
  email.setHostName("hostName");
  email.addTo("thirupathi@renintech.com", "Thirupathi");
  email.setFrom("thirupathi@renintech.com", "Me");
  email.setSubject("Test message");
  email.setMsg("This is a simple test of commons-email");
  email.send();
 }

 public static void sendEmailWithAttach(){
  EmailAttachment attachment = new EmailAttachment();
  attachment.setPath("EmailDemo.java");
  attachment.setDisposition(EmailAttachment.ATTACHMENT);
  attachment.setDescription("This Java Program");
  attachment.setName("Thirupathi");

  // Create the email message
  MultiPartEmail email = new MultiPartEmail();
  email.setHostName("HostName");
  email.addTo("b.thirupathi@yahoo.com", "Thirupathi");
  email.setFrom("thirupathi@renintech.com", "Me");
  email.setSubject("The picture");
  email.setMsg("Java Program for Sending email with attachment");

  // add the attachment
  email.attach(attachment);

  // send the email
  email.send();
 }
}

 

for required jar files download http-email-commons.jar file from Files Section of completeJava Group

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Need traffic?

Drive customers

With search ads

on Yahoo!

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___