Share via


Acquiring Credit Card Information

  Microsoft Speech Technologies Homepage

(Application Speech Control Sample)

This sample illustrates using the CreditCardNumber and CreditCardDate Application Speech Controls that get the number and the expiration date of a credit card. The sample uses the default settings of the controls with the exception that the CreditCardNumber control is enabled for Visa and MasterCard credit cards only.

The sample starts by asking which type of credit card the user wants to use. The user says either Visa or MasterCard, and then the sample confirms the credit card type. The sample then prompts the user for the credit card number. When giving the card number, the user can either say all sixteen digits of the credit card number at once, or say the number in a series of smaller groups (usually groups of four digits), according to how the numbers are displayed in space-delimited groups on an actual Visa or MasterCard credit card. After confirming the number, the sample prompts the user for the expiration date, and then confirms the date. When the sample has prompted for and confirmed all of this information, it plays a final prompt thanking the user.

  • Recognition limited to two of the six credit card types that the CreditCardNumber control recognizes.
  • Using default prompts with the CreditCardNumber and the CreditCardDate controls.

Running the Sample

  1. Open the sample. The sample prompts the user for a credit card type.
  2. Say Visa. The sample then plays a prompt asking for the credit card number.
  3. Say the following number: 4120 1234 1234 1234. The sample confirms the number, and then asks for an expiration date.
  4. Say an expiration date consisting of a month and year. The sample confirms this date. The sample then thanks the user and informs the user that the purchase will be delivered shortly.
  5. Reload the page to run the sample again, and for credit card type and number, say MasterCard and 5124 1234 1234 1234.

Remarks

  • This sample does not validate credit card numbers or dates. Consequently, the sample recognizes and confirms any sixteen-digit number provided the first four digits match the card type (see the following remark), and recognizes and confirms dates in both the future and the past.
  • The first four digits of a credit card number indicate the type of credit card. If the user says a credit card number that does not match the type of card associated with the first four digits, the CreditCardNumber control prompts the user to say the card number again.
  • The CreditCardNumber and CreditCardDate controls incorporate complex dialogue logic and are highly configurable. Refer to the documentation for a complete description of the possible configurations.

See Also

Application Speech Controls | CreditCardNumber Control | CreditCardDate Control | CreditCard ruleset (of the Voice Mode Grammar Library)