/* tslint:disable */
/* eslint-disable */
/**
* Lemonway DirectKit API 2.0
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RiskAnalysis } from './RiskAnalysis';
import {
RiskAnalysisFromJSON,
RiskAnalysisFromJSONTyped,
RiskAnalysisToJSON,
} from './RiskAnalysis';
import type { ThreeDS } from './ThreeDS';
import {
ThreeDSFromJSON,
ThreeDSFromJSONTyped,
ThreeDSToJSON,
} from './ThreeDS';
/**
*
* @export
* @interface MoneyInWebInitInput
*/
export interface MoneyInWebInitInput {
/**
* Your site URL called by WebKit to terminate the operation
* @type {string}
* @memberof MoneyInWebInitInput
*/
returnUrl: string;
/**
* Your site return URL, called by WebKit in case of an error
* @type {string}
* @memberof MoneyInWebInitInput
*/
errorUrl: string;
/**
* Your site return URL, called by WebKit in case of a cancellation
* @type {string}
* @memberof MoneyInWebInitInput
*/
cancelUrl: string;
/**
* Save the card and returns an ID for future payments
* @type {boolean}
* @memberof MoneyInWebInitInput
*/
registerCard?: boolean;
/**
* Indicate the number of days of the deferred payment. Between 0 and 6 days to have a guaranteed payment.
* Only usable with isPreAuth = 0-6
* Only available for Transactpro, Mercanet v2, Payzen and Monetico
* @type {number}
* @memberof MoneyInWebInitInput
*/
captureDelayedDays?: number;
/**
* Indicates the name of the shop on the payment page
* Only available on Payzen
* @type {string}
* @memberof MoneyInWebInitInput
*/
label?: string;
/**
* Indicates the CardId
* @type {string}
* @memberof MoneyInWebInitInput
*/
cardId?: string;
/**
* Indicates the nature of activity for this Money-In:
0 = Activite 1.
1 = Activite 2.
* @type {number}
* @memberof MoneyInWebInitInput
*/
moneyInNature?: MoneyInWebInitInputMoneyInNatureEnum;
/**
*
* @type {ThreeDS}
* @memberof MoneyInWebInitInput
*/
threeDS?: ThreeDS;
/**
*
* @type {RiskAnalysis}
* @memberof MoneyInWebInitInput
*/
riskAnalysis?: RiskAnalysis;
/**
* Average amount of future recurring payments to cover recurring payments with variable amounts. **Note:** Only if the amount is higher than the amount of the first transaction.
* @type {number}
* @memberof MoneyInWebInitInput
*/
recurringAvgAmount?: number;
/**
* **Recurring**: If a payment follows a recurring amount or **One_shot**: when there is no future recurring payments.
* @type {string}
* @memberof MoneyInWebInitInput
*/
paymentPattern?: string;
/**
* Unique ID of the call, generated by your server. This ID can be used as a search field when looking for operation details
* @type {string}
* @memberof MoneyInWebInitInput
*/
reference?: string;
/**
* Payment Account ID to Credit
* @type {string}
* @memberof MoneyInWebInitInput
*/
accountId: string;
/**
* Amount to Debit
* Amounts are given as integer numbers in cents
* @type {number}
* @memberof MoneyInWebInitInput
*/
totalAmount?: number;
/**
* Your Fee
* Amounts are given as integer numbers in cents
* @type {number}
* @memberof MoneyInWebInitInput
*/
commissionAmount?: number;
/**
* Comment Regarding the Transaction
* @type {string}
* @memberof MoneyInWebInitInput
*/
comment?: string;
/**
* If true:
* 1. [amountCom] will be ignored and will be replaced with Lemonway's fee
* 2. You will not receive any fee
* @type {boolean}
* @memberof MoneyInWebInitInput
*/
autoCommission?: boolean;
}
/**
* @export
*/
export const MoneyInWebInitInputMoneyInNatureEnum = {
NUMBER_0: 0,
NUMBER_1: 1
} as const;
export type MoneyInWebInitInputMoneyInNatureEnum = typeof MoneyInWebInitInputMoneyInNatureEnum[keyof typeof MoneyInWebInitInputMoneyInNatureEnum];
/**
* Check if a given object implements the MoneyInWebInitInput interface.
*/
export function instanceOfMoneyInWebInitInput(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "returnUrl" in value;
isInstance = isInstance && "errorUrl" in value;
isInstance = isInstance && "cancelUrl" in value;
isInstance = isInstance && "accountId" in value;
return isInstance;
}
export function MoneyInWebInitInputFromJSON(json: any): MoneyInWebInitInput {
return MoneyInWebInitInputFromJSONTyped(json, false);
}
export function MoneyInWebInitInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): MoneyInWebInitInput {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'returnUrl': json['returnUrl'],
'errorUrl': json['errorUrl'],
'cancelUrl': json['cancelUrl'],
'registerCard': !exists(json, 'registerCard') ? undefined : json['registerCard'],
'captureDelayedDays': !exists(json, 'captureDelayedDays') ? undefined : json['captureDelayedDays'],
'label': !exists(json, 'label') ? undefined : json['label'],
'cardId': !exists(json, 'cardId') ? undefined : json['cardId'],
'moneyInNature': !exists(json, 'moneyInNature') ? undefined : json['moneyInNature'],
'threeDS': !exists(json, 'threeDS') ? undefined : ThreeDSFromJSON(json['threeDS']),
'riskAnalysis': !exists(json, 'riskAnalysis') ? undefined : RiskAnalysisFromJSON(json['riskAnalysis']),
'recurringAvgAmount': !exists(json, 'recurringAvgAmount') ? undefined : json['recurringAvgAmount'],
'paymentPattern': !exists(json, 'paymentPattern') ? undefined : json['paymentPattern'],
'reference': !exists(json, 'reference') ? undefined : json['reference'],
'accountId': json['accountId'],
'totalAmount': !exists(json, 'totalAmount') ? undefined : json['totalAmount'],
'commissionAmount': !exists(json, 'commissionAmount') ? undefined : json['commissionAmount'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'autoCommission': !exists(json, 'autoCommission') ? undefined : json['autoCommission'],
};
}
export function MoneyInWebInitInputToJSON(value?: MoneyInWebInitInput | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'returnUrl': value.returnUrl,
'errorUrl': value.errorUrl,
'cancelUrl': value.cancelUrl,
'registerCard': value.registerCard,
'captureDelayedDays': value.captureDelayedDays,
'label': value.label,
'cardId': value.cardId,
'moneyInNature': value.moneyInNature,
'threeDS': ThreeDSToJSON(value.threeDS),
'riskAnalysis': RiskAnalysisToJSON(value.riskAnalysis),
'recurringAvgAmount': value.recurringAvgAmount,
'paymentPattern': value.paymentPattern,
'reference': value.reference,
'accountId': value.accountId,
'totalAmount': value.totalAmount,
'commissionAmount': value.commissionAmount,
'comment': value.comment,
'autoCommission': value.autoCommission,
};
}