wallee
Version:
TypeScript/JavaScript client for wallee
54 lines (53 loc) • 3.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfExpressCheckoutSession = instanceOfExpressCheckoutSession;
exports.ExpressCheckoutSessionFromJSON = ExpressCheckoutSessionFromJSON;
exports.ExpressCheckoutSessionFromJSONTyped = ExpressCheckoutSessionFromJSONTyped;
exports.ExpressCheckoutSessionToJSON = ExpressCheckoutSessionToJSON;
exports.ExpressCheckoutSessionToJSONTyped = ExpressCheckoutSessionToJSONTyped;
const ExpressCheckoutWalletType_1 = require("./ExpressCheckoutWalletType");
const Address_1 = require("./Address");
const ExpressCheckoutSessionState_1 = require("./ExpressCheckoutSessionState");
const LineItem_1 = require("./LineItem");
const ExpressCheckoutShippingOption_1 = require("./ExpressCheckoutShippingOption");
/**
* Check if a given object implements the ExpressCheckoutSession interface.
*/
function instanceOfExpressCheckoutSession(value) {
return true;
}
function ExpressCheckoutSessionFromJSON(json) {
return ExpressCheckoutSessionFromJSONTyped(json, false);
}
function ExpressCheckoutSessionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItem_1.LineItemFromJSON)),
'merchantShippingCallbackUrl': json['merchantShippingCallbackUrl'] == null ? undefined : json['merchantShippingCallbackUrl'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'metaData': json['metaData'] == null ? undefined : json['metaData'],
'walletType': json['walletType'] == null ? undefined : (0, ExpressCheckoutWalletType_1.ExpressCheckoutWalletTypeFromJSON)(json['walletType']),
'shippingAddress': json['shippingAddress'] == null ? undefined : (0, Address_1.AddressFromJSON)(json['shippingAddress']),
'currency': json['currency'] == null ? undefined : json['currency'],
'billingAddress': json['billingAddress'] == null ? undefined : (0, Address_1.AddressFromJSON)(json['billingAddress']),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, ExpressCheckoutSessionState_1.ExpressCheckoutSessionStateFromJSON)(json['state']),
'shippingOptions': json['shippingOptions'] == null ? undefined : (json['shippingOptions'].map(ExpressCheckoutShippingOption_1.ExpressCheckoutShippingOptionFromJSON)),
};
}
function ExpressCheckoutSessionToJSON(json) {
return ExpressCheckoutSessionToJSONTyped(json, false);
}
function ExpressCheckoutSessionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'walletType': (0, ExpressCheckoutWalletType_1.ExpressCheckoutWalletTypeToJSON)(value['walletType']),
'shippingAddress': (0, Address_1.AddressToJSON)(value['shippingAddress']),
'billingAddress': (0, Address_1.AddressToJSON)(value['billingAddress']),
'state': (0, ExpressCheckoutSessionState_1.ExpressCheckoutSessionStateToJSON)(value['state']),
};
}