wallee
Version:
TypeScript/JavaScript client for wallee
53 lines (52 loc) • 3 kB
JavaScript
import { CardCryptogramCreateFromJSON, CardCryptogramCreateToJSON, } from './CardCryptogramCreate';
import { PanTypeFromJSON, PanTypeToJSON, } from './PanType';
import { CardholderAuthenticationCreateFromJSON, CardholderAuthenticationCreateToJSON, } from './CardholderAuthenticationCreate';
import { RecurringIndicatorFromJSON, RecurringIndicatorToJSON, } from './RecurringIndicator';
/**
* Check if a given object implements the AuthenticatedCardDataCreate interface.
*/
export function instanceOfAuthenticatedCardDataCreate(value) {
if (!('primaryAccountNumber' in value) || value['primaryAccountNumber'] === undefined)
return false;
return true;
}
export function AuthenticatedCardDataCreateFromJSON(json) {
return AuthenticatedCardDataCreateFromJSONTyped(json, false);
}
export function AuthenticatedCardDataCreateFromJSONTyped(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'],
'cardholderAuthentication': json['cardholderAuthentication'] == null ? undefined : CardholderAuthenticationCreateFromJSON(json['cardholderAuthentication']),
'tokenRequestorId': json['tokenRequestorId'] == null ? undefined : json['tokenRequestorId'],
'cryptogram': json['cryptogram'] == null ? undefined : CardCryptogramCreateFromJSON(json['cryptogram']),
};
}
export function AuthenticatedCardDataCreateToJSON(json) {
return AuthenticatedCardDataCreateToJSONTyped(json, false);
}
export function AuthenticatedCardDataCreateToJSONTyped(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'],
'cardholderAuthentication': CardholderAuthenticationCreateToJSON(value['cardholderAuthentication']),
'tokenRequestorId': value['tokenRequestorId'],
'cryptogram': CardCryptogramCreateToJSON(value['cryptogram']),
};
}