|
1 | | -import { Relationship, Counterparty } from "./common" |
| 1 | +import { Relationship, Counterparty, WireCounterparty } from "./common" |
2 | 2 |
|
3 | 3 | type PaymentStatus = "Pending" | "Rejected" | "Clearing" | "Sent" | "Canceled" | "Returned" |
4 | 4 |
|
5 | | -export type Payment = AchPayment | BookPayment |
| 5 | +export type Payment = AchPayment | BookPayment | WirePayment |
6 | 6 |
|
7 | 7 | interface BasePaymentAttributes { |
8 | 8 | /** |
@@ -143,14 +143,101 @@ interface BookPayment { |
143 | 143 | } |
144 | 144 | } |
145 | 145 |
|
| 146 | +export interface WirePayment { |
| 147 | + /** |
| 148 | + * Identifier of the Wire payment resource. |
| 149 | + */ |
| 150 | + id: string |
| 151 | + |
| 152 | + /** |
| 153 | + * Type of the payment resource. For originations the value is wirePayment. |
| 154 | + */ |
| 155 | + type: "wirePayment" |
| 156 | + |
| 157 | + /** |
| 158 | + * JSON object representing the payment resource. |
| 159 | + */ |
| 160 | + attributes: { |
| 161 | + |
| 162 | + /** |
| 163 | + * The party on the other side of the Wire payment. |
| 164 | + */ |
| 165 | + counterparty: WireCounterparty |
| 166 | + |
| 167 | + } & BasePaymentAttributes |
| 168 | + |
| 169 | + /** |
| 170 | + * Describes relationships between the Wire payment and the originating deposit account and customer. |
| 171 | + */ |
| 172 | + relationships: { |
| 173 | + /** |
| 174 | + * The Deposit Account originating the transfer. |
| 175 | + */ |
| 176 | + account: Relationship |
| 177 | + |
| 178 | + /** |
| 179 | + * The Customer the deposit account belongs to. |
| 180 | + */ |
| 181 | + customer: Relationship |
| 182 | + |
| 183 | + /** |
| 184 | + * The Customer the deposit account belongs to. |
| 185 | + */ |
| 186 | + customers: Relationship[] |
| 187 | + |
| 188 | + /** |
| 189 | + * The Wire Transaction generated by this payment. |
| 190 | + */ |
| 191 | + transaction: Relationship |
| 192 | + } |
| 193 | +} |
| 194 | + |
146 | 195 | export interface PatchPaymentRequest { |
147 | 196 | type: "achPayment" | "bookPayment" |
148 | 197 | attributes: { |
149 | 198 | tags: object |
150 | 199 | } |
151 | 200 | } |
152 | 201 |
|
153 | | -export type CreatePaymentRequest = CreateBookPaymentRequest | CreateInlinePaymentRequest | CreateLinkedPaymentRequest | CreateVerifiedPaymentRequest |
| 202 | +export type CreatePaymentRequest = CreateWirePaymentRequest | CreateBookPaymentRequest | CreateInlinePaymentRequest | CreateLinkedPaymentRequest | CreateVerifiedPaymentRequest |
| 203 | + |
| 204 | +export interface CreateWirePaymentRequest { |
| 205 | + type: "wirePayment" |
| 206 | + |
| 207 | + attributes: { |
| 208 | + /** |
| 209 | + * The amount (in cents). |
| 210 | + */ |
| 211 | + amount: number |
| 212 | + |
| 213 | + /** |
| 214 | + * Payment description (maximum of 50 characters), this will show up on statement of the counterparty. |
| 215 | + */ |
| 216 | + description: string |
| 217 | + |
| 218 | + /** |
| 219 | + * The party on the other side of the Wire payment. |
| 220 | + */ |
| 221 | + counterparty: WireCounterparty |
| 222 | + |
| 223 | + /** |
| 224 | + * See Idempotency. |
| 225 | + */ |
| 226 | + idempotencyKey?: string |
| 227 | + |
| 228 | + /** |
| 229 | + * See [Tags](https://developers.unit.co/#tags). Tags that will be copied to any transaction that this payment creates (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)). |
| 230 | + */ |
| 231 | + tags?: object |
| 232 | + } |
| 233 | + |
| 234 | + relationships: { |
| 235 | + /** |
| 236 | + * The Deposit Account originating the payment. |
| 237 | + */ |
| 238 | + account: Relationship |
| 239 | + } |
| 240 | +} |
154 | 241 |
|
155 | 242 | export interface CreateBookPaymentRequest { |
156 | 243 | type: "bookPayment" |
|
0 commit comments