wallee
Version:
TypeScript/JavaScript client for wallee
50 lines (49 loc) • 2.57 kB
JavaScript
import { CardCryptogramCreateFromJSON, CardCryptogramCreateToJSON, } from './CardCryptogramCreate';
import { PanTypeFromJSON, PanTypeToJSON, } from './PanType';
import { RecurringIndicatorFromJSON, RecurringIndicatorToJSON, } from './RecurringIndicator';
/**
* Check if a given object implements the TokenizedCardDataCreate interface.
*/
export function instanceOfTokenizedCardDataCreate(value) {
if (!('primaryAccountNumber' in value) || value['primaryAccountNumber'] === undefined)
return false;
return true;
}
export function TokenizedCardDataCreateFromJSON(json) {
return TokenizedCardDataCreateFromJSONTyped(json, false);
}
export function TokenizedCardDataCreateFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'expiryDate': json['expiryDate'] == null ? undefined : json['expiryDate'],
'panType': json['panType'] == null ? undefined : PanTypeFromJSON(json['panType']),
'cardHolderName': json['cardHolderName'] == null ? undefined : json['cardHolderName'],
'cardVerificationCode': json['cardVerificationCode'] == null ? undefined : json['cardVerificationCode'],
'primaryAccountNumber': json['primaryAccountNumber'],
'recurringIndicator': json['recurringIndicator'] == null ? undefined : RecurringIndicatorFromJSON(json['recurringIndicator']),
'schemeTransactionReference': json['schemeTransactionReference'] == null ? undefined : json['schemeTransactionReference'],
'tokenRequestorId': json['tokenRequestorId'] == null ? undefined : json['tokenRequestorId'],
'cryptogram': json['cryptogram'] == null ? undefined : CardCryptogramCreateFromJSON(json['cryptogram']),
};
}
export function TokenizedCardDataCreateToJSON(json) {
return TokenizedCardDataCreateToJSONTyped(json, false);
}
export function TokenizedCardDataCreateToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'expiryDate': value['expiryDate'],
'panType': PanTypeToJSON(value['panType']),
'cardHolderName': value['cardHolderName'],
'cardVerificationCode': value['cardVerificationCode'],
'primaryAccountNumber': value['primaryAccountNumber'],
'recurringIndicator': RecurringIndicatorToJSON(value['recurringIndicator']),
'schemeTransactionReference': value['schemeTransactionReference'],
'tokenRequestorId': value['tokenRequestorId'],
'cryptogram': CardCryptogramCreateToJSON(value['cryptogram']),
};
}