/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Copyright (c) 2020 Mobify Research & Development Inc. All rights reserved. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Shop API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 20.4
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient'
import PaymentCardSpec from './PaymentCardSpec'
/**
* The PaymentMethod model module.
* @module models/PaymentMethod
* @version 20.4
*/
export default class PaymentMethod {
/**
* Constructs a new <code>PaymentMethod</code>.
* Document representing a payment method.
* @alias module:models/PaymentMethod
* @class
* @param id {String} The id of the payment method or card.
*/
constructor(id) {
this.id = id
}
/**
* Constructs a <code>PaymentMethod</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:models/PaymentMethod} obj Optional instance to populate.
* @return {module:models/PaymentMethod} The populated <code>PaymentMethod</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new PaymentMethod()
if (data.hasOwnProperty('cards')) {
obj.cards = ApiClient.convertToType(data.cards, [PaymentCardSpec])
}
if (data.hasOwnProperty('description')) {
obj.description = ApiClient.convertToType(data.description, 'String')
}
if (data.hasOwnProperty('id')) {
obj.id = ApiClient.convertToType(data.id, 'String')
}
if (data.hasOwnProperty('image')) {
obj.image = ApiClient.convertToType(data.image, 'String')
}
if (data.hasOwnProperty('name')) {
obj.name = ApiClient.convertToType(data.name, 'String')
}
if (data.hasOwnProperty('payment_processor_id')) {
obj.payment_processor_id = ApiClient.convertToType(data.payment_processor_id, 'String')
}
}
return obj
}
/**
* The sorted array of payment cards (included only when the system payment method is CREDIT_CARD).
* @member {Array.<module:models/PaymentCardSpec>} cards
*/
cards = undefined;
/**
* The localized description of the payment method or card.
* @member {String} description
*/
description = undefined;
/**
* The id of the payment method or card.
* @member {String} id
*/
id = undefined;
/**
* The URL to the image that represents the payment method or card.
* @member {String} image
*/
image = undefined;
/**
* The localized name of the payment method or card.
* @member {String} name
*/
name = undefined;
/**
* The payment processor ID.
* @member {String} payment_processor_id
*/
payment_processor_id = undefined;
}