Module: Pedicel::Validator

Defined in:
lib/pedicel/validator.rb

Overview

Validations for Apple Pay Payment Token and associated data: developer.apple.com/library/content/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html This purposefully only does syntactic validation (as opposed to semantic).

Defined Under Namespace

Modules: InstanceMethods Classes: Error, Token, TokenContract, TokenData, TokenDataContract, TokenDataPaymentDataContract, TokenHeaderContract

Constant Summary collapse

CUSTOM_ERRORS =
{
  is_base64:          'must be Base64',
  is_hex:             'must be hex',
  is_pan:             'must be a pan',
  is_yymmdd:          'must be formatted YYMMDD',
  is_ec_public_key:   'must be an EC public key',
  is_pkcs7_signature: 'must be a PKCS7 Signature',
  is_eci:             'must be an ECI',
  is_hex_sha256:      'must be a hex-encoded SHA-256',
  is_base64_sha256:   'must be a Base64-encoded SHA-256',
  is_iso4217_numeric: 'must be an ISO 4217 numeric code',
}.freeze
TokenHeaderSchema =
TokenHeaderContract.new
TokenSchema =
TokenContract.new
TokenDataPaymentDataSchema =
TokenDataPaymentDataContract.new
TokenDataSchema =
TokenDataContract.new