mollie-api-typescript 1.12.2 → 1.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/commonjs/lib/config.d.ts +3 -3
  2. package/dist/commonjs/lib/config.js +3 -3
  3. package/dist/commonjs/lib/retries.js +7 -0
  4. package/dist/commonjs/lib/retries.js.map +1 -1
  5. package/dist/commonjs/models/captureresponse.d.ts +0 -36
  6. package/dist/commonjs/models/captureresponse.d.ts.map +1 -1
  7. package/dist/commonjs/models/captureresponse.js +1 -11
  8. package/dist/commonjs/models/captureresponse.js.map +1 -1
  9. package/dist/commonjs/models/entitybalance.d.ts +0 -16
  10. package/dist/commonjs/models/entitybalance.d.ts.map +1 -1
  11. package/dist/commonjs/models/entitybalance.js.map +1 -1
  12. package/dist/commonjs/models/entitychargeback.d.ts +0 -38
  13. package/dist/commonjs/models/entitychargeback.d.ts.map +1 -1
  14. package/dist/commonjs/models/entitychargeback.js +1 -11
  15. package/dist/commonjs/models/entitychargeback.js.map +1 -1
  16. package/dist/commonjs/models/entityinvoice.d.ts +0 -13
  17. package/dist/commonjs/models/entityinvoice.d.ts.map +1 -1
  18. package/dist/commonjs/models/entityinvoice.js.map +1 -1
  19. package/dist/commonjs/models/entitymethodget.d.ts +0 -3
  20. package/dist/commonjs/models/entitymethodget.d.ts.map +1 -1
  21. package/dist/commonjs/models/entitymethodget.js.map +1 -1
  22. package/dist/commonjs/models/entityrefundresponse.d.ts +0 -42
  23. package/dist/commonjs/models/entityrefundresponse.d.ts.map +1 -1
  24. package/dist/commonjs/models/entityrefundresponse.js +1 -11
  25. package/dist/commonjs/models/entityrefundresponse.js.map +1 -1
  26. package/dist/commonjs/models/entitysettlement.d.ts +0 -3
  27. package/dist/commonjs/models/entitysettlement.d.ts.map +1 -1
  28. package/dist/commonjs/models/entitysettlement.js.map +1 -1
  29. package/dist/commonjs/models/index.d.ts +1 -0
  30. package/dist/commonjs/models/index.d.ts.map +1 -1
  31. package/dist/commonjs/models/index.js +1 -0
  32. package/dist/commonjs/models/index.js.map +1 -1
  33. package/dist/commonjs/models/listcaptureresponse.d.ts +0 -36
  34. package/dist/commonjs/models/listcaptureresponse.d.ts.map +1 -1
  35. package/dist/commonjs/models/listcaptureresponse.js +1 -11
  36. package/dist/commonjs/models/listcaptureresponse.js.map +1 -1
  37. package/dist/commonjs/models/listentitybalance.d.ts +0 -16
  38. package/dist/commonjs/models/listentitybalance.d.ts.map +1 -1
  39. package/dist/commonjs/models/listentitybalance.js.map +1 -1
  40. package/dist/commonjs/models/listentitychargeback.d.ts +0 -38
  41. package/dist/commonjs/models/listentitychargeback.d.ts.map +1 -1
  42. package/dist/commonjs/models/listentitychargeback.js +1 -11
  43. package/dist/commonjs/models/listentitychargeback.js.map +1 -1
  44. package/dist/commonjs/models/listentityinvoice.d.ts +0 -13
  45. package/dist/commonjs/models/listentityinvoice.d.ts.map +1 -1
  46. package/dist/commonjs/models/listentityinvoice.js.map +1 -1
  47. package/dist/commonjs/models/listentitymethod.d.ts +0 -3
  48. package/dist/commonjs/models/listentitymethod.d.ts.map +1 -1
  49. package/dist/commonjs/models/listentitymethod.js.map +1 -1
  50. package/dist/commonjs/models/listentitymethodall.d.ts +0 -3
  51. package/dist/commonjs/models/listentitymethodall.d.ts.map +1 -1
  52. package/dist/commonjs/models/listentitymethodall.js.map +1 -1
  53. package/dist/commonjs/models/listentityrefund.d.ts +0 -42
  54. package/dist/commonjs/models/listentityrefund.d.ts.map +1 -1
  55. package/dist/commonjs/models/listentityrefund.js +1 -11
  56. package/dist/commonjs/models/listentityrefund.js.map +1 -1
  57. package/dist/commonjs/models/listentitysettlement.d.ts +0 -3
  58. package/dist/commonjs/models/listentitysettlement.d.ts.map +1 -1
  59. package/dist/commonjs/models/listentitysettlement.js.map +1 -1
  60. package/dist/commonjs/models/listpaymentresponse.d.ts +2 -404
  61. package/dist/commonjs/models/listpaymentresponse.d.ts.map +1 -1
  62. package/dist/commonjs/models/listpaymentresponse.js +3 -113
  63. package/dist/commonjs/models/listpaymentresponse.js.map +1 -1
  64. package/dist/commonjs/models/listsalesinvoiceresponse.d.ts +0 -15
  65. package/dist/commonjs/models/listsalesinvoiceresponse.d.ts.map +1 -1
  66. package/dist/commonjs/models/listsalesinvoiceresponse.js.map +1 -1
  67. package/dist/commonjs/models/listsettlementcaptureresponse.d.ts +20 -20
  68. package/dist/commonjs/models/listsettlementcaptureresponse.d.ts.map +1 -1
  69. package/dist/commonjs/models/listsettlementcaptureresponse.js +11 -11
  70. package/dist/commonjs/models/listsettlementcaptureresponse.js.map +1 -1
  71. package/dist/commonjs/models/listsettlementchargebackresponse.d.ts +26 -26
  72. package/dist/commonjs/models/listsettlementchargebackresponse.d.ts.map +1 -1
  73. package/dist/commonjs/models/listsettlementchargebackresponse.js +11 -11
  74. package/dist/commonjs/models/listsettlementchargebackresponse.js.map +1 -1
  75. package/dist/commonjs/models/listsettlementpaymentresponse.d.ts +24 -392
  76. package/dist/commonjs/models/listsettlementpaymentresponse.d.ts.map +1 -1
  77. package/dist/commonjs/models/listsettlementpaymentresponse.js +13 -114
  78. package/dist/commonjs/models/listsettlementpaymentresponse.js.map +1 -1
  79. package/dist/commonjs/models/listsettlementrefundresponse.d.ts +30 -30
  80. package/dist/commonjs/models/listsettlementrefundresponse.d.ts.map +1 -1
  81. package/dist/commonjs/models/listsettlementrefundresponse.js +11 -11
  82. package/dist/commonjs/models/listsettlementrefundresponse.js.map +1 -1
  83. package/dist/commonjs/models/paymentdetails.d.ts +367 -0
  84. package/dist/commonjs/models/paymentdetails.d.ts.map +1 -0
  85. package/dist/commonjs/models/paymentdetails.js +144 -0
  86. package/dist/commonjs/models/paymentdetails.js.map +1 -0
  87. package/dist/commonjs/models/paymentrequest.d.ts +61 -26
  88. package/dist/commonjs/models/paymentrequest.d.ts.map +1 -1
  89. package/dist/commonjs/models/paymentrequest.js.map +1 -1
  90. package/dist/commonjs/models/paymentresponse.d.ts +2 -404
  91. package/dist/commonjs/models/paymentresponse.d.ts.map +1 -1
  92. package/dist/commonjs/models/paymentresponse.js +3 -114
  93. package/dist/commonjs/models/paymentresponse.js.map +1 -1
  94. package/dist/commonjs/models/salesinvoiceresponse.d.ts +0 -15
  95. package/dist/commonjs/models/salesinvoiceresponse.d.ts.map +1 -1
  96. package/dist/commonjs/models/salesinvoiceresponse.js.map +1 -1
  97. package/dist/commonjs/models/statusreason.d.ts +59 -41
  98. package/dist/commonjs/models/statusreason.d.ts.map +1 -1
  99. package/dist/commonjs/models/statusreason.js +70 -42
  100. package/dist/commonjs/models/statusreason.js.map +1 -1
  101. package/dist/esm/lib/config.d.ts +3 -3
  102. package/dist/esm/lib/config.js +3 -3
  103. package/dist/esm/lib/retries.js +7 -0
  104. package/dist/esm/lib/retries.js.map +1 -1
  105. package/dist/esm/models/captureresponse.d.ts +0 -36
  106. package/dist/esm/models/captureresponse.d.ts.map +1 -1
  107. package/dist/esm/models/captureresponse.js +0 -9
  108. package/dist/esm/models/captureresponse.js.map +1 -1
  109. package/dist/esm/models/entitybalance.d.ts +0 -16
  110. package/dist/esm/models/entitybalance.d.ts.map +1 -1
  111. package/dist/esm/models/entitybalance.js.map +1 -1
  112. package/dist/esm/models/entitychargeback.d.ts +0 -38
  113. package/dist/esm/models/entitychargeback.d.ts.map +1 -1
  114. package/dist/esm/models/entitychargeback.js +0 -9
  115. package/dist/esm/models/entitychargeback.js.map +1 -1
  116. package/dist/esm/models/entityinvoice.d.ts +0 -13
  117. package/dist/esm/models/entityinvoice.d.ts.map +1 -1
  118. package/dist/esm/models/entityinvoice.js.map +1 -1
  119. package/dist/esm/models/entitymethodget.d.ts +0 -3
  120. package/dist/esm/models/entitymethodget.d.ts.map +1 -1
  121. package/dist/esm/models/entitymethodget.js.map +1 -1
  122. package/dist/esm/models/entityrefundresponse.d.ts +0 -42
  123. package/dist/esm/models/entityrefundresponse.d.ts.map +1 -1
  124. package/dist/esm/models/entityrefundresponse.js +0 -9
  125. package/dist/esm/models/entityrefundresponse.js.map +1 -1
  126. package/dist/esm/models/entitysettlement.d.ts +0 -3
  127. package/dist/esm/models/entitysettlement.d.ts.map +1 -1
  128. package/dist/esm/models/entitysettlement.js.map +1 -1
  129. package/dist/esm/models/index.d.ts +1 -0
  130. package/dist/esm/models/index.d.ts.map +1 -1
  131. package/dist/esm/models/index.js +1 -0
  132. package/dist/esm/models/index.js.map +1 -1
  133. package/dist/esm/models/listcaptureresponse.d.ts +0 -36
  134. package/dist/esm/models/listcaptureresponse.d.ts.map +1 -1
  135. package/dist/esm/models/listcaptureresponse.js +0 -9
  136. package/dist/esm/models/listcaptureresponse.js.map +1 -1
  137. package/dist/esm/models/listentitybalance.d.ts +0 -16
  138. package/dist/esm/models/listentitybalance.d.ts.map +1 -1
  139. package/dist/esm/models/listentitybalance.js.map +1 -1
  140. package/dist/esm/models/listentitychargeback.d.ts +0 -38
  141. package/dist/esm/models/listentitychargeback.d.ts.map +1 -1
  142. package/dist/esm/models/listentitychargeback.js +0 -9
  143. package/dist/esm/models/listentitychargeback.js.map +1 -1
  144. package/dist/esm/models/listentityinvoice.d.ts +0 -13
  145. package/dist/esm/models/listentityinvoice.d.ts.map +1 -1
  146. package/dist/esm/models/listentityinvoice.js.map +1 -1
  147. package/dist/esm/models/listentitymethod.d.ts +0 -3
  148. package/dist/esm/models/listentitymethod.d.ts.map +1 -1
  149. package/dist/esm/models/listentitymethod.js.map +1 -1
  150. package/dist/esm/models/listentitymethodall.d.ts +0 -3
  151. package/dist/esm/models/listentitymethodall.d.ts.map +1 -1
  152. package/dist/esm/models/listentitymethodall.js.map +1 -1
  153. package/dist/esm/models/listentityrefund.d.ts +0 -42
  154. package/dist/esm/models/listentityrefund.d.ts.map +1 -1
  155. package/dist/esm/models/listentityrefund.js +0 -9
  156. package/dist/esm/models/listentityrefund.js.map +1 -1
  157. package/dist/esm/models/listentitysettlement.d.ts +0 -3
  158. package/dist/esm/models/listentitysettlement.d.ts.map +1 -1
  159. package/dist/esm/models/listentitysettlement.js.map +1 -1
  160. package/dist/esm/models/listpaymentresponse.d.ts +2 -404
  161. package/dist/esm/models/listpaymentresponse.d.ts.map +1 -1
  162. package/dist/esm/models/listpaymentresponse.js +2 -108
  163. package/dist/esm/models/listpaymentresponse.js.map +1 -1
  164. package/dist/esm/models/listsalesinvoiceresponse.d.ts +0 -15
  165. package/dist/esm/models/listsalesinvoiceresponse.d.ts.map +1 -1
  166. package/dist/esm/models/listsalesinvoiceresponse.js.map +1 -1
  167. package/dist/esm/models/listsettlementcaptureresponse.d.ts +20 -20
  168. package/dist/esm/models/listsettlementcaptureresponse.d.ts.map +1 -1
  169. package/dist/esm/models/listsettlementcaptureresponse.js +9 -9
  170. package/dist/esm/models/listsettlementcaptureresponse.js.map +1 -1
  171. package/dist/esm/models/listsettlementchargebackresponse.d.ts +26 -26
  172. package/dist/esm/models/listsettlementchargebackresponse.d.ts.map +1 -1
  173. package/dist/esm/models/listsettlementchargebackresponse.js +9 -9
  174. package/dist/esm/models/listsettlementchargebackresponse.js.map +1 -1
  175. package/dist/esm/models/listsettlementpaymentresponse.d.ts +24 -392
  176. package/dist/esm/models/listsettlementpaymentresponse.d.ts.map +1 -1
  177. package/dist/esm/models/listsettlementpaymentresponse.js +11 -109
  178. package/dist/esm/models/listsettlementpaymentresponse.js.map +1 -1
  179. package/dist/esm/models/listsettlementrefundresponse.d.ts +30 -30
  180. package/dist/esm/models/listsettlementrefundresponse.d.ts.map +1 -1
  181. package/dist/esm/models/listsettlementrefundresponse.js +9 -9
  182. package/dist/esm/models/listsettlementrefundresponse.js.map +1 -1
  183. package/dist/esm/models/paymentdetails.d.ts +367 -0
  184. package/dist/esm/models/paymentdetails.d.ts.map +1 -0
  185. package/dist/esm/models/paymentdetails.js +105 -0
  186. package/dist/esm/models/paymentdetails.js.map +1 -0
  187. package/dist/esm/models/paymentrequest.d.ts +61 -26
  188. package/dist/esm/models/paymentrequest.d.ts.map +1 -1
  189. package/dist/esm/models/paymentrequest.js.map +1 -1
  190. package/dist/esm/models/paymentresponse.d.ts +2 -404
  191. package/dist/esm/models/paymentresponse.d.ts.map +1 -1
  192. package/dist/esm/models/paymentresponse.js +2 -109
  193. package/dist/esm/models/paymentresponse.js.map +1 -1
  194. package/dist/esm/models/salesinvoiceresponse.d.ts +0 -15
  195. package/dist/esm/models/salesinvoiceresponse.d.ts.map +1 -1
  196. package/dist/esm/models/salesinvoiceresponse.js.map +1 -1
  197. package/dist/esm/models/statusreason.d.ts +59 -41
  198. package/dist/esm/models/statusreason.d.ts.map +1 -1
  199. package/dist/esm/models/statusreason.js +68 -41
  200. package/dist/esm/models/statusreason.js.map +1 -1
  201. package/jsr.json +1 -1
  202. package/package.json +1 -1
  203. package/src/lib/config.ts +3 -3
  204. package/src/lib/retries.ts +8 -0
  205. package/src/models/captureresponse.ts +0 -57
  206. package/src/models/entitybalance.ts +0 -16
  207. package/src/models/entitychargeback.ts +0 -59
  208. package/src/models/entityinvoice.ts +0 -13
  209. package/src/models/entitymethodget.ts +0 -3
  210. package/src/models/entityrefundresponse.ts +0 -64
  211. package/src/models/entitysettlement.ts +0 -3
  212. package/src/models/index.ts +1 -0
  213. package/src/models/listcaptureresponse.ts +0 -58
  214. package/src/models/listentitybalance.ts +0 -16
  215. package/src/models/listentitychargeback.ts +0 -60
  216. package/src/models/listentityinvoice.ts +0 -13
  217. package/src/models/listentitymethod.ts +0 -3
  218. package/src/models/listentitymethodall.ts +0 -3
  219. package/src/models/listentityrefund.ts +0 -63
  220. package/src/models/listentitysettlement.ts +0 -3
  221. package/src/models/listpaymentresponse.ts +5 -579
  222. package/src/models/listsalesinvoiceresponse.ts +0 -15
  223. package/src/models/listsettlementcaptureresponse.ts +47 -47
  224. package/src/models/listsettlementchargebackresponse.ts +59 -59
  225. package/src/models/listsettlementpaymentresponse.ts +55 -579
  226. package/src/models/listsettlementrefundresponse.ts +61 -61
  227. package/src/models/paymentdetails.ts +521 -0
  228. package/src/models/paymentrequest.ts +61 -26
  229. package/src/models/paymentresponse.ts +5 -577
  230. package/src/models/salesinvoiceresponse.ts +0 -15
  231. package/src/models/statusreason.ts +121 -44
@@ -25,25 +25,6 @@ import {
25
25
  import { Url, Url$inboundSchema } from "./url.js";
26
26
  import { UrlNullable, UrlNullable$inboundSchema } from "./urlnullable.js";
27
27
 
28
- /**
29
- * The amount deducted from your account balance for this refund, converted to the currency your account is
30
- *
31
- * @remarks
32
- * settled in. Always a **negative** amount.
33
- *
34
- * For refunds not directly processed by Mollie (e.g. PayPal), the settlement amount is zero.
35
- */
36
- export type ListSettlementRefundResponseSettlementAmount = {
37
- /**
38
- * A three-character ISO 4217 currency code.
39
- */
40
- currency: string;
41
- /**
42
- * A string containing an exact monetary amount in the given currency.
43
- */
44
- value: string;
45
- };
46
-
47
28
  export type ListSettlementRefundResponseExternalReference = {
48
29
  /**
49
30
  * Specifies the reference type
@@ -91,6 +72,25 @@ export type ListSettlementRefundResponseLinks = {
91
72
  settlement?: UrlNullable | null | undefined;
92
73
  };
93
74
 
75
+ /**
76
+ * The amount deducted from your account balance for this refund, converted to the currency your account is
77
+ *
78
+ * @remarks
79
+ * settled in. Always a **negative** amount.
80
+ *
81
+ * For refunds not directly processed by Mollie (e.g. PayPal), the settlement amount is zero.
82
+ */
83
+ export type ListSettlementRefundResponseSettlementAmount = {
84
+ /**
85
+ * A three-character ISO 4217 currency code.
86
+ */
87
+ currency: string;
88
+ /**
89
+ * A string containing an exact monetary amount in the given currency.
90
+ */
91
+ value: string;
92
+ };
93
+
94
94
  export type ListSettlementRefundResponse = {
95
95
  /**
96
96
  * Indicates the response contains a refund object. Will always contain the string `refund` for this endpoint.
@@ -115,18 +115,6 @@ export type ListSettlementRefundResponse = {
115
115
  * In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
116
116
  */
117
117
  amount: Amount;
118
- /**
119
- * The amount deducted from your account balance for this refund, converted to the currency your account is
120
- *
121
- * @remarks
122
- * settled in. Always a **negative** amount.
123
- *
124
- * For refunds not directly processed by Mollie (e.g. PayPal), the settlement amount is zero.
125
- */
126
- settlementAmount?:
127
- | ListSettlementRefundResponseSettlementAmount
128
- | null
129
- | undefined;
130
118
  /**
131
119
  * Provide any data you like, for example a string or a JSON object. We will save the data alongside the entity. Whenever
132
120
  *
@@ -174,35 +162,20 @@ export type ListSettlementRefundResponse = {
174
162
  * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
175
163
  */
176
164
  links: ListSettlementRefundResponseLinks;
165
+ /**
166
+ * The amount deducted from your account balance for this refund, converted to the currency your account is
167
+ *
168
+ * @remarks
169
+ * settled in. Always a **negative** amount.
170
+ *
171
+ * For refunds not directly processed by Mollie (e.g. PayPal), the settlement amount is zero.
172
+ */
173
+ settlementAmount?:
174
+ | ListSettlementRefundResponseSettlementAmount
175
+ | null
176
+ | undefined;
177
177
  };
178
178
 
179
- /** @internal */
180
- export const ListSettlementRefundResponseSettlementAmount$inboundSchema:
181
- z.ZodType<
182
- ListSettlementRefundResponseSettlementAmount,
183
- z.ZodTypeDef,
184
- unknown
185
- > = z.object({
186
- currency: z.string(),
187
- value: z.string(),
188
- });
189
-
190
- export function listSettlementRefundResponseSettlementAmountFromJSON(
191
- jsonString: string,
192
- ): SafeParseResult<
193
- ListSettlementRefundResponseSettlementAmount,
194
- SDKValidationError
195
- > {
196
- return safeParse(
197
- jsonString,
198
- (x) =>
199
- ListSettlementRefundResponseSettlementAmount$inboundSchema.parse(
200
- JSON.parse(x),
201
- ),
202
- `Failed to parse 'ListSettlementRefundResponseSettlementAmount' from JSON`,
203
- );
204
- }
205
-
206
179
  /** @internal */
207
180
  export const ListSettlementRefundResponseExternalReference$inboundSchema:
208
181
  z.ZodType<
@@ -299,6 +272,33 @@ export function listSettlementRefundResponseLinksFromJSON(
299
272
  );
300
273
  }
301
274
 
275
+ /** @internal */
276
+ export const ListSettlementRefundResponseSettlementAmount$inboundSchema:
277
+ z.ZodType<
278
+ ListSettlementRefundResponseSettlementAmount,
279
+ z.ZodTypeDef,
280
+ unknown
281
+ > = z.object({
282
+ currency: z.string(),
283
+ value: z.string(),
284
+ });
285
+
286
+ export function listSettlementRefundResponseSettlementAmountFromJSON(
287
+ jsonString: string,
288
+ ): SafeParseResult<
289
+ ListSettlementRefundResponseSettlementAmount,
290
+ SDKValidationError
291
+ > {
292
+ return safeParse(
293
+ jsonString,
294
+ (x) =>
295
+ ListSettlementRefundResponseSettlementAmount$inboundSchema.parse(
296
+ JSON.parse(x),
297
+ ),
298
+ `Failed to parse 'ListSettlementRefundResponseSettlementAmount' from JSON`,
299
+ );
300
+ }
301
+
302
302
  /** @internal */
303
303
  export const ListSettlementRefundResponse$inboundSchema: z.ZodType<
304
304
  ListSettlementRefundResponse,
@@ -310,9 +310,6 @@ export const ListSettlementRefundResponse$inboundSchema: z.ZodType<
310
310
  mode: SettlementMode$inboundSchema,
311
311
  description: z.string(),
312
312
  amount: Amount$inboundSchema,
313
- settlementAmount: z.nullable(
314
- z.lazy(() => ListSettlementRefundResponseSettlementAmount$inboundSchema),
315
- ).optional(),
316
313
  metadata: z.nullable(Metadata$inboundSchema),
317
314
  paymentId: z.string(),
318
315
  settlementId: z.nullable(z.string()).optional(),
@@ -327,6 +324,9 @@ export const ListSettlementRefundResponse$inboundSchema: z.ZodType<
327
324
  )),
328
325
  ).optional(),
329
326
  _links: z.lazy(() => ListSettlementRefundResponseLinks$inboundSchema),
327
+ settlementAmount: z.nullable(
328
+ z.lazy(() => ListSettlementRefundResponseSettlementAmount$inboundSchema),
329
+ ).optional(),
330
330
  }).transform((v) => {
331
331
  return remap$(v, {
332
332
  "_links": "links",
@@ -0,0 +1,521 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 45ee14e5d815
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { RFCDate } from "../types/rfcdate.js";
10
+ import { Amount, Amount$inboundSchema } from "./amount.js";
11
+ import {
12
+ AmountNullable,
13
+ AmountNullable$inboundSchema,
14
+ } from "./amountnullable.js";
15
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
16
+ import {
17
+ PaymentDetailsCardAuditionResponse,
18
+ PaymentDetailsCardAuditionResponse$inboundSchema,
19
+ } from "./paymentdetailscardauditionresponse.js";
20
+ import {
21
+ PaymentDetailsCardFundingResponse,
22
+ PaymentDetailsCardFundingResponse$inboundSchema,
23
+ } from "./paymentdetailscardfundingresponse.js";
24
+ import {
25
+ PaymentDetailsCardLabelResponse,
26
+ PaymentDetailsCardLabelResponse$inboundSchema,
27
+ } from "./paymentdetailscardlabelresponse.js";
28
+ import {
29
+ PaymentDetailsCardSecurityResponse,
30
+ PaymentDetailsCardSecurityResponse$inboundSchema,
31
+ } from "./paymentdetailscardsecurityresponse.js";
32
+ import {
33
+ PaymentDetailsFailureReasonResponse,
34
+ PaymentDetailsFailureReasonResponse$inboundSchema,
35
+ } from "./paymentdetailsfailurereasonresponse.js";
36
+ import {
37
+ PaymentDetailsFeeRegionResponse,
38
+ PaymentDetailsFeeRegionResponse$inboundSchema,
39
+ } from "./paymentdetailsfeeregionresponse.js";
40
+ import {
41
+ PaymentDetailsReceiptCardReadMethodResponse,
42
+ PaymentDetailsReceiptCardReadMethodResponse$inboundSchema,
43
+ } from "./paymentdetailsreceiptcardreadmethodresponse.js";
44
+ import {
45
+ PaymentDetailsReceiptCardVerificationMethodResponse,
46
+ PaymentDetailsReceiptCardVerificationMethodResponse$inboundSchema,
47
+ } from "./paymentdetailsreceiptcardverificationmethodresponse.js";
48
+ import {
49
+ PaymentDetailsSellerProtectionResponse,
50
+ PaymentDetailsSellerProtectionResponse$inboundSchema,
51
+ } from "./paymentdetailssellerprotectionresponse.js";
52
+ import {
53
+ PaymentDetailsWalletResponse,
54
+ PaymentDetailsWalletResponse$inboundSchema,
55
+ } from "./paymentdetailswalletresponse.js";
56
+
57
+ /**
58
+ * The Point of sale receipt object.
59
+ *
60
+ * @remarks
61
+ *
62
+ * * `authorizationCode` _string|null_ - a unique code provided by the cardholder's bank to confirm that the
63
+ * transaction was successfully approved.
64
+ * * `applicationIdentifier` _string|null_ - the unique number that identifies a specific payment application
65
+ * on a chip card.
66
+ * * `cardReadMethod` _string|null_ - the method by which the card was read by the terminal. Possible values:
67
+ * `chip` | `magnetic-stripe` | `near-field-communication` | `contactless` | `moto`.
68
+ * * `cardVerificationMethod` _string|null_ - the method used to verify the cardholder's identity. Possible
69
+ * values: `no-cvm-required` | `online-pin` | `offline-pin` | `consumer-device` | `signature` |
70
+ * `signature-and-online-pin` | `online-pin-and-signature` | `none` | `failed`.
71
+ */
72
+ export type Receipt = {
73
+ /**
74
+ * A unique code provided by the cardholder's bank to confirm that the transaction was successfully approved.
75
+ */
76
+ authorizationCode?: string | null | undefined;
77
+ /**
78
+ * The unique number that identifies a specific payment application on a chip card.
79
+ */
80
+ applicationIdentifier?: string | null | undefined;
81
+ /**
82
+ * The method by which the card was read by the terminal.
83
+ */
84
+ cardReadMethod?:
85
+ | PaymentDetailsReceiptCardReadMethodResponse
86
+ | null
87
+ | undefined;
88
+ /**
89
+ * The method used to verify the cardholder's identity.
90
+ */
91
+ cardVerificationMethod?:
92
+ | PaymentDetailsReceiptCardVerificationMethodResponse
93
+ | null
94
+ | undefined;
95
+ };
96
+
97
+ /**
98
+ * **Optional include.** If a QR code was requested during payment creation for a QR-compatible payment method,
99
+ *
100
+ * @remarks
101
+ * the QR code details will be available in this object.
102
+ *
103
+ * The QR code can be scanned by the customer to complete the payment on their mobile device. For example,
104
+ * Bancontact QR payments can be completed by the customer using the Bancontact app.
105
+ *
106
+ * * `height` _integer_
107
+ * * `width` _integer_
108
+ * * `src` _string_
109
+ */
110
+ export type PaymentDetailsQrCode = {
111
+ /**
112
+ * The height of the QR code image in pixels.
113
+ */
114
+ height?: number | undefined;
115
+ /**
116
+ * The width of the QR code image in pixels.
117
+ */
118
+ width?: number | undefined;
119
+ /**
120
+ * The URL to the QR code image.
121
+ */
122
+ src?: string | undefined;
123
+ };
124
+
125
+ /**
126
+ * An object containing payment details collected during the payment process. For example, details may include the
127
+ *
128
+ * @remarks
129
+ * customer's card or bank details and a payment reference. For the full list of details, please refer to the
130
+ * [method-specific parameters](extra-payment-parameters) guide.
131
+ */
132
+ export type PaymentDetails = {
133
+ /**
134
+ * The customer's name, if made available by the payment method. For card payments, refer to `details.cardHolder`.
135
+ */
136
+ consumerName?: string | null | undefined;
137
+ /**
138
+ * The customer's account reference.
139
+ *
140
+ * @remarks
141
+ *
142
+ * For banking-based payment methods — such as iDEAL — this is normally either an IBAN or a domestic bank
143
+ * account number.
144
+ *
145
+ * For PayPal, the account reference is an email address.
146
+ *
147
+ * For card and Bancontact payments, refer to `details.cardNumber`.
148
+ */
149
+ consumerAccount?: string | null | undefined;
150
+ /**
151
+ * The BIC of the customer's bank account, if applicable.
152
+ */
153
+ consumerBic?: string | null | undefined;
154
+ /**
155
+ * For wallet payment methods — such as Apple Pay and PayPal — the shipping address is often already known by
156
+ *
157
+ * @remarks
158
+ * the wallet provider. In these cases the shipping address may be available as a payment detail.
159
+ */
160
+ shippingAddress?: { [k: string]: any } | null | undefined;
161
+ /**
162
+ * The customer's masked card number.
163
+ */
164
+ cardNumber?: string | null | undefined;
165
+ /**
166
+ * The name of the bank that the customer will need to make the bank transfer payment towards.
167
+ */
168
+ bankName?: string | undefined;
169
+ /**
170
+ * The bank account number the customer will need to make the bank transfer payment towards.
171
+ */
172
+ bankAccount?: string | undefined;
173
+ /**
174
+ * The BIC of the bank the customer will need to make the bank transfer payment towards.
175
+ */
176
+ bankBic?: string | undefined;
177
+ /**
178
+ * The Mollie-generated reference the customer needs to use when transfering the amount. Do not apply any
179
+ *
180
+ * @remarks
181
+ * formatting here; show it to the customer as-is.
182
+ */
183
+ transferReference?: string | null | undefined;
184
+ /**
185
+ * Bizum payment reference of the transaction.
186
+ */
187
+ bizumReference?: string | null | undefined;
188
+ /**
189
+ * A unique fingerprint for this specific card. Can be used to identify returning customers.
190
+ */
191
+ cardFingerprint?: string | null | undefined;
192
+ /**
193
+ * The customer's name as shown on their card.
194
+ */
195
+ cardHolder?: string | null | undefined;
196
+ /**
197
+ * The card's target audience, if known.
198
+ */
199
+ cardAudience?: PaymentDetailsCardAuditionResponse | null | undefined;
200
+ /**
201
+ * The card's label, if known.
202
+ */
203
+ cardLabel?: PaymentDetailsCardLabelResponse | null | undefined;
204
+ /**
205
+ * The ISO 3166-1 alpha-2 country code of the country the card was issued in.
206
+ */
207
+ cardCountryCode?: string | null | undefined;
208
+ /**
209
+ * The expiry date (`MM/YY`) of the card as displayed on the card.
210
+ */
211
+ cardExpiryDate?: string | null | undefined;
212
+ /**
213
+ * The card type.
214
+ */
215
+ cardFunding?: PaymentDetailsCardFundingResponse | null | undefined;
216
+ /**
217
+ * The level of security applied during card processing.
218
+ */
219
+ cardSecurity?: PaymentDetailsCardSecurityResponse | null | undefined;
220
+ /**
221
+ * The applicable card fee region.
222
+ */
223
+ feeRegion?: PaymentDetailsFeeRegionResponse | null | undefined;
224
+ /**
225
+ * The first6 and last4 digits of the card number.
226
+ */
227
+ cardMaskedNumber?: string | null | undefined;
228
+ /**
229
+ * The outcome of authentication attempted on transactions enforced by 3DS (ie valid only for `oneoff` and `first`).
230
+ */
231
+ card3dsEci?: string | null | undefined;
232
+ /**
233
+ * The first6 digit of the card bank identification number.
234
+ */
235
+ cardBin?: string | null | undefined;
236
+ /**
237
+ * The issuer of the Card.
238
+ */
239
+ cardIssuer?: string | null | undefined;
240
+ /**
241
+ * A failure code to help understand why the payment failed.
242
+ */
243
+ failureReason?: PaymentDetailsFailureReasonResponse | null | undefined;
244
+ /**
245
+ * A human-friendly failure message that can be shown to the customer. The message is translated in accordance
246
+ *
247
+ * @remarks
248
+ * with the payment's locale setting.
249
+ */
250
+ failureMessage?: string | null | undefined;
251
+ /**
252
+ * The wallet used when creating the payment.
253
+ */
254
+ wallet?: PaymentDetailsWalletResponse | null | undefined;
255
+ /**
256
+ * Multibanco payment reference of the transaction.
257
+ */
258
+ multibancoReference?: string | null | undefined;
259
+ /**
260
+ * Multibanco entity reference of the transaction.
261
+ */
262
+ multibancoEntity?: string | null | undefined;
263
+ /**
264
+ * PayPal's reference for the payment.
265
+ */
266
+ paypalReference?: string | null | undefined;
267
+ /**
268
+ * ID of the customer's PayPal account.
269
+ */
270
+ paypalPayerId?: string | null | undefined;
271
+ /**
272
+ * Indicates to what extent the payment is eligible for PayPal's Seller Protection. Only available for PayPal
273
+ *
274
+ * @remarks
275
+ * payments, and if the information is made available by PayPal.
276
+ */
277
+ sellerProtection?: PaymentDetailsSellerProtectionResponse | null | undefined;
278
+ /**
279
+ * In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
280
+ */
281
+ paypalFee?: AmountNullable | null | undefined;
282
+ /**
283
+ * The paysafecard customer reference either provided via the API or otherwise auto-generated by Mollie.
284
+ */
285
+ customerReference?: string | undefined;
286
+ /**
287
+ * The ID of the terminal device where the payment took place on.
288
+ */
289
+ terminalId?: string | undefined;
290
+ /**
291
+ * The first 6 digits & last 4 digits of the customer's masked card number.
292
+ */
293
+ maskedNumber?: string | null | undefined;
294
+ /**
295
+ * The Point of sale receipt object.
296
+ *
297
+ * @remarks
298
+ *
299
+ * * `authorizationCode` _string|null_ - a unique code provided by the cardholder's bank to confirm that the
300
+ * transaction was successfully approved.
301
+ * * `applicationIdentifier` _string|null_ - the unique number that identifies a specific payment application
302
+ * on a chip card.
303
+ * * `cardReadMethod` _string|null_ - the method by which the card was read by the terminal. Possible values:
304
+ * `chip` | `magnetic-stripe` | `near-field-communication` | `contactless` | `moto`.
305
+ * * `cardVerificationMethod` _string|null_ - the method used to verify the cardholder's identity. Possible
306
+ * values: `no-cvm-required` | `online-pin` | `offline-pin` | `consumer-device` | `signature` |
307
+ * `signature-and-online-pin` | `online-pin-and-signature` | `none` | `failed`.
308
+ */
309
+ receipt?: Receipt | undefined;
310
+ /**
311
+ * The creditor identifier indicates who is authorized to execute the payment. In this case, it is a reference
312
+ *
313
+ * @remarks
314
+ * to Mollie.
315
+ */
316
+ creditorIdentifier?: string | null | undefined;
317
+ /**
318
+ * Estimated date the payment is debited from the customer's bank account, in `YYYY-MM-DD` format.
319
+ */
320
+ dueDate?: RFCDate | null | undefined;
321
+ /**
322
+ * Date the payment has been signed by the customer, in `YYYY-MM-DD` format. Only available if the payment has
323
+ *
324
+ * @remarks
325
+ * been signed.
326
+ */
327
+ signatureDate?: RFCDate | null | undefined;
328
+ /**
329
+ * The official reason why this payment has failed. A detailed description of each reason is available on the
330
+ *
331
+ * @remarks
332
+ * website of the European Payments Council.
333
+ */
334
+ bankReasonCode?: string | null | undefined;
335
+ /**
336
+ * A human-friendly description of the failure reason.
337
+ */
338
+ bankReason?: string | null | undefined;
339
+ /**
340
+ * The end-to-end identifier you provided in the batch file.
341
+ */
342
+ endToEndIdentifier?: string | null | undefined;
343
+ /**
344
+ * The mandate reference you provided in the batch file.
345
+ */
346
+ mandateReference?: string | null | undefined;
347
+ /**
348
+ * The batch reference you provided in the batch file.
349
+ */
350
+ batchReference?: string | null | undefined;
351
+ /**
352
+ * The file reference you provided in the batch file.
353
+ */
354
+ fileReference?: string | null | undefined;
355
+ /**
356
+ * **Optional include.** If a QR code was requested during payment creation for a QR-compatible payment method,
357
+ *
358
+ * @remarks
359
+ * the QR code details will be available in this object.
360
+ *
361
+ * The QR code can be scanned by the customer to complete the payment on their mobile device. For example,
362
+ * Bancontact QR payments can be completed by the customer using the Bancontact app.
363
+ *
364
+ * * `height` _integer_
365
+ * * `width` _integer_
366
+ * * `src` _string_
367
+ */
368
+ qrCode?: PaymentDetailsQrCode | undefined;
369
+ /**
370
+ * For payments with gift cards: the masked gift card number of the first gift card applied to the payment.
371
+ */
372
+ voucherNumber?: string | undefined;
373
+ /**
374
+ * An array of detail objects for each gift card that was used on this payment, if any.
375
+ */
376
+ giftcards?: Array<{ [k: string]: any }> | undefined;
377
+ /**
378
+ * For payments with vouchers: the brand name of the first voucher applied.
379
+ */
380
+ issuer?: string | undefined;
381
+ /**
382
+ * An array of detail objects for each voucher that was used on this payment, if any.
383
+ */
384
+ vouchers?: Array<{ [k: string]: any }> | undefined;
385
+ /**
386
+ * In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
387
+ */
388
+ remainderAmount?: Amount | undefined;
389
+ /**
390
+ * The payment method used to pay the remainder amount, after all gift cards or vouchers were applied.
391
+ */
392
+ remainderMethod?: string | undefined;
393
+ /**
394
+ * **Optional include.** The full payment method details of the remainder payment.
395
+ */
396
+ remainderDetails?: { [k: string]: any } | undefined;
397
+ };
398
+
399
+ /** @internal */
400
+ export const Receipt$inboundSchema: z.ZodType<Receipt, z.ZodTypeDef, unknown> =
401
+ z.object({
402
+ authorizationCode: z.nullable(z.string()).optional(),
403
+ applicationIdentifier: z.nullable(z.string()).optional(),
404
+ cardReadMethod: z.nullable(
405
+ PaymentDetailsReceiptCardReadMethodResponse$inboundSchema,
406
+ ).optional(),
407
+ cardVerificationMethod: z.nullable(
408
+ PaymentDetailsReceiptCardVerificationMethodResponse$inboundSchema,
409
+ ).optional(),
410
+ });
411
+
412
+ export function receiptFromJSON(
413
+ jsonString: string,
414
+ ): SafeParseResult<Receipt, SDKValidationError> {
415
+ return safeParse(
416
+ jsonString,
417
+ (x) => Receipt$inboundSchema.parse(JSON.parse(x)),
418
+ `Failed to parse 'Receipt' from JSON`,
419
+ );
420
+ }
421
+
422
+ /** @internal */
423
+ export const PaymentDetailsQrCode$inboundSchema: z.ZodType<
424
+ PaymentDetailsQrCode,
425
+ z.ZodTypeDef,
426
+ unknown
427
+ > = z.object({
428
+ height: z.number().int().optional(),
429
+ width: z.number().int().optional(),
430
+ src: z.string().optional(),
431
+ });
432
+
433
+ export function paymentDetailsQrCodeFromJSON(
434
+ jsonString: string,
435
+ ): SafeParseResult<PaymentDetailsQrCode, SDKValidationError> {
436
+ return safeParse(
437
+ jsonString,
438
+ (x) => PaymentDetailsQrCode$inboundSchema.parse(JSON.parse(x)),
439
+ `Failed to parse 'PaymentDetailsQrCode' from JSON`,
440
+ );
441
+ }
442
+
443
+ /** @internal */
444
+ export const PaymentDetails$inboundSchema: z.ZodType<
445
+ PaymentDetails,
446
+ z.ZodTypeDef,
447
+ unknown
448
+ > = z.object({
449
+ consumerName: z.nullable(z.string()).optional(),
450
+ consumerAccount: z.nullable(z.string()).optional(),
451
+ consumerBic: z.nullable(z.string()).optional(),
452
+ shippingAddress: z.nullable(z.record(z.any())).optional(),
453
+ cardNumber: z.nullable(z.string()).optional(),
454
+ bankName: z.string().optional(),
455
+ bankAccount: z.string().optional(),
456
+ bankBic: z.string().optional(),
457
+ transferReference: z.nullable(z.string()).optional(),
458
+ bizumReference: z.nullable(z.string()).optional(),
459
+ cardFingerprint: z.nullable(z.string()).optional(),
460
+ cardHolder: z.nullable(z.string()).optional(),
461
+ cardAudience: z.nullable(PaymentDetailsCardAuditionResponse$inboundSchema)
462
+ .optional(),
463
+ cardLabel: z.nullable(PaymentDetailsCardLabelResponse$inboundSchema)
464
+ .optional(),
465
+ cardCountryCode: z.nullable(z.string()).optional(),
466
+ cardExpiryDate: z.nullable(z.string()).optional(),
467
+ cardFunding: z.nullable(PaymentDetailsCardFundingResponse$inboundSchema)
468
+ .optional(),
469
+ cardSecurity: z.nullable(PaymentDetailsCardSecurityResponse$inboundSchema)
470
+ .optional(),
471
+ feeRegion: z.nullable(PaymentDetailsFeeRegionResponse$inboundSchema)
472
+ .optional(),
473
+ cardMaskedNumber: z.nullable(z.string()).optional(),
474
+ card3dsEci: z.nullable(z.string()).optional(),
475
+ cardBin: z.nullable(z.string()).optional(),
476
+ cardIssuer: z.nullable(z.string()).optional(),
477
+ failureReason: z.nullable(PaymentDetailsFailureReasonResponse$inboundSchema)
478
+ .optional(),
479
+ failureMessage: z.nullable(z.string()).optional(),
480
+ wallet: z.nullable(PaymentDetailsWalletResponse$inboundSchema).optional(),
481
+ multibancoReference: z.nullable(z.string()).optional(),
482
+ multibancoEntity: z.nullable(z.string()).optional(),
483
+ paypalReference: z.nullable(z.string()).optional(),
484
+ paypalPayerId: z.nullable(z.string()).optional(),
485
+ sellerProtection: z.nullable(
486
+ PaymentDetailsSellerProtectionResponse$inboundSchema,
487
+ ).optional(),
488
+ paypalFee: z.nullable(AmountNullable$inboundSchema).optional(),
489
+ customerReference: z.string().optional(),
490
+ terminalId: z.string().optional(),
491
+ maskedNumber: z.nullable(z.string()).optional(),
492
+ receipt: z.lazy(() => Receipt$inboundSchema).optional(),
493
+ creditorIdentifier: z.nullable(z.string()).optional(),
494
+ dueDate: z.nullable(z.string().transform(v => new RFCDate(v))).optional(),
495
+ signatureDate: z.nullable(z.string().transform(v => new RFCDate(v)))
496
+ .optional(),
497
+ bankReasonCode: z.nullable(z.string()).optional(),
498
+ bankReason: z.nullable(z.string()).optional(),
499
+ endToEndIdentifier: z.nullable(z.string()).optional(),
500
+ mandateReference: z.nullable(z.string()).optional(),
501
+ batchReference: z.nullable(z.string()).optional(),
502
+ fileReference: z.nullable(z.string()).optional(),
503
+ qrCode: z.lazy(() => PaymentDetailsQrCode$inboundSchema).optional(),
504
+ voucherNumber: z.string().optional(),
505
+ giftcards: z.array(z.record(z.any())).optional(),
506
+ issuer: z.string().optional(),
507
+ vouchers: z.array(z.record(z.any())).optional(),
508
+ remainderAmount: Amount$inboundSchema.optional(),
509
+ remainderMethod: z.string().optional(),
510
+ remainderDetails: z.record(z.any()).optional(),
511
+ });
512
+
513
+ export function paymentDetailsFromJSON(
514
+ jsonString: string,
515
+ ): SafeParseResult<PaymentDetails, SDKValidationError> {
516
+ return safeParse(
517
+ jsonString,
518
+ (x) => PaymentDetails$inboundSchema.parse(JSON.parse(x)),
519
+ `Failed to parse 'PaymentDetails' from JSON`,
520
+ );
521
+ }