@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
141 lines (127 loc) • 4.32 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Ringer Business API
* This API provides comprehensive endpoints for the Ringer Business system. It includes functionality for managing customer accounts, addresses, sites, phone numbers, payments, users, and other business resources. Operations typically require authentication and appropriate permissions.
*
* The version of the OpenAPI document: 1.0.5
* Contact: support@ringer.tel
*
* 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 PaymentCore
*/
export interface PaymentCore {
/**
* Unique identifier for the payment record.
* @type {number}
* @memberof PaymentCore
*/
id: number;
/**
* The amount of the payment in dollars.
* @type {string}
* @memberof PaymentCore
*/
amountInDollars: string;
/**
* Three-letter ISO currency code (e.g., USD, CAD, EUR).
* @type {string}
* @memberof PaymentCore
*/
currency: string;
/**
* The status of the payment transaction.
* @type {string}
* @memberof PaymentCore
*/
status: PaymentCoreStatusEnum;
/**
* Indicates if the payment transaction was successful.
* @type {boolean}
* @memberof PaymentCore
*/
success?: boolean;
/**
* A brief summary of the payment method used (e.g., "Visa ending in 1234").
* @type {string}
* @memberof PaymentCore
*/
paymentMethodSummary?: string | null;
/**
* The unique identifier for the transaction from the payment processor.
* @type {string}
* @memberof PaymentCore
*/
transactionId?: string | null;
/**
* Timestamp of when the payment was created/processed.
* @type {Date}
* @memberof PaymentCore
*/
createdAt: Date;
}
/**
* @export
*/
export const PaymentCoreStatusEnum = {
Pending: 'pending',
Succeeded: 'succeeded',
Failed: 'failed',
RequiresAction: 'requires_action',
Canceled: 'canceled'
} as const;
export type PaymentCoreStatusEnum = typeof PaymentCoreStatusEnum[keyof typeof PaymentCoreStatusEnum];
/**
* Check if a given object implements the PaymentCore interface.
*/
export function instanceOfPaymentCore(value: object): value is PaymentCore {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('amountInDollars' in value) || value['amountInDollars'] === undefined) return false;
if (!('currency' in value) || value['currency'] === undefined) return false;
if (!('status' in value) || value['status'] === undefined) return false;
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
return true;
}
export function PaymentCoreFromJSON(json: any): PaymentCore {
return PaymentCoreFromJSONTyped(json, false);
}
export function PaymentCoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentCore {
if (json == null) {
return json;
}
return {
'id': json['id'],
'amountInDollars': json['amount_in_dollars'],
'currency': json['currency'],
'status': json['status'],
'success': json['success'] == null ? undefined : json['success'],
'paymentMethodSummary': json['payment_method_summary'] == null ? undefined : json['payment_method_summary'],
'transactionId': json['transaction_id'] == null ? undefined : json['transaction_id'],
'createdAt': (new Date(json['created_at'])),
};
}
export function PaymentCoreToJSON(json: any): PaymentCore {
return PaymentCoreToJSONTyped(json, false);
}
export function PaymentCoreToJSONTyped(value?: PaymentCore | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'amount_in_dollars': value['amountInDollars'],
'currency': value['currency'],
'status': value['status'],
'success': value['success'],
'payment_method_summary': value['paymentMethodSummary'],
'transaction_id': value['transactionId'],
'created_at': ((value['createdAt']).toISOString()),
};
}