Math.IsValidCC
--------------

Verifies a credit card number.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Math](component_Math.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Math.IsValidCC"; Text ) 

**MBS**( **"Math.IsValidCC";** /\* Verifies a credit card number. \*/  
**$Text**) /\* The text with the number.e.g. "12345678" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The text with the number. | "12345678" |

### Result

Returns 1 on success or 0 on failure.

### Description

Verifies a credit card number.  
This function implements the Luhn algorithm. This is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers in US and Canadian Social Insurance Numbers.   
  
If this function returns 0, you can be sure the number is not valid. But if the function returns 1, you may want to check the number online with some database.  
### Example Databases

- [Math/Validate CC numbers](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Math/Validate%20CC%20numbers.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS Filemaker Plugin, version 3.2pr3](https://www.mbsplugins.de/archive/2013-03-05/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 18th August 2014

  
[Math.InsidePolygon](MathInsidePolygon.md) - [Math.Max](MathMax.md)

[HTML Version](MathIsValidCC.shtml)