Class PosCapability.Builder
java.lang.Object
org.jpos.iso.PosCapability.Builder
- Enclosing class:
PosCapability
Fluent builder for
PosCapability.
All numeric capacity fields default to 0 (not capable).
Track 3 rewrite and card capture default to false.
PIN input length defaults to 0.
Reading and verification capability bits default to all-zero (no capabilities declared).
-
Method Summary
Modifier and TypeMethodDescriptionapprovalCodeLength(int length) Sets the maximum approval code length (sub-field 27-3, N1, range 0–9).build()Builds thePosCapability.cardAcceptorDisplayLength(int length) Sets the maximum card acceptor display data length (sub-field 27-7, N3, range 0–999).cardAcceptorReceiptLength(int length) Sets the maximum card acceptor receipt data length (sub-field 27-5, N3, range 0–999).cardCaptureCapable(boolean capable) Sets the card capture capability (sub-field 27-10).cardholderDisplayLength(int length) Sets the maximum cardholder display data length (sub-field 27-6, N3, range 0–999).cardholderReceiptLength(int length) Sets the maximum cardholder receipt data length (sub-field 27-4, N3, range 0–999).iccScriptDataLength(int length) Sets the maximum ICC scripts data length (sub-field 27-8, N3, range 0–999).pinInputLength(int length) Sets the maximum PIN input length capability (sub-field 27-11, binary, range 0–255).Sets a card reading capability bit (sub-field 27-1).track3RewriteCapable(boolean capable) Sets the track 3 magnetic stripe rewrite capability (sub-field 27-9).Sets a cardholder verification capability bit (sub-field 27-2).
-
Method Details
-
readingCapability
Sets a card reading capability bit (sub-field 27-1). Multiple capabilities may be set by calling this method repeatedly.- Parameters:
method- the reading method to declare as supported- Returns:
- this builder
-
verificationCapability
Sets a cardholder verification capability bit (sub-field 27-2). Multiple capabilities may be set by calling this method repeatedly.- Parameters:
method- the verification method to declare as supported- Returns:
- this builder
-
approvalCodeLength
Sets the maximum approval code length (sub-field 27-3, N1, range 0–9).- Parameters:
length- approval code length- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–9
-
cardholderReceiptLength
Sets the maximum cardholder receipt data length (sub-field 27-4, N3, range 0–999).- Parameters:
length- receipt length; 0 = not capable- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–999
-
cardAcceptorReceiptLength
Sets the maximum card acceptor receipt data length (sub-field 27-5, N3, range 0–999).- Parameters:
length- receipt length; 0 = not capable- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–999
-
cardholderDisplayLength
Sets the maximum cardholder display data length (sub-field 27-6, N3, range 0–999).- Parameters:
length- display length; 0 = not capable- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–999
-
cardAcceptorDisplayLength
Sets the maximum card acceptor display data length (sub-field 27-7, N3, range 0–999).- Parameters:
length- display length; 0 = not capable- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–999
-
iccScriptDataLength
Sets the maximum ICC scripts data length (sub-field 27-8, N3, range 0–999).- Parameters:
length- ICC script length in bytes; 0 = not capable- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–999
-
track3RewriteCapable
Sets the track 3 magnetic stripe rewrite capability (sub-field 27-9).- Parameters:
capable-trueif the terminal can rewrite track 3- Returns:
- this builder
-
cardCaptureCapable
Sets the card capture capability (sub-field 27-10).- Parameters:
capable-trueif the terminal can capture (retain) cards- Returns:
- this builder
-
pinInputLength
Sets the maximum PIN input length capability (sub-field 27-11, binary, range 0–255).- Parameters:
length- maximum PIN length the PIN pad accepts- Returns:
- this builder
- Throws:
IllegalArgumentException- iflengthis outside 0–255
-
build
Builds thePosCapability.- Returns:
- a new
PosCapabilitybacked by a copy of the accumulated state
-