Skip to content

Payload Chart

Shesh Ghimire edited this page Jan 11, 2026 · 5 revisions

Payload that follows PaymentCardFactory Schema.

Payload With Keys and Without Keys demonstrates three of the common Payment Card types.

Optional Key Usage

Optional keys whose values are provided in payload examples (With Keys and Without Keys) below:

Card Name Schema Key Schema Value Getter Method
Diners Club checkLuhn false $card->needsLuhnCheck(): false
Visa type Debit Card $card->getType(): 'Debit Card'

Without Keys

PHP Indexed Array of Associative Arrays JSON Array of Objects
[
    [
        'alias'      => 'american-express',
        'name'       => 'American Express',
        'code'       => ['name' => "CID", 'size' => 4],
        'breakpoint' => [4, 10],
        'length'     => [15],
        'idRange'    => [34, 37],
    ],
    [
        'alias'      => 'diners-club',
        'name'       => 'Diners Club',
        'checkLuhn'  => false,
        'code'       => ['name' => "CVV", 'size' => 3],
        'breakpoint' => [4, 10],
        'length'     => [16, [14, 19]],
        'idRange'    => [55, 30, 36, 38, 39],
    ],
    [
        'alias'      => 'visa',
        'name'       => 'Visa',
        'type'       => PaymentCardFactory::DEBIT_CARD,
        'code'       => ['name' => "CVV", 'size' => 3],
        'breakpoint' => [4, 8, 12],
        'length'     => [13, 16, 19],
        'idRange'    => [4],
    ],
];
[
  {
    "alias": "american-express",
    "name": "American Express",
    "code": {"name": "CID", "size": 4},
    "breakpoint": [4, 10],
    "length": [15],
    "idRange": [34, 37]
  },
  {
    "alias": "diners-club",
    "name": "Diners Club",
    "checkLuhn": false,
    "code": {"name": "CVV", "size": 3},
    "breakpoint": [4, 10],
    "length": [16, [14, 19]],
    "idRange": [55, 30, 36, 38, 39]
  },
  {
    "alias": "visa",
    "name": "Visa",
    "type": "Debit Card",
    "code": {"name": "CVV", "size": 3},
    "breakpoint": [4, 8, 12],
    "length": [13, 16, 19],
    "idRange": [4]
  }
]

Getting Diners Club Card instance from factory.

$dinersClub = (new PaymentCardFactory($payload))->create(1);

With Keys

PHP Associative Array of Associative Arrays JSON Object of Objects
[
    'americanExpress' => [
        'alias'      => 'american-express',
        'name'       => 'American Express',
        'code'       => ['name' => "CID", 'size' => 4],
        'breakpoint' => [4, 10],
        'length'     => [15],
        'idRange'    => [34, 37],
    ],
    'dinersClub' => [
        'alias'      => 'diners-club',
        'name'       => 'Diners Club',
        'checkLuhn'  => false,
        'code'       => ['name' => "CVV", 'size' => 3],
        'breakpoint' => [4, 10],
        'length'     => [16, [14, 19]],
        'idRange'    => [55, 30, 36, 38, 39],
    ],
    'visa' => [
        'alias'      => 'visa',
        'name'       => 'Visa',
        'type'       => PaymentCardFactory::DEBIT_CARD,
        'code'       => ['name' => "CVV", 'size' => 3],
        'breakpoint' => [4, 8, 12],
        'length'     => [13, 16, 19],
        'idRange'    => [4],
    ],
];
{
  "americanExpress": {
    "alias": "american-express",
    "name": "American Express",
    "code": {"name": "CID", "size": 4},
    "breakpoint": [4, 10],
    "length": [15],
    "idRange": [34, 37]
  },
  "dinersClub": {
    "alias": "diners-club",
    "name": "Diners Club",
    "checkLuhn": false,
    "code": {"name": "CVV", "size": 3},
    "breakpoint": [4, 10],
    "length": [16, [14, 19]],
    "idRange": [55, 30, 36, 38, 39]
  },
  "visa": {
    "alias": "visa",
    "name": "Visa",
    "type": "Debit Card",
    "code": {"name": "CVV", "size": 3},
    "breakpoint": [4, 8, 12],
    "length": [13, 16, 19],
    "idRange": [4]
  }

Getting Diners Club Card instance from factory.

$dinersClub = (new PaymentCardFactory($payload))->create('dinersClub');

Clone this wiki locally