@paylike/descriptor
v1.0.0
Published
A small library exposing descriptor validations
Downloads
2
Keywords
Readme
Descriptor
Everything you need to know about the descriptor property in Paylike
Install
npm install --save @paylike/descriptor
Use
var descriptor = require('@paylike/descriptor');
descriptor.isValid('paylike.io'); // true
descriptor.isValid('£'); // false
descriptor.errorMessage
descriptor.maxLength
descriptor.regex
var descriptor = require('@paylike/descriptor');
var $input = document.querySelector('input.descriptor');
$input.pattern = descriptor.regex.source;
$input.maxLength = descriptor.maxLength;
What is it?
The descriptor is shown on a credit card bill, a bank statement or in an online banking account as the text accompanying the charged amount.
How is it validated?
It can only have a length of 22 or less
It can only contain ASCII printable characters (see charaters
a-z A-Z 0-9 ! # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~
Where is it used in Paylike?
A descriptor is set in the following places:
- On your merchant account
- On a transaction for the reservation
- On each capture of a transaction
The descriptor on the account (1) acts as a default if you do not supply a descriptor for the transaction (2).
If you omit the descriptor for a capture (3) it will default to that on the transaction (2).
As such, only the merchant account's descriptor is mandatory.