-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPaymentRequestUpdate.ts
More file actions
148 lines (140 loc) · 4.92 KB
/
PaymentRequestUpdate.ts
File metadata and controls
148 lines (140 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* tslint:disable */
/* eslint-disable */
/**
* Paystack
* The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa.
*
* The version of the Paystack Node library: 1.0.0
* Contact: techsupport@paystack.com
*
* 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';
/**
*
* @export
* @interface PaymentRequestUpdate
*/
export interface PaymentRequestUpdate {
/**
* Customer id or code
* @type {string}
* @memberof PaymentRequestUpdate
*/
customer?: string;
/**
* Payment request amount. Only useful if line items and tax values are ignored.
* The endpoint will throw a friendly warning if neither is available.
* @type {number}
* @memberof PaymentRequestUpdate
*/
amount?: number;
/**
* Specify the currency of the invoice. Allowed values are NGN, GHS, ZAR and USD. Defaults to NGN
* @type {string}
* @memberof PaymentRequestUpdate
*/
currency?: string;
/**
* ISO 8601 representation of request due date
* @type {Date}
* @memberof PaymentRequestUpdate
*/
dueDate?: Date;
/**
* A short description of the payment request
* @type {string}
* @memberof PaymentRequestUpdate
*/
description?: string;
/**
* Array of line items
* @type {Array<object>}
* @memberof PaymentRequestUpdate
*/
lineItems?: Array<object>;
/**
* Array of taxes
* @type {Array<object>}
* @memberof PaymentRequestUpdate
*/
tax?: Array<object>;
/**
* Indicates whether Paystack sends an email notification to customer. Defaults to true
* @type {Array<object>}
* @memberof PaymentRequestUpdate
*/
sendNotification?: Array<object>;
/**
* Indicate if request should be saved as draft. Defaults to false and overrides send_notification
* @type {Array<object>}
* @memberof PaymentRequestUpdate
*/
draft?: Array<object>;
/**
* Set to true to create a draft invoice (adds an auto incrementing invoice number if none is provided)
* even if there are no line_items or tax passed
* @type {Array<object>}
* @memberof PaymentRequestUpdate
*/
hasInvoice?: Array<object>;
/**
* Numeric value of invoice. Invoice will start from 1 and auto increment from there. This field is to help
* override whatever value Paystack decides. Auto increment for subsequent invoices continue from this point.
* @type {number}
* @memberof PaymentRequestUpdate
*/
invoiceNumber?: number;
/**
* The split code of the transaction split.
* @type {string}
* @memberof PaymentRequestUpdate
*/
splitCode?: string;
}
export function PaymentRequestUpdateFromJSON(json: any): PaymentRequestUpdate {
return PaymentRequestUpdateFromJSONTyped(json, false);
}
export function PaymentRequestUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentRequestUpdate {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'customer': !exists(json, 'customer') ? undefined : json['customer'],
'amount': !exists(json, 'amount') ? undefined : json['amount'],
'currency': !exists(json, 'currency') ? undefined : json['currency'],
'dueDate': !exists(json, 'due_date') ? undefined : (new Date(json['due_date'])),
'description': !exists(json, 'description') ? undefined : json['description'],
'lineItems': !exists(json, 'line_items') ? undefined : json['line_items'],
'tax': !exists(json, 'tax') ? undefined : json['tax'],
'sendNotification': !exists(json, 'send_notification') ? undefined : json['send_notification'],
'draft': !exists(json, 'draft') ? undefined : json['draft'],
'hasInvoice': !exists(json, 'has_invoice') ? undefined : json['has_invoice'],
'invoiceNumber': !exists(json, 'invoice_number') ? undefined : json['invoice_number'],
'splitCode': !exists(json, 'split_code') ? undefined : json['split_code'],
};
}
export function PaymentRequestUpdateToJSON(value?: PaymentRequestUpdate | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'customer': value.customer,
'amount': value.amount,
'currency': value.currency,
'due_date': value.dueDate === undefined ? undefined : (value.dueDate.toISOString()),
'description': value.description,
'line_items': value.lineItems,
'tax': value.tax,
'send_notification': value.sendNotification,
'draft': value.draft,
'has_invoice': value.hasInvoice,
'invoice_number': value.invoiceNumber,
'split_code': value.splitCode,
};
}