react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
38 lines (32 loc) • 1.15 kB
JavaScript
/// Auto-generated. Modifications will be overwritten.
/// Generated from core/document-schemas/CreditCardDocumentModel.yaml
/// All possible root document types.
export const CreditCardDocumentType = 'CreditCard';
/** Credit Card Document */
export class CreditCard {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return CreditCardDocumentType;
}
/** The card number of the recognized credit card */
get cardNumber() {
return this.document.fields.find(f => f.type.name === 'CardNumber');
}
/** The cardholder name of the recognized credit card */
get cardholderName() {
return this.document.fields.find(f => f.type.name === 'CardholderName');
}
/** The expiry date of the recognized credit card */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
}
//# sourceMappingURL=CreditCardDocumentModel.js.map