wallee
Version:
TypeScript/JavaScript client for wallee
69 lines (68 loc) • 4.24 kB
JavaScript
import { AddressCreateFromJSON, AddressCreateToJSON, } from './AddressCreate';
import { LineItemCreateFromJSON, LineItemCreateToJSON, } from './LineItemCreate';
import { TokenizationModeFromJSON, TokenizationModeToJSON, } from './TokenizationMode';
import { TransactionCompletionBehaviorFromJSON, TransactionCompletionBehaviorToJSON, } from './TransactionCompletionBehavior';
/**
* Check if a given object implements the AbstractTransactionPending interface.
*/
export function instanceOfAbstractTransactionPending(value) {
return true;
}
export function AbstractTransactionPendingFromJSON(json) {
return AbstractTransactionPendingFromJSONTyped(json, false);
}
export function AbstractTransactionPendingFromJSONTyped(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 : TokenizationModeFromJSON(json['tokenizationMode']),
'allowedPaymentMethodBrands': json['allowedPaymentMethodBrands'] == null ? undefined : json['allowedPaymentMethodBrands'],
'completionBehavior': json['completionBehavior'] == null ? undefined : TransactionCompletionBehaviorFromJSON(json['completionBehavior']),
'token': json['token'] == null ? undefined : json['token'],
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemCreateFromJSON)),
'metaData': json['metaData'] == null ? undefined : json['metaData'],
'customerId': json['customerId'] == null ? undefined : json['customerId'],
'shippingAddress': json['shippingAddress'] == null ? undefined : AddressCreateFromJSON(json['shippingAddress']),
'currency': json['currency'] == null ? undefined : json['currency'],
'billingAddress': json['billingAddress'] == null ? undefined : AddressCreateFromJSON(json['billingAddress']),
'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'],
'allowedPaymentMethodConfigurations': json['allowedPaymentMethodConfigurations'] == null ? undefined : json['allowedPaymentMethodConfigurations'],
'failedUrl': json['failedUrl'] == null ? undefined : json['failedUrl'],
};
}
export function AbstractTransactionPendingToJSON(json) {
return AbstractTransactionPendingToJSONTyped(json, false);
}
export function AbstractTransactionPendingToJSONTyped(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': TokenizationModeToJSON(value['tokenizationMode']),
'allowedPaymentMethodBrands': value['allowedPaymentMethodBrands'],
'completionBehavior': TransactionCompletionBehaviorToJSON(value['completionBehavior']),
'token': value['token'],
'lineItems': value['lineItems'] == null ? undefined : (value['lineItems'].map(LineItemCreateToJSON)),
'metaData': value['metaData'],
'customerId': value['customerId'],
'shippingAddress': AddressCreateToJSON(value['shippingAddress']),
'currency': value['currency'],
'billingAddress': AddressCreateToJSON(value['billingAddress']),
'merchantReference': value['merchantReference'],
'allowedPaymentMethodConfigurations': value['allowedPaymentMethodConfigurations'],
'failedUrl': value['failedUrl'],
};
}