gr4vy 1.1.29__py3-none-any.whl → 1.10.9__py3-none-any.whl

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 (219) hide show
  1. gr4vy/_version.py +3 -3
  2. gr4vy/account_updater.py +6 -3
  3. gr4vy/actions.py +307 -0
  4. gr4vy/all.py +4 -2
  5. gr4vy/audit_logs.py +6 -4
  6. gr4vy/balances.py +4 -2
  7. gr4vy/basesdk.py +17 -1
  8. gr4vy/buyers_gift_cards.py +4 -2
  9. gr4vy/buyers_payment_methods.py +4 -2
  10. gr4vy/buyers_sdk.py +43 -25
  11. gr4vy/buyers_shipping_details.py +26 -16
  12. gr4vy/card_scheme_definitions_sdk.py +4 -2
  13. gr4vy/checkout_sessions.py +40 -14
  14. gr4vy/digital_wallets_sdk.py +32 -20
  15. gr4vy/domains.py +14 -10
  16. gr4vy/errors/__init__.py +15 -3
  17. gr4vy/errors/apierror.py +2 -0
  18. gr4vy/errors/error400.py +4 -6
  19. gr4vy/errors/error401.py +4 -6
  20. gr4vy/errors/error403.py +4 -6
  21. gr4vy/errors/error404.py +4 -6
  22. gr4vy/errors/error405.py +4 -6
  23. gr4vy/errors/error409.py +4 -6
  24. gr4vy/errors/error425.py +4 -6
  25. gr4vy/errors/error429.py +4 -6
  26. gr4vy/errors/error500.py +4 -6
  27. gr4vy/errors/error502.py +4 -6
  28. gr4vy/errors/error504.py +4 -6
  29. gr4vy/errors/gr4vyerror.py +11 -7
  30. gr4vy/errors/httpvalidationerror.py +4 -2
  31. gr4vy/errors/no_response_error.py +5 -1
  32. gr4vy/errors/responsevalidationerror.py +2 -0
  33. gr4vy/events.py +54 -7
  34. gr4vy/executions.py +38 -8
  35. gr4vy/gift_cards_sdk.py +29 -19
  36. gr4vy/httpclient.py +0 -1
  37. gr4vy/jobs.py +4 -2
  38. gr4vy/merchant_accounts_sdk.py +30 -10
  39. gr4vy/models/__init__.py +184 -30
  40. gr4vy/models/adyenautorescuesepascenariosenum.py +3 -1
  41. gr4vy/models/adyencardoptions.py +9 -6
  42. gr4vy/models/adyensepaoptions.py +1 -6
  43. gr4vy/models/adyensplitsoptions.py +57 -0
  44. gr4vy/models/airline.py +9 -8
  45. gr4vy/models/airlineleg.py +9 -7
  46. gr4vy/models/airlinepassenger.py +9 -7
  47. gr4vy/models/antifrauddecision.py +9 -1
  48. gr4vy/models/approvaltarget.py +7 -1
  49. gr4vy/models/auditlogaction.py +9 -1
  50. gr4vy/models/auditlogentry.py +3 -3
  51. gr4vy/models/auditlogentryuser.py +3 -3
  52. gr4vy/models/{billingdetails_input.py → billingdetails.py} +2 -2
  53. gr4vy/models/braintreedynamicdatafieldsoptions.py +33 -3
  54. gr4vy/models/browserinfo.py +9 -5
  55. gr4vy/models/buyer.py +3 -3
  56. gr4vy/models/buyercreate.py +3 -3
  57. gr4vy/models/buyerupdate.py +3 -3
  58. gr4vy/models/cancel_transactionop.py +43 -0
  59. gr4vy/models/cancelstatus.py +15 -0
  60. gr4vy/models/capturestatus.py +7 -1
  61. gr4vy/models/cardtype.py +8 -1
  62. gr4vy/models/cartitem.py +53 -8
  63. gr4vy/models/chaseoptions.py +46 -0
  64. gr4vy/models/checkoutsession.py +24 -3
  65. gr4vy/models/checkoutsessioncreate.py +39 -5
  66. gr4vy/models/checkoutsessionpaymentmethod.py +3 -5
  67. gr4vy/models/checkoutsessionpaymentmethoddetails.py +2 -6
  68. gr4vy/models/create_payment_methodop.py +6 -0
  69. gr4vy/models/create_report_execution_urlop.py +16 -1
  70. gr4vy/models/createsession.py +3 -3
  71. gr4vy/models/createsessionstatus.py +7 -1
  72. gr4vy/models/cvvresponsecode.py +7 -1
  73. gr4vy/models/cybersourceoptions.py +7 -0
  74. gr4vy/models/definitionfield.py +1 -6
  75. gr4vy/models/definitionfieldformat.py +8 -1
  76. gr4vy/models/digitalwallet.py +3 -5
  77. gr4vy/models/digitalwalletcreate.py +2 -6
  78. gr4vy/models/digitalwalletprovider.py +6 -1
  79. gr4vy/models/dlocalupioptions.py +50 -0
  80. gr4vy/models/dlocalupirecurringinfooptions.py +47 -0
  81. gr4vy/models/dlocalupiwalletoptions.py +89 -0
  82. gr4vy/models/errordetail.py +2 -4
  83. gr4vy/models/errorlocation.py +8 -1
  84. gr4vy/models/flow.py +16 -0
  85. gr4vy/models/flowaction.py +16 -0
  86. gr4vy/models/forterantifraudoptions.py +8 -8
  87. gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +10 -8
  88. gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +9 -7
  89. gr4vy/models/giftcardredemption.py +4 -8
  90. gr4vy/models/giftcardredemptionstatus.py +7 -1
  91. gr4vy/models/giftcardservice.py +3 -5
  92. gr4vy/models/giftcardserviceprovider.py +5 -1
  93. gr4vy/models/giftcardsummary.py +3 -5
  94. gr4vy/models/{guestbuyer_input.py → guestbuyer.py} +5 -5
  95. gr4vy/models/instrumenttype.py +1 -0
  96. gr4vy/models/integrationclient.py +16 -0
  97. gr4vy/models/internal/__init__.py +14 -1
  98. gr4vy/models/list_all_report_executionsop.py +2 -14
  99. gr4vy/models/list_audit_logsop.py +2 -10
  100. gr4vy/models/list_buyer_payment_methodsop.py +9 -4
  101. gr4vy/models/list_payment_methodsop.py +2 -14
  102. gr4vy/models/list_payment_servicesop.py +2 -8
  103. gr4vy/models/list_reportsop.py +2 -10
  104. gr4vy/models/list_transaction_actionsop.py +43 -0
  105. gr4vy/models/list_transaction_eventsop.py +12 -1
  106. gr4vy/models/list_transactionsop.py +14 -22
  107. gr4vy/models/merchantaccount.py +9 -5
  108. gr4vy/models/merchantaccountcreate.py +8 -6
  109. gr4vy/models/merchantaccountupdate.py +8 -6
  110. gr4vy/models/merchantprofilescheme.py +7 -7
  111. gr4vy/models/merchantprofileschemesummary.py +7 -7
  112. gr4vy/models/method.py +4 -0
  113. gr4vy/models/mockcardoptions.py +7 -2
  114. gr4vy/models/mode.py +1 -0
  115. gr4vy/models/monatospeioptions.py +15 -0
  116. gr4vy/models/networktoken.py +3 -3
  117. gr4vy/models/networktokenpaymentmethodcreate.py +11 -9
  118. gr4vy/models/networktokenstatus.py +7 -1
  119. gr4vy/models/nuveiidealoptions.py +49 -0
  120. gr4vy/models/nuveipseoptions.py +70 -0
  121. gr4vy/models/paymentlink.py +25 -7
  122. gr4vy/models/paymentlinkcreate.py +23 -28
  123. gr4vy/models/paymentlinkstatus.py +7 -1
  124. gr4vy/models/paymentmethod.py +7 -13
  125. gr4vy/models/paymentmethodcard.py +3 -5
  126. gr4vy/models/paymentmethoddetailscard.py +2 -6
  127. gr4vy/models/paymentmethodstatus.py +7 -1
  128. gr4vy/models/paymentmethodsummary.py +6 -12
  129. gr4vy/models/paymentoption.py +3 -3
  130. gr4vy/models/paymentservice.py +4 -6
  131. gr4vy/models/paymentserviceconfiguration.py +2 -6
  132. gr4vy/models/paymentservicedefinition.py +11 -5
  133. gr4vy/models/paymentservicestatus.py +8 -1
  134. gr4vy/models/paymentservicetoken.py +3 -3
  135. gr4vy/models/payoutcategory.py +1 -1
  136. gr4vy/models/payoutcreate.py +5 -9
  137. gr4vy/models/payoutstatus.py +7 -1
  138. gr4vy/models/payoutsummary.py +4 -6
  139. gr4vy/models/paypaloptions.py +8 -2
  140. gr4vy/models/paypalshippingoptions.py +51 -0
  141. gr4vy/models/paypalshippingoptionsitem.py +89 -0
  142. gr4vy/models/paypalshippingoptionsitemamount.py +20 -0
  143. gr4vy/models/plaidpaymentmethodcreate.py +106 -0
  144. gr4vy/models/redirectpaymentmethodcreate.py +4 -6
  145. gr4vy/models/refund.py +4 -4
  146. gr4vy/models/refundstatus.py +8 -1
  147. gr4vy/models/refundtargettype.py +5 -1
  148. gr4vy/models/report.py +4 -6
  149. gr4vy/models/reportcreate.py +2 -3
  150. gr4vy/models/reportcreatortype.py +7 -1
  151. gr4vy/models/reportexecution.py +3 -3
  152. gr4vy/models/reportexecutionstatus.py +7 -1
  153. gr4vy/models/reportexecutionsummary.py +3 -3
  154. gr4vy/models/reportexecutionurlgenerate.py +16 -0
  155. gr4vy/models/reportschedule.py +9 -1
  156. gr4vy/models/reportspec.py +2 -4
  157. gr4vy/models/reportsummary.py +3 -5
  158. gr4vy/models/settlement.py +32 -32
  159. gr4vy/models/statementdescriptor.py +7 -0
  160. gr4vy/models/stripeconnectoptions.py +7 -0
  161. gr4vy/models/taxid.py +2 -4
  162. gr4vy/models/taxidkind.py +7 -0
  163. gr4vy/models/threedsecuredatav1.py +2 -6
  164. gr4vy/models/threedsecuredatav2.py +2 -6
  165. gr4vy/models/threedsecuremethod.py +7 -1
  166. gr4vy/models/threedsecurestatus.py +7 -1
  167. gr4vy/models/transaction.py +86 -25
  168. gr4vy/models/transactionaction.py +48 -0
  169. gr4vy/models/transactionactions.py +17 -0
  170. gr4vy/models/transactionbuyer.py +3 -3
  171. gr4vy/models/transactioncancel.py +81 -0
  172. gr4vy/models/transactioncapture.py +3 -3
  173. gr4vy/models/transactionconnectionoptions.py +50 -0
  174. gr4vy/models/transactioncreate.py +76 -12
  175. gr4vy/models/transactionevent.py +10 -3
  176. gr4vy/models/transactionintent.py +7 -1
  177. gr4vy/models/transactionintentoutcome.py +6 -1
  178. gr4vy/models/transactionpaymentmethod.py +6 -12
  179. gr4vy/models/transactionpaymentservice.py +3 -3
  180. gr4vy/models/transactionpaymentsource.py +7 -1
  181. gr4vy/models/transactionrefundcreate.py +2 -6
  182. gr4vy/models/transactionsummary.py +11 -10
  183. gr4vy/models/transactionthreedsecuresummary.py +3 -9
  184. gr4vy/models/transactionvoid.py +3 -3
  185. gr4vy/models/userstatus.py +8 -1
  186. gr4vy/models/voidstatus.py +7 -1
  187. gr4vy/network_tokens_cryptogram.py +4 -2
  188. gr4vy/payment_links_sdk.py +36 -16
  189. gr4vy/payment_methods_network_tokens.py +27 -13
  190. gr4vy/payment_methods_payment_service_tokens.py +12 -6
  191. gr4vy/payment_methods_sdk.py +26 -14
  192. gr4vy/payment_options_sdk.py +4 -2
  193. gr4vy/payment_service_definitions_sdk.py +14 -8
  194. gr4vy/payment_services_sdk.py +36 -22
  195. gr4vy/payouts.py +18 -12
  196. gr4vy/refunds_sdk.py +4 -2
  197. gr4vy/report_executions_sdk.py +6 -4
  198. gr4vy/reports_sdk.py +23 -13
  199. gr4vy/sdk.py +17 -4
  200. gr4vy/sessions.py +12 -6
  201. gr4vy/transactions.py +446 -33
  202. gr4vy/transactions_refunds.py +17 -9
  203. gr4vy/transactions_settlements.py +8 -4
  204. gr4vy/types/basemodel.py +41 -3
  205. gr4vy/utils/__init__.py +15 -6
  206. gr4vy/utils/annotations.py +32 -8
  207. gr4vy/utils/enums.py +60 -0
  208. gr4vy/utils/eventstreaming.py +10 -0
  209. gr4vy/utils/forms.py +21 -10
  210. gr4vy/utils/queryparams.py +14 -2
  211. gr4vy/utils/requestbodies.py +1 -1
  212. gr4vy/utils/retries.py +69 -5
  213. gr4vy/utils/serializers.py +0 -20
  214. gr4vy/utils/unmarshal_json_response.py +15 -1
  215. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/METADATA +43 -41
  216. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/RECORD +217 -196
  217. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/WHEEL +1 -1
  218. gr4vy/models/billingdetails_output.py +0 -87
  219. gr4vy/models/guestbuyer_output.py +0 -80
@@ -0,0 +1,43 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import BaseModel
5
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
6
+ import pydantic
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
9
+
10
+
11
+ class ListTransactionActionsGlobalsTypedDict(TypedDict):
12
+ merchant_account_id: NotRequired[str]
13
+ r"""The ID of the merchant account to use for this request."""
14
+
15
+
16
+ class ListTransactionActionsGlobals(BaseModel):
17
+ merchant_account_id: Annotated[
18
+ Optional[str],
19
+ pydantic.Field(alias="x-gr4vy-merchant-account-id"),
20
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
21
+ ] = None
22
+ r"""The ID of the merchant account to use for this request."""
23
+
24
+
25
+ class ListTransactionActionsRequestTypedDict(TypedDict):
26
+ transaction_id: str
27
+ r"""The ID of the transaction"""
28
+ merchant_account_id: NotRequired[str]
29
+ r"""The ID of the merchant account to use for this request."""
30
+
31
+
32
+ class ListTransactionActionsRequest(BaseModel):
33
+ transaction_id: Annotated[
34
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
35
+ ]
36
+ r"""The ID of the transaction"""
37
+
38
+ merchant_account_id: Annotated[
39
+ Optional[str],
40
+ pydantic.Field(alias="x-gr4vy-merchant-account-id"),
41
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
42
+ ] = None
43
+ r"""The ID of the merchant account to use for this request."""
@@ -1,6 +1,7 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .transactionevents import TransactionEvents, TransactionEventsTypedDict
4
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
6
  from gr4vy.utils import (
6
7
  FieldMetadata,
@@ -10,7 +11,7 @@ from gr4vy.utils import (
10
11
  )
11
12
  import pydantic
12
13
  from pydantic import model_serializer
13
- from typing import Optional
14
+ from typing import Callable, Optional
14
15
  from typing_extensions import Annotated, NotRequired, TypedDict
15
16
 
16
17
 
@@ -93,3 +94,13 @@ class ListTransactionEventsRequest(BaseModel):
93
94
  m[k] = val
94
95
 
95
96
  return m
97
+
98
+
99
+ class ListTransactionEventsResponseTypedDict(TypedDict):
100
+ result: TransactionEventsTypedDict
101
+
102
+
103
+ class ListTransactionEventsResponse(BaseModel):
104
+ next: Callable[[], Optional[ListTransactionEventsResponse]]
105
+
106
+ result: TransactionEvents
@@ -7,15 +7,9 @@ from .transactionstatus import TransactionStatus
7
7
  from .transactionsummaries import TransactionSummaries, TransactionSummariesTypedDict
8
8
  from datetime import datetime
9
9
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
10
- from gr4vy.utils import (
11
- FieldMetadata,
12
- HeaderMetadata,
13
- QueryParamMetadata,
14
- validate_open_enum,
15
- )
10
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
16
11
  import pydantic
17
12
  from pydantic import model_serializer
18
- from pydantic.functional_validators import PlainValidator
19
13
  from typing import Callable, List, Optional
20
14
  from typing_extensions import Annotated, NotRequired, TypedDict
21
15
 
@@ -108,6 +102,8 @@ class ListTransactionsRequestTypedDict(TypedDict):
108
102
  r"""Filters for transactions where the `merchant_initiated` matches the provided value."""
109
103
  used_3ds: NotRequired[Nullable[bool]]
110
104
  r"""Filters for transactions that attempted 3DS authentication or not."""
105
+ disputed: NotRequired[Nullable[bool]]
106
+ r"""Filters for transactions that have been disputed."""
111
107
  buyer_search: NotRequired[Nullable[List[str]]]
112
108
  r"""Filters the results to only get the items for which some of the buyer data contains exactly the provided `buyer_search` values."""
113
109
  merchant_account_id: NotRequired[str]
@@ -177,11 +173,7 @@ class ListTransactionsRequest(BaseModel):
177
173
  ] = UNSET
178
174
 
179
175
  status: Annotated[
180
- OptionalNullable[
181
- List[
182
- Annotated[TransactionStatus, PlainValidator(validate_open_enum(False))]
183
- ]
184
- ],
176
+ OptionalNullable[List[TransactionStatus]],
185
177
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
186
178
  ] = UNSET
187
179
  r"""Filters the results to only the transactions that have a `status` that matches with any of the provided status values."""
@@ -271,9 +263,7 @@ class ListTransactionsRequest(BaseModel):
271
263
  ] = UNSET
272
264
 
273
265
  method: Annotated[
274
- OptionalNullable[
275
- List[Annotated[Method, PlainValidator(validate_open_enum(False))]]
276
- ],
266
+ OptionalNullable[List[Method]],
277
267
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
278
268
  ] = UNSET
279
269
  r"""Filters for transactions that have matching `method` values."""
@@ -339,13 +329,7 @@ class ListTransactionsRequest(BaseModel):
339
329
  r"""Filter for transactions that have a card with a BIN that matches exactly with the provided value."""
340
330
 
341
331
  payment_source: Annotated[
342
- OptionalNullable[
343
- List[
344
- Annotated[
345
- TransactionPaymentSource, PlainValidator(validate_open_enum(False))
346
- ]
347
- ]
348
- ],
332
+ OptionalNullable[List[TransactionPaymentSource]],
349
333
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
350
334
  ] = UNSET
351
335
  r"""Filters the results to only the transactions that have a payment source that matches with any of the provided values."""
@@ -368,6 +352,12 @@ class ListTransactionsRequest(BaseModel):
368
352
  ] = UNSET
369
353
  r"""Filters for transactions that attempted 3DS authentication or not."""
370
354
 
355
+ disputed: Annotated[
356
+ OptionalNullable[bool],
357
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
358
+ ] = UNSET
359
+ r"""Filters for transactions that have been disputed."""
360
+
371
361
  buyer_search: Annotated[
372
362
  OptionalNullable[List[str]],
373
363
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -426,6 +416,7 @@ class ListTransactionsRequest(BaseModel):
426
416
  "is_subsequent_payment",
427
417
  "merchant_initiated",
428
418
  "used_3ds",
419
+ "disputed",
429
420
  "buyer_search",
430
421
  "merchant_account_id",
431
422
  ]
@@ -471,6 +462,7 @@ class ListTransactionsRequest(BaseModel):
471
462
  "is_subsequent_payment",
472
463
  "merchant_initiated",
473
464
  "used_3ds",
465
+ "disputed",
474
466
  "buyer_search",
475
467
  ]
476
468
  null_default_fields = []
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from datetime import datetime
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
9
  from pydantic import model_serializer
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import List, Literal, Optional
12
12
  from typing_extensions import Annotated, NotRequired, TypedDict
13
13
 
@@ -55,6 +55,8 @@ class MerchantAccountTypedDict(TypedDict):
55
55
  r"""Requestor ID provided for Mastercard after onboarding to use Network Tokens."""
56
56
  mastercard_network_tokens_app_id: NotRequired[Nullable[str]]
57
57
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
58
+ async_network_tokens_enabled: NotRequired[bool]
59
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
58
60
 
59
61
 
60
62
  class MerchantAccount(BaseModel):
@@ -88,9 +90,7 @@ class MerchantAccount(BaseModel):
88
90
  loon_secret_key: OptionalNullable[str] = UNSET
89
91
  r"""Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
90
92
 
91
- loon_accepted_schemes: OptionalNullable[
92
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
93
- ] = UNSET
93
+ loon_accepted_schemes: OptionalNullable[List[CardScheme]] = UNSET
94
94
  r"""Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
95
95
 
96
96
  account_updater_request_encryption_key: OptionalNullable[str] = UNSET
@@ -129,6 +129,9 @@ class MerchantAccount(BaseModel):
129
129
  mastercard_network_tokens_app_id: OptionalNullable[str] = UNSET
130
130
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
131
131
 
132
+ async_network_tokens_enabled: Optional[bool] = False
133
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
134
+
132
135
  @model_serializer(mode="wrap")
133
136
  def serialize_model(self, handler):
134
137
  optional_fields = [
@@ -148,6 +151,7 @@ class MerchantAccount(BaseModel):
148
151
  "amex_network_tokens_app_id",
149
152
  "mastercard_network_tokens_requestor_id",
150
153
  "mastercard_network_tokens_app_id",
154
+ "async_network_tokens_enabled",
151
155
  ]
152
156
  nullable_fields = [
153
157
  "loon_client_key",
@@ -3,11 +3,9 @@
3
3
  from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_open_enum
7
6
  from pydantic import model_serializer
8
- from pydantic.functional_validators import PlainValidator
9
7
  from typing import List, Optional
10
- from typing_extensions import Annotated, NotRequired, TypedDict
8
+ from typing_extensions import NotRequired, TypedDict
11
9
 
12
10
 
13
11
  class MerchantAccountCreateTypedDict(TypedDict):
@@ -47,6 +45,8 @@ class MerchantAccountCreateTypedDict(TypedDict):
47
45
  r"""Requestor ID provided for Mastercard after onboarding to use Network Tokens."""
48
46
  mastercard_network_tokens_app_id: NotRequired[Nullable[str]]
49
47
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
48
+ async_network_tokens_enabled: NotRequired[bool]
49
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
50
50
 
51
51
 
52
52
  class MerchantAccountCreate(BaseModel):
@@ -83,9 +83,7 @@ class MerchantAccountCreate(BaseModel):
83
83
  loon_secret_key: OptionalNullable[str] = UNSET
84
84
  r"""Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
85
85
 
86
- loon_accepted_schemes: OptionalNullable[
87
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
88
- ] = UNSET
86
+ loon_accepted_schemes: OptionalNullable[List[CardScheme]] = UNSET
89
87
  r"""Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
90
88
 
91
89
  visa_network_tokens_requestor_id: OptionalNullable[str] = UNSET
@@ -106,6 +104,9 @@ class MerchantAccountCreate(BaseModel):
106
104
  mastercard_network_tokens_app_id: OptionalNullable[str] = UNSET
107
105
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
108
106
 
107
+ async_network_tokens_enabled: Optional[bool] = False
108
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
109
+
109
110
  @model_serializer(mode="wrap")
110
111
  def serialize_model(self, handler):
111
112
  optional_fields = [
@@ -125,6 +126,7 @@ class MerchantAccountCreate(BaseModel):
125
126
  "amex_network_tokens_app_id",
126
127
  "mastercard_network_tokens_requestor_id",
127
128
  "mastercard_network_tokens_app_id",
129
+ "async_network_tokens_enabled",
128
130
  ]
129
131
  nullable_fields = [
130
132
  "account_updater_request_encryption_key",
@@ -3,11 +3,9 @@
3
3
  from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_open_enum
7
6
  from pydantic import model_serializer
8
- from pydantic.functional_validators import PlainValidator
9
7
  from typing import List, Optional
10
- from typing_extensions import Annotated, NotRequired, TypedDict
8
+ from typing_extensions import NotRequired, TypedDict
11
9
 
12
10
 
13
11
  class MerchantAccountUpdateTypedDict(TypedDict):
@@ -43,6 +41,8 @@ class MerchantAccountUpdateTypedDict(TypedDict):
43
41
  r"""Requestor ID provided for Mastercard after onboarding to use Network Tokens."""
44
42
  mastercard_network_tokens_app_id: NotRequired[Nullable[str]]
45
43
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
44
+ async_network_tokens_enabled: NotRequired[bool]
45
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
46
46
  display_name: NotRequired[Nullable[str]]
47
47
  r"""The display name for the merchant account."""
48
48
 
@@ -75,9 +75,7 @@ class MerchantAccountUpdate(BaseModel):
75
75
  loon_secret_key: OptionalNullable[str] = UNSET
76
76
  r"""Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
77
77
 
78
- loon_accepted_schemes: OptionalNullable[
79
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
80
- ] = UNSET
78
+ loon_accepted_schemes: OptionalNullable[List[CardScheme]] = UNSET
81
79
  r"""Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well."""
82
80
 
83
81
  visa_network_tokens_requestor_id: OptionalNullable[str] = UNSET
@@ -98,6 +96,9 @@ class MerchantAccountUpdate(BaseModel):
98
96
  mastercard_network_tokens_app_id: OptionalNullable[str] = UNSET
99
97
  r"""Application ID provided for Mastercard after onboarding to use Network Tokens."""
100
98
 
99
+ async_network_tokens_enabled: Optional[bool] = False
100
+ r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing."""
101
+
101
102
  display_name: OptionalNullable[str] = UNSET
102
103
  r"""The display name for the merchant account."""
103
104
 
@@ -120,6 +121,7 @@ class MerchantAccountUpdate(BaseModel):
120
121
  "amex_network_tokens_app_id",
121
122
  "mastercard_network_tokens_requestor_id",
122
123
  "mastercard_network_tokens_app_id",
124
+ "async_network_tokens_enabled",
123
125
  "display_name",
124
126
  ]
125
127
  nullable_fields = [
@@ -8,31 +8,31 @@ from typing_extensions import TypedDict
8
8
  class MerchantProfileSchemeTypedDict(TypedDict):
9
9
  merchant_acquirer_bin: str
10
10
  r"""Acquirer BIN to use when calling 3DS through this scheme."""
11
- merchant_url: str
12
- r"""URL to send when calling 3DS through this scheme."""
13
11
  merchant_acquirer_id: str
14
12
  r"""Merchant ID to use when calling 3DS through this scheme."""
15
13
  merchant_name: str
16
14
  merchant_country_code: str
17
- r"""Merchant country code to use when calling 3DS through this scheme."""
15
+ r"""The merchant's ISO 3166-1 numeric country code."""
18
16
  merchant_category_code: str
19
17
  r"""Merchant category code to use when calling 3DS through this scheme."""
18
+ merchant_url: str
19
+ r"""URL to send when calling 3DS through this scheme."""
20
20
 
21
21
 
22
22
  class MerchantProfileScheme(BaseModel):
23
23
  merchant_acquirer_bin: str
24
24
  r"""Acquirer BIN to use when calling 3DS through this scheme."""
25
25
 
26
- merchant_url: str
27
- r"""URL to send when calling 3DS through this scheme."""
28
-
29
26
  merchant_acquirer_id: str
30
27
  r"""Merchant ID to use when calling 3DS through this scheme."""
31
28
 
32
29
  merchant_name: str
33
30
 
34
31
  merchant_country_code: str
35
- r"""Merchant country code to use when calling 3DS through this scheme."""
32
+ r"""The merchant's ISO 3166-1 numeric country code."""
36
33
 
37
34
  merchant_category_code: str
38
35
  r"""Merchant category code to use when calling 3DS through this scheme."""
36
+
37
+ merchant_url: str
38
+ r"""URL to send when calling 3DS through this scheme."""
@@ -9,15 +9,15 @@ from typing_extensions import TypedDict
9
9
  class MerchantProfileSchemeSummaryTypedDict(TypedDict):
10
10
  merchant_acquirer_bin: str
11
11
  r"""Acquirer BIN to use when calling 3DS through this scheme."""
12
- merchant_url: str
13
- r"""URL to send when calling 3DS through this scheme."""
14
12
  merchant_acquirer_id: str
15
13
  r"""Merchant ID to use when calling 3DS through this scheme."""
16
14
  merchant_name: str
17
15
  merchant_country_code: str
18
- r"""Merchant country code to use when calling 3DS through this scheme."""
16
+ r"""The merchant's ISO 3166-1 numeric country code."""
19
17
  merchant_category_code: str
20
18
  r"""Merchant category code to use when calling 3DS through this scheme."""
19
+ merchant_url: str
20
+ r"""URL to send when calling 3DS through this scheme."""
21
21
  created_at: datetime
22
22
  r"""The date and time when this profile was first created in our system."""
23
23
 
@@ -26,19 +26,19 @@ class MerchantProfileSchemeSummary(BaseModel):
26
26
  merchant_acquirer_bin: str
27
27
  r"""Acquirer BIN to use when calling 3DS through this scheme."""
28
28
 
29
- merchant_url: str
30
- r"""URL to send when calling 3DS through this scheme."""
31
-
32
29
  merchant_acquirer_id: str
33
30
  r"""Merchant ID to use when calling 3DS through this scheme."""
34
31
 
35
32
  merchant_name: str
36
33
 
37
34
  merchant_country_code: str
38
- r"""Merchant country code to use when calling 3DS through this scheme."""
35
+ r"""The merchant's ISO 3166-1 numeric country code."""
39
36
 
40
37
  merchant_category_code: str
41
38
  r"""Merchant category code to use when calling 3DS through this scheme."""
42
39
 
40
+ merchant_url: str
41
+ r"""URL to send when calling 3DS through this scheme."""
42
+
43
43
  created_at: datetime
44
44
  r"""The date and time when this profile was first created in our system."""
gr4vy/models/method.py CHANGED
@@ -16,6 +16,7 @@ Method = Union[
16
16
  "arcuspaynetwork",
17
17
  "bacs",
18
18
  "bancontact",
19
+ "bank",
19
20
  "banked",
20
21
  "bcp",
21
22
  "becs",
@@ -71,6 +72,7 @@ Method = Union[
71
72
  "oney_6x",
72
73
  "ovo",
73
74
  "oxxo",
75
+ "p24",
74
76
  "pagoefectivo",
75
77
  "payid",
76
78
  "paymaya",
@@ -80,6 +82,7 @@ Method = Union[
80
82
  "payvalida",
81
83
  "picpay",
82
84
  "pix",
85
+ "plaid",
83
86
  "pse",
84
87
  "rabbitlinepay",
85
88
  "razorpay",
@@ -109,6 +112,7 @@ Method = Union[
109
112
  "waave",
110
113
  "webpay",
111
114
  "wechat",
115
+ "wero",
112
116
  "yape",
113
117
  "zippay",
114
118
  ],
@@ -15,16 +15,21 @@ class MockCardOptionsTypedDict(TypedDict):
15
15
  Nullable[MockCardMerchantAdviceCodeOptionsTypedDict]
16
16
  ]
17
17
  r"""Allows for mocking the merchant advice code."""
18
+ skip_retry: NotRequired[Nullable[bool]]
19
+ r"""When set to true, prevents retries on failed transactions."""
18
20
 
19
21
 
20
22
  class MockCardOptions(BaseModel):
21
23
  merchant_advice_code: OptionalNullable[MockCardMerchantAdviceCodeOptions] = UNSET
22
24
  r"""Allows for mocking the merchant advice code."""
23
25
 
26
+ skip_retry: OptionalNullable[bool] = UNSET
27
+ r"""When set to true, prevents retries on failed transactions."""
28
+
24
29
  @model_serializer(mode="wrap")
25
30
  def serialize_model(self, handler):
26
- optional_fields = ["merchant_advice_code"]
27
- nullable_fields = ["merchant_advice_code"]
31
+ optional_fields = ["merchant_advice_code", "skip_retry"]
32
+ nullable_fields = ["merchant_advice_code", "skip_retry"]
28
33
  null_default_fields = []
29
34
 
30
35
  serialized = handler(self)
gr4vy/models/mode.py CHANGED
@@ -14,6 +14,7 @@ Mode = Union[
14
14
  "checkout-session",
15
15
  "click-to-pay",
16
16
  "gift-card",
17
+ "bank",
17
18
  ],
18
19
  UnrecognizedStr,
19
20
  ]
@@ -0,0 +1,15 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class MonatoSpeiOptionsTypedDict(TypedDict):
9
+ approval_url: str
10
+ r"""Approval URL that will receive a charge payment method reference."""
11
+
12
+
13
+ class MonatoSpeiOptions(BaseModel):
14
+ approval_url: str
15
+ r"""Approval URL that will receive a charge payment method reference."""
@@ -4,9 +4,9 @@ from __future__ import annotations
4
4
  from .networktokenstatus import NetworkTokenStatus
5
5
  from datetime import datetime
6
6
  from gr4vy.types import BaseModel
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
- from pydantic.functional_validators import AfterValidator, PlainValidator
9
+ from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional
11
11
  from typing_extensions import Annotated, TypedDict
12
12
 
@@ -39,7 +39,7 @@ class NetworkToken(BaseModel):
39
39
  payment_method_id: str
40
40
  r"""The ID of the payment method used to generate this token"""
41
41
 
42
- status: Annotated[NetworkTokenStatus, PlainValidator(validate_open_enum(False))]
42
+ status: NetworkTokenStatus
43
43
 
44
44
  token: str
45
45
  r"""The token value. Will be present if succeeded."""
@@ -10,15 +10,21 @@ from gr4vy.types import (
10
10
  UNSET_SENTINEL,
11
11
  UnrecognizedStr,
12
12
  )
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Literal, Union
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
20
20
 
21
- CardSource = Union[Literal["apple-pay", "google-pay"], UnrecognizedStr]
21
+ CardSource = Union[
22
+ Literal[
23
+ "apple-pay",
24
+ "google-pay",
25
+ ],
26
+ UnrecognizedStr,
27
+ ]
22
28
 
23
29
 
24
30
  class NetworkTokenPaymentMethodCreateTypedDict(TypedDict):
@@ -65,14 +71,10 @@ class NetworkTokenPaymentMethodCreate(BaseModel):
65
71
  redirect_url: OptionalNullable[str] = UNSET
66
72
  r"""The URL to redirect a user back to after the complete 3DS in browser."""
67
73
 
68
- card_source: Annotated[
69
- OptionalNullable[CardSource], PlainValidator(validate_open_enum(False))
70
- ] = UNSET
74
+ card_source: OptionalNullable[CardSource] = UNSET
71
75
  r"""The optional source of the decrypted device token."""
72
76
 
73
- card_scheme: Annotated[
74
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
75
- ] = UNSET
77
+ card_scheme: OptionalNullable[CardScheme] = UNSET
76
78
  r"""The original card scheme for which the token was generated."""
77
79
 
78
80
  card_suffix: OptionalNullable[str] = UNSET
@@ -6,5 +6,11 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  NetworkTokenStatus = Union[
9
- Literal["active", "inactive", "suspended", "deleted"], UnrecognizedStr
9
+ Literal[
10
+ "active",
11
+ "inactive",
12
+ "suspended",
13
+ "deleted",
14
+ ],
15
+ UnrecognizedStr,
10
16
  ]
@@ -0,0 +1,49 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ import pydantic
6
+ from pydantic import model_serializer
7
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
+
9
+
10
+ class NuveiIDealOptionsTypedDict(TypedDict):
11
+ custom_data: NotRequired[Nullable[str]]
12
+ r"""Additional data to be sent to Nuvei."""
13
+
14
+
15
+ class NuveiIDealOptions(BaseModel):
16
+ custom_data: Annotated[
17
+ OptionalNullable[str], pydantic.Field(alias="customData")
18
+ ] = UNSET
19
+ r"""Additional data to be sent to Nuvei."""
20
+
21
+ @model_serializer(mode="wrap")
22
+ def serialize_model(self, handler):
23
+ optional_fields = ["customData"]
24
+ nullable_fields = ["customData"]
25
+ null_default_fields = []
26
+
27
+ serialized = handler(self)
28
+
29
+ m = {}
30
+
31
+ for n, f in type(self).model_fields.items():
32
+ k = f.alias or n
33
+ val = serialized.get(k)
34
+ serialized.pop(k, None)
35
+
36
+ optional_nullable = k in optional_fields and k in nullable_fields
37
+ is_set = (
38
+ self.__pydantic_fields_set__.intersection({n})
39
+ or k in null_default_fields
40
+ ) # pylint: disable=no-member
41
+
42
+ if val is not None and val != UNSET_SENTINEL:
43
+ m[k] = val
44
+ elif val != UNSET_SENTINEL and (
45
+ not k in optional_fields or (optional_nullable and is_set)
46
+ ):
47
+ m[k] = val
48
+
49
+ return m