/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; /** * * @export * @interface CreateTransactionRequest */ export interface CreateTransactionRequest { /** * * @type {number} * @memberof CreateTransactionRequest */ cartId?: number | null; /** * * @type {number} * @memberof CreateTransactionRequest */ orderId?: number | null; /** * * @type {number} * @memberof CreateTransactionRequest */ amount?: number | null; /** * * @type {number} * @memberof CreateTransactionRequest */ surcharge: number; /** * * @type {string} * @memberof CreateTransactionRequest */ paymentMethod: CreateTransactionRequestPaymentMethodEnum; /** * * @type {string} * @memberof CreateTransactionRequest */ description?: string | null; /** * * @type {string} * @memberof CreateTransactionRequest */ nonce?: string | null; /** * * @type {string} * @memberof CreateTransactionRequest */ deviceData?: string | null; } /** * @export */ export const CreateTransactionRequestPaymentMethodEnum = { BankDeposit: 'bank_deposit', Visa: 'visa', Mastercard: 'mastercard', AmericanExpress: 'american_express', GooglePay: 'google_pay', PayPal: 'pay_pal', ApplePay: 'apple_pay', StoreCredit: 'store_credit' } as const; export type CreateTransactionRequestPaymentMethodEnum = typeof CreateTransactionRequestPaymentMethodEnum[keyof typeof CreateTransactionRequestPaymentMethodEnum]; /** * Check if a given object implements the CreateTransactionRequest interface. */ export function instanceOfCreateTransactionRequest(value: object): value is CreateTransactionRequest { if (!('surcharge' in value) || value['surcharge'] === undefined) return false; if (!('paymentMethod' in value) || value['paymentMethod'] === undefined) return false; return true; } export function CreateTransactionRequestFromJSON(json: any): CreateTransactionRequest { return CreateTransactionRequestFromJSONTyped(json, false); } export function CreateTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionRequest { if (json == null) { return json; } return { 'cartId': json['cart_id'] == null ? undefined : json['cart_id'], 'orderId': json['order_id'] == null ? undefined : json['order_id'], 'amount': json['amount'] == null ? undefined : json['amount'], 'surcharge': json['surcharge'], 'paymentMethod': json['payment_method'], 'description': json['description'] == null ? undefined : json['description'], 'nonce': json['nonce'] == null ? undefined : json['nonce'], 'deviceData': json['device_data'] == null ? undefined : json['device_data'], }; } export function CreateTransactionRequestToJSON(json: any): CreateTransactionRequest { return CreateTransactionRequestToJSONTyped(json, false); } export function CreateTransactionRequestToJSONTyped(value?: CreateTransactionRequest | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'cart_id': value['cartId'], 'order_id': value['orderId'], 'amount': value['amount'], 'surcharge': value['surcharge'], 'payment_method': value['paymentMethod'], 'description': value['description'], 'nonce': value['nonce'], 'device_data': value['deviceData'], }; }