UNPKG

wallee

Version:
97 lines (96 loc) 6.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfTransactionCreate = instanceOfTransactionCreate; exports.TransactionCreateFromJSON = TransactionCreateFromJSON; exports.TransactionCreateFromJSONTyped = TransactionCreateFromJSONTyped; exports.TransactionCreateToJSON = TransactionCreateToJSON; exports.TransactionCreateToJSONTyped = TransactionCreateToJSONTyped; const AddressCreate_1 = require("./AddressCreate"); const CustomersPresence_1 = require("./CustomersPresence"); const LineItemCreate_1 = require("./LineItemCreate"); const TransactionEnvironmentSelectionStrategy_1 = require("./TransactionEnvironmentSelectionStrategy"); const TokenizationMode_1 = require("./TokenizationMode"); const TransactionCompletionBehavior_1 = require("./TransactionCompletionBehavior"); const Environment_1 = require("./Environment"); /** * Check if a given object implements the TransactionCreate interface. */ function instanceOfTransactionCreate(value) { if (!('lineItems' in value) || value['lineItems'] === undefined) return false; return true; } function TransactionCreateFromJSON(json) { return TransactionCreateFromJSONTyped(json, false); } function TransactionCreateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'customerEmailAddress': json['customerEmailAddress'] == null ? undefined : json['customerEmailAddress'], 'shippingMethod': json['shippingMethod'] == null ? undefined : json['shippingMethod'], 'invoiceMerchantReference': json['invoiceMerchantReference'] == null ? undefined : json['invoiceMerchantReference'], 'successUrl': json['successUrl'] == null ? undefined : json['successUrl'], 'timeZone': json['timeZone'] == null ? undefined : json['timeZone'], 'language': json['language'] == null ? undefined : json['language'], 'tokenizationMode': json['tokenizationMode'] == null ? undefined : (0, TokenizationMode_1.TokenizationModeFromJSON)(json['tokenizationMode']), 'allowedPaymentMethodBrands': json['allowedPaymentMethodBrands'] == null ? undefined : json['allowedPaymentMethodBrands'], 'completionBehavior': json['completionBehavior'] == null ? undefined : (0, TransactionCompletionBehavior_1.TransactionCompletionBehaviorFromJSON)(json['completionBehavior']), 'token': json['token'] == null ? undefined : json['token'], 'lineItems': (json['lineItems'].map(LineItemCreate_1.LineItemCreateFromJSON)), 'metaData': json['metaData'] == null ? undefined : json['metaData'], 'customerId': json['customerId'] == null ? undefined : json['customerId'], 'shippingAddress': json['shippingAddress'] == null ? undefined : (0, AddressCreate_1.AddressCreateFromJSON)(json['shippingAddress']), 'currency': json['currency'] == null ? undefined : json['currency'], 'billingAddress': json['billingAddress'] == null ? undefined : (0, AddressCreate_1.AddressCreateFromJSON)(json['billingAddress']), 'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'], 'allowedPaymentMethodConfigurations': json['allowedPaymentMethodConfigurations'] == null ? undefined : json['allowedPaymentMethodConfigurations'], 'failedUrl': json['failedUrl'] == null ? undefined : json['failedUrl'], 'chargeRetryEnabled': json['chargeRetryEnabled'] == null ? undefined : json['chargeRetryEnabled'], 'emailsDisabled': json['emailsDisabled'] == null ? undefined : json['emailsDisabled'], 'environment': json['environment'] == null ? undefined : (0, Environment_1.EnvironmentFromJSON)(json['environment']), 'environmentSelectionStrategy': json['environmentSelectionStrategy'] == null ? undefined : (0, TransactionEnvironmentSelectionStrategy_1.TransactionEnvironmentSelectionStrategyFromJSON)(json['environmentSelectionStrategy']), 'deviceSessionIdentifier': json['deviceSessionIdentifier'] == null ? undefined : json['deviceSessionIdentifier'], 'autoConfirmationEnabled': json['autoConfirmationEnabled'] == null ? undefined : json['autoConfirmationEnabled'], 'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'], 'customersPresence': json['customersPresence'] == null ? undefined : (0, CustomersPresence_1.CustomersPresenceFromJSON)(json['customersPresence']), }; } function TransactionCreateToJSON(json) { return TransactionCreateToJSONTyped(json, false); } function TransactionCreateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'customerEmailAddress': value['customerEmailAddress'], 'shippingMethod': value['shippingMethod'], 'invoiceMerchantReference': value['invoiceMerchantReference'], 'successUrl': value['successUrl'], 'timeZone': value['timeZone'], 'language': value['language'], 'tokenizationMode': (0, TokenizationMode_1.TokenizationModeToJSON)(value['tokenizationMode']), 'allowedPaymentMethodBrands': value['allowedPaymentMethodBrands'], 'completionBehavior': (0, TransactionCompletionBehavior_1.TransactionCompletionBehaviorToJSON)(value['completionBehavior']), 'token': value['token'], 'lineItems': (value['lineItems'].map(LineItemCreate_1.LineItemCreateToJSON)), 'metaData': value['metaData'], 'customerId': value['customerId'], 'shippingAddress': (0, AddressCreate_1.AddressCreateToJSON)(value['shippingAddress']), 'currency': value['currency'], 'billingAddress': (0, AddressCreate_1.AddressCreateToJSON)(value['billingAddress']), 'merchantReference': value['merchantReference'], 'allowedPaymentMethodConfigurations': value['allowedPaymentMethodConfigurations'], 'failedUrl': value['failedUrl'], 'chargeRetryEnabled': value['chargeRetryEnabled'], 'emailsDisabled': value['emailsDisabled'], 'environment': (0, Environment_1.EnvironmentToJSON)(value['environment']), 'environmentSelectionStrategy': (0, TransactionEnvironmentSelectionStrategy_1.TransactionEnvironmentSelectionStrategyToJSON)(value['environmentSelectionStrategy']), 'deviceSessionIdentifier': value['deviceSessionIdentifier'], 'autoConfirmationEnabled': value['autoConfirmationEnabled'], 'spaceViewId': value['spaceViewId'], 'customersPresence': (0, CustomersPresence_1.CustomersPresenceToJSON)(value['customersPresence']), }; }