Browse project documentation

Algorithms & Attribution

Pardakhtv1.0.0-beta.4View sourceEnglish / Persian

Luhn Algorithm

The CardNumber class uses the Luhn algorithm (ISO/IEC 7812-1) to validate Iranian bank card numbers. This is the same checksum algorithm used worldwide for credit/debit card validation.

IBAN Validation (ISO 13616)

The Sheba class validates Iranian IBANs using the ISO 13616 mod-97 checksum algorithm. The implementation handles large numbers by processing the numeric string in chunks to avoid integer overflow.

Bank Identification Numbers (BIN)

Card-to-bank mapping uses publicly available BIN (Bank Identification Number) tables for Iranian banks. The first 6 digits of a card number identify the issuing bank.

Sheba Bank Codes

Sheba-to-bank mapping uses the bank code embedded in positions 5-7 of the IBAN (after the IR prefix and check digits). These codes are assigned by the Central Bank of Iran (CBI).

Gateway API Documentation

Each gateway implementation follows its respective official API documentation:

GatewayProtocolAPI Provider
Mellat (Behpardakht)SOAPBehpardakht Mellat
Saman (Sep)SOAPSaman Electronic Payment
Parsian (Pec)SOAPParsian E-Commerce
SadadRESTBank Melli Iran
PasargadRESTBank Pasargad
ZarinpalRESTZarinpal
IDPayRESTIDPay
ZibalRESTZibal
Pay.irRESTPay.ir
NextPayRESTNextPay
VandarRESTVandar
SizpayRESTSizpay

License

Pardakht is released under the MIT License.

Search documentation

Search across all projects. Close this window to return to your guide.

Tab to navigate · Enter to openEsc to close