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.

Potentially problematic release.


This version of gr4vy might be problematic. Click here for more details.

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,70 @@
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 NuveiPSEOptionsTypedDict(TypedDict):
11
+ user_type: NotRequired[Nullable[str]]
12
+ r"""Customer type (\"N\" for persona natural, \"J\" for persona jurídica)"""
13
+ user_fis_number: NotRequired[Nullable[str]]
14
+ r"""Customer’s document type"""
15
+ fiscal_number: NotRequired[Nullable[str]]
16
+ r"""Customer’s document number"""
17
+ bank_code: NotRequired[Nullable[str]]
18
+ r"""The bank code of the selected bank"""
19
+
20
+
21
+ class NuveiPSEOptions(BaseModel):
22
+ user_type: Annotated[OptionalNullable[str], pydantic.Field(alias="userType")] = (
23
+ UNSET
24
+ )
25
+ r"""Customer type (\"N\" for persona natural, \"J\" for persona jurídica)"""
26
+
27
+ user_fis_number: Annotated[
28
+ OptionalNullable[str], pydantic.Field(alias="userFisNumber")
29
+ ] = UNSET
30
+ r"""Customer’s document type"""
31
+
32
+ fiscal_number: Annotated[
33
+ OptionalNullable[str], pydantic.Field(alias="fiscalNumber")
34
+ ] = UNSET
35
+ r"""Customer’s document number"""
36
+
37
+ bank_code: Annotated[OptionalNullable[str], pydantic.Field(alias="bankCode")] = (
38
+ UNSET
39
+ )
40
+ r"""The bank code of the selected bank"""
41
+
42
+ @model_serializer(mode="wrap")
43
+ def serialize_model(self, handler):
44
+ optional_fields = ["userType", "userFisNumber", "fiscalNumber", "bankCode"]
45
+ nullable_fields = ["userType", "userFisNumber", "fiscalNumber", "bankCode"]
46
+ null_default_fields = []
47
+
48
+ serialized = handler(self)
49
+
50
+ m = {}
51
+
52
+ for n, f in type(self).model_fields.items():
53
+ k = f.alias or n
54
+ val = serialized.get(k)
55
+ serialized.pop(k, None)
56
+
57
+ optional_nullable = k in optional_fields and k in nullable_fields
58
+ is_set = (
59
+ self.__pydantic_fields_set__.intersection({n})
60
+ or k in null_default_fields
61
+ ) # pylint: disable=no-member
62
+
63
+ if val is not None and val != UNSET_SENTINEL:
64
+ m[k] = val
65
+ elif val != UNSET_SENTINEL and (
66
+ not k in optional_fields or (optional_nullable and is_set)
67
+ ):
68
+ m[k] = val
69
+
70
+ return m
@@ -10,10 +10,10 @@ from .transactionintent import TransactionIntent
10
10
  from .transactionpaymentsource import TransactionPaymentSource
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
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 Any, Dict, List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -71,6 +71,12 @@ class PaymentLinkTypedDict(TypedDict):
71
71
  r"""The buyer associated with the payment link."""
72
72
  shipping_details: NotRequired[Nullable[ShippingDetailsTypedDict]]
73
73
  r"""The shipping details for the payment link."""
74
+ connection_options: NotRequired[Nullable[Dict[str, Dict[str, Any]]]]
75
+ r"""The connection options for the payment link."""
76
+ store: NotRequired[bool]
77
+ r"""Whether the payment method was stored."""
78
+ buyer_id: NotRequired[Nullable[str]]
79
+ r"""The ID of the buyer to associate with the stored payment method."""
74
80
 
75
81
 
76
82
  class PaymentLink(BaseModel):
@@ -89,14 +95,12 @@ class PaymentLink(BaseModel):
89
95
  currency: str
90
96
  r"""The currency code for the payment link."""
91
97
 
92
- intent: Annotated[TransactionIntent, PlainValidator(validate_open_enum(False))]
98
+ intent: TransactionIntent
93
99
 
94
100
  cart_items: Nullable[List[CartItem]]
95
101
  r"""The cart items for the payment link."""
96
102
 
97
- payment_source: Annotated[
98
- TransactionPaymentSource, PlainValidator(validate_open_enum(False))
99
- ]
103
+ payment_source: TransactionPaymentSource
100
104
  r"""The way payment method information made it to this transaction."""
101
105
 
102
106
  created_at: datetime
@@ -105,7 +109,7 @@ class PaymentLink(BaseModel):
105
109
  updated_at: datetime
106
110
  r"""The date and time the payment link was last updated."""
107
111
 
108
- status: Annotated[PaymentLinkStatus, PlainValidator(validate_open_enum(False))]
112
+ status: PaymentLinkStatus
109
113
 
110
114
  TYPE: Annotated[
111
115
  Annotated[
@@ -161,6 +165,15 @@ class PaymentLink(BaseModel):
161
165
  shipping_details: OptionalNullable[ShippingDetails] = UNSET
162
166
  r"""The shipping details for the payment link."""
163
167
 
168
+ connection_options: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET
169
+ r"""The connection options for the payment link."""
170
+
171
+ store: Optional[bool] = False
172
+ r"""Whether the payment method was stored."""
173
+
174
+ buyer_id: OptionalNullable[str] = UNSET
175
+ r"""The ID of the buyer to associate with the stored payment method."""
176
+
164
177
  @model_serializer(mode="wrap")
165
178
  def serialize_model(self, handler):
166
179
  optional_fields = [
@@ -180,6 +193,9 @@ class PaymentLink(BaseModel):
180
193
  "metadata",
181
194
  "buyer",
182
195
  "shipping_details",
196
+ "connection_options",
197
+ "store",
198
+ "buyer_id",
183
199
  ]
184
200
  nullable_fields = [
185
201
  "expires_at",
@@ -198,6 +214,8 @@ class PaymentLink(BaseModel):
198
214
  "metadata",
199
215
  "buyer",
200
216
  "shipping_details",
217
+ "connection_options",
218
+ "buyer_id",
201
219
  ]
202
220
  null_default_fields = []
203
221
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .cartitem import CartItem, CartItemTypedDict
5
- from .guestbuyer_input import GuestBuyerInput, GuestBuyerInputTypedDict
5
+ from .guestbuyer import GuestBuyer, GuestBuyerTypedDict
6
6
  from .statementdescriptor import StatementDescriptor, StatementDescriptorTypedDict
7
7
  from .transactionconnectionoptions import (
8
8
  TransactionConnectionOptions,
@@ -11,22 +11,10 @@ from .transactionconnectionoptions import (
11
11
  from .transactionintent import TransactionIntent
12
12
  from .transactionpaymentsource import TransactionPaymentSource
13
13
  from datetime import datetime
14
- from gr4vy.types import (
15
- BaseModel,
16
- Nullable,
17
- OptionalNullable,
18
- UNSET,
19
- UNSET_SENTINEL,
20
- UnrecognizedStr,
21
- )
22
- from gr4vy.utils import validate_open_enum
14
+ from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
23
15
  from pydantic import model_serializer
24
- from pydantic.functional_validators import PlainValidator
25
- from typing import Any, Dict, List, Literal, Optional, Union
26
- from typing_extensions import Annotated, NotRequired, TypedDict
27
-
28
-
29
- Locale = Union[Literal["en", "en-GB", "pt", "pt-BR", "es"], UnrecognizedStr]
16
+ from typing import Any, Dict, List, Optional
17
+ from typing_extensions import NotRequired, TypedDict
30
18
 
31
19
 
32
20
  class PaymentLinkCreateTypedDict(TypedDict):
@@ -36,7 +24,7 @@ class PaymentLinkCreateTypedDict(TypedDict):
36
24
  r"""The country code for the payment link."""
37
25
  currency: str
38
26
  r"""The currency code for the payment link."""
39
- buyer: NotRequired[Nullable[GuestBuyerInputTypedDict]]
27
+ buyer: NotRequired[Nullable[GuestBuyerTypedDict]]
40
28
  r"""The guest buyer for the payment link."""
41
29
  expires_at: NotRequired[Nullable[datetime]]
42
30
  r"""The expiration date and time for the payment link."""
@@ -46,7 +34,7 @@ class PaymentLinkCreateTypedDict(TypedDict):
46
34
  r"""The merchant reference for the payment link."""
47
35
  statement_descriptor: NotRequired[Nullable[StatementDescriptorTypedDict]]
48
36
  r"""The statement descriptor for the payment link."""
49
- locale: NotRequired[Nullable[Locale]]
37
+ locale: NotRequired[Nullable[str]]
50
38
  r"""The locale for the payment link."""
51
39
  merchant_name: NotRequired[Nullable[str]]
52
40
  r"""The merchant's display name."""
@@ -71,6 +59,10 @@ class PaymentLinkCreateTypedDict(TypedDict):
71
59
  r"""Arbitrary metadata for the payment link."""
72
60
  payment_source: NotRequired[TransactionPaymentSource]
73
61
  r"""The way payment method information made it to this transaction."""
62
+ store: NotRequired[bool]
63
+ r"""Whether to store the payment method for future use."""
64
+ buyer_id: NotRequired[Nullable[str]]
65
+ r"""The ID of the buyer to associate the payment method with. Note: When `buyer_id` is provided, the payment link should be treated as a secret as it will allow the user to manage payment methods for the associated buyer."""
74
66
 
75
67
 
76
68
  class PaymentLinkCreate(BaseModel):
@@ -83,7 +75,7 @@ class PaymentLinkCreate(BaseModel):
83
75
  currency: str
84
76
  r"""The currency code for the payment link."""
85
77
 
86
- buyer: OptionalNullable[GuestBuyerInput] = UNSET
78
+ buyer: OptionalNullable[GuestBuyer] = UNSET
87
79
  r"""The guest buyer for the payment link."""
88
80
 
89
81
  expires_at: OptionalNullable[datetime] = UNSET
@@ -98,9 +90,7 @@ class PaymentLinkCreate(BaseModel):
98
90
  statement_descriptor: OptionalNullable[StatementDescriptor] = UNSET
99
91
  r"""The statement descriptor for the payment link."""
100
92
 
101
- locale: Annotated[
102
- OptionalNullable[Locale], PlainValidator(validate_open_enum(False))
103
- ] = UNSET
93
+ locale: OptionalNullable[str] = UNSET
104
94
  r"""The locale for the payment link."""
105
95
 
106
96
  merchant_name: OptionalNullable[str] = UNSET
@@ -124,9 +114,7 @@ class PaymentLinkCreate(BaseModel):
124
114
  merchant_favicon_url: OptionalNullable[str] = UNSET
125
115
  r"""URL to the merchant's favicon."""
126
116
 
127
- intent: Annotated[
128
- Optional[TransactionIntent], PlainValidator(validate_open_enum(False))
129
- ] = None
117
+ intent: Optional[TransactionIntent] = None
130
118
 
131
119
  return_url: OptionalNullable[str] = UNSET
132
120
  r"""The return URL after payment completion."""
@@ -137,11 +125,15 @@ class PaymentLinkCreate(BaseModel):
137
125
  metadata: OptionalNullable[Dict[str, Any]] = UNSET
138
126
  r"""Arbitrary metadata for the payment link."""
139
127
 
140
- payment_source: Annotated[
141
- Optional[TransactionPaymentSource], PlainValidator(validate_open_enum(False))
142
- ] = None
128
+ payment_source: Optional[TransactionPaymentSource] = None
143
129
  r"""The way payment method information made it to this transaction."""
144
130
 
131
+ store: Optional[bool] = False
132
+ r"""Whether to store the payment method for future use."""
133
+
134
+ buyer_id: OptionalNullable[str] = UNSET
135
+ r"""The ID of the buyer to associate the payment method with. Note: When `buyer_id` is provided, the payment link should be treated as a secret as it will allow the user to manage payment methods for the associated buyer."""
136
+
145
137
  @model_serializer(mode="wrap")
146
138
  def serialize_model(self, handler):
147
139
  optional_fields = [
@@ -163,6 +155,8 @@ class PaymentLinkCreate(BaseModel):
163
155
  "cart_items",
164
156
  "metadata",
165
157
  "payment_source",
158
+ "store",
159
+ "buyer_id",
166
160
  ]
167
161
  nullable_fields = [
168
162
  "buyer",
@@ -181,6 +175,7 @@ class PaymentLinkCreate(BaseModel):
181
175
  "return_url",
182
176
  "cart_items",
183
177
  "metadata",
178
+ "buyer_id",
184
179
  ]
185
180
  null_default_fields = []
186
181
 
@@ -6,5 +6,11 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  PaymentLinkStatus = Union[
9
- Literal["active", "completed", "expired", "processing"], UnrecognizedStr
9
+ Literal[
10
+ "active",
11
+ "completed",
12
+ "expired",
13
+ "processing",
14
+ ],
15
+ UnrecognizedStr,
10
16
  ]
@@ -12,10 +12,10 @@ from .paymentmethoddetailscard import (
12
12
  from .paymentmethodstatus import PaymentMethodStatus
13
13
  from datetime import datetime
14
14
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from gr4vy.utils import validate_const, validate_open_enum
15
+ from gr4vy.utils import validate_const
16
16
  import pydantic
17
17
  from pydantic import model_serializer
18
- from pydantic.functional_validators import AfterValidator, PlainValidator
18
+ from pydantic.functional_validators import AfterValidator
19
19
  from typing import List, Literal, Optional
20
20
  from typing_extensions import Annotated, NotRequired, TypedDict
21
21
 
@@ -82,7 +82,7 @@ class PaymentMethod(BaseModel):
82
82
  A stored payment method.
83
83
  """
84
84
 
85
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
85
+ method: Method
86
86
 
87
87
  id: str
88
88
  r"""The ID for the payment method."""
@@ -99,7 +99,7 @@ class PaymentMethod(BaseModel):
99
99
  usage_count: int
100
100
  r"""The number of times this payment method has been used in transactions."""
101
101
 
102
- status: Annotated[PaymentMethodStatus, PlainValidator(validate_open_enum(False))]
102
+ status: PaymentMethodStatus
103
103
 
104
104
  created_at: datetime
105
105
  r"""The date and time when this payment method was first created in our system."""
@@ -140,19 +140,13 @@ class PaymentMethod(BaseModel):
140
140
  last_replaced_at: OptionalNullable[datetime] = UNSET
141
141
  r"""The date and time when this card was last replaced by the account updater."""
142
142
 
143
- mode: Annotated[
144
- OptionalNullable[Mode], PlainValidator(validate_open_enum(False))
145
- ] = UNSET
143
+ mode: OptionalNullable[Mode] = UNSET
146
144
  r"""The mode to use with this payment method."""
147
145
 
148
- scheme: Annotated[
149
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
150
- ] = UNSET
146
+ scheme: OptionalNullable[CardScheme] = UNSET
151
147
  r"""The scheme of the card. Only applies to card payments."""
152
148
 
153
- additional_schemes: OptionalNullable[
154
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
155
- ] = UNSET
149
+ additional_schemes: OptionalNullable[List[CardScheme]] = UNSET
156
150
  r"""Additional schemes of the card besides the primary scheme. Only applies to card payment methods."""
157
151
 
158
152
  cit_last_used_at: OptionalNullable[datetime] = UNSET
@@ -3,10 +3,10 @@
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_const, validate_open_enum
6
+ from gr4vy.utils import validate_const
7
7
  import pydantic
8
8
  from pydantic import model_serializer
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, NotRequired, TypedDict
12
12
 
@@ -37,9 +37,7 @@ class PaymentMethodCard(BaseModel):
37
37
  ] = "card"
38
38
  r"""Set to `card` to use a new card."""
39
39
 
40
- card_scheme: Annotated[
41
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
42
- ] = UNSET
40
+ card_scheme: OptionalNullable[CardScheme] = UNSET
43
41
  r"""The optional card's network scheme."""
44
42
 
45
43
  external_identifier: OptionalNullable[str] = UNSET
@@ -3,10 +3,8 @@
3
3
  from __future__ import annotations
4
4
  from .cardtype import CardType
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
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import NotRequired, TypedDict
10
8
 
11
9
 
12
10
  class PaymentMethodDetailsCardTypedDict(TypedDict):
@@ -18,9 +16,7 @@ class PaymentMethodDetailsCardTypedDict(TypedDict):
18
16
  class PaymentMethodDetailsCard(BaseModel):
19
17
  bin: OptionalNullable[str] = UNSET
20
18
 
21
- card_type: Annotated[
22
- OptionalNullable[CardType], PlainValidator(validate_open_enum(False))
23
- ] = UNSET
19
+ card_type: OptionalNullable[CardType] = UNSET
24
20
 
25
21
  card_issuer_name: OptionalNullable[str] = UNSET
26
22
 
@@ -6,6 +6,12 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  PaymentMethodStatus = Union[
9
- Literal["processing", "buyer_approval_required", "succeeded", "failed", "paused"],
9
+ Literal[
10
+ "processing",
11
+ "buyer_approval_required",
12
+ "succeeded",
13
+ "failed",
14
+ "paused",
15
+ ],
10
16
  UnrecognizedStr,
11
17
  ]
@@ -10,10 +10,10 @@ from .paymentmethoddetailscard import (
10
10
  )
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
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 List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -71,7 +71,7 @@ class PaymentMethodSummary(BaseModel):
71
71
  A summary of a payment method.
72
72
  """
73
73
 
74
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
74
+ method: Method
75
75
 
76
76
  id: str
77
77
  r"""The ID for the payment method."""
@@ -121,19 +121,13 @@ class PaymentMethodSummary(BaseModel):
121
121
  last_replaced_at: OptionalNullable[datetime] = UNSET
122
122
  r"""The date and time when this card was last replaced by the account updater."""
123
123
 
124
- mode: Annotated[
125
- OptionalNullable[Mode], PlainValidator(validate_open_enum(False))
126
- ] = UNSET
124
+ mode: OptionalNullable[Mode] = UNSET
127
125
  r"""The mode to use with this payment method."""
128
126
 
129
- scheme: Annotated[
130
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
131
- ] = UNSET
127
+ scheme: OptionalNullable[CardScheme] = UNSET
132
128
  r"""The scheme of the card. Only applies to card payments."""
133
129
 
134
- additional_schemes: OptionalNullable[
135
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
136
- ] = UNSET
130
+ additional_schemes: OptionalNullable[List[CardScheme]] = UNSET
137
131
  r"""Additional schemes of the card besides the primary scheme. Only applies to card payment methods."""
138
132
 
139
133
  cit_last_used_at: OptionalNullable[datetime] = UNSET
@@ -12,10 +12,10 @@ from .walletpaymentoptioncontext import (
12
12
  WalletPaymentOptionContextTypedDict,
13
13
  )
14
14
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from gr4vy.utils import validate_const, validate_open_enum
15
+ from gr4vy.utils import validate_const
16
16
  import pydantic
17
17
  from pydantic import model_serializer
18
- from pydantic.functional_validators import AfterValidator, PlainValidator
18
+ from pydantic.functional_validators import AfterValidator
19
19
  from typing import Literal, Optional, Union
20
20
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
21
21
 
@@ -52,7 +52,7 @@ class PaymentOptionTypedDict(TypedDict):
52
52
  class PaymentOption(BaseModel):
53
53
  method: str
54
54
 
55
- mode: Annotated[Mode, PlainValidator(validate_open_enum(False))]
55
+ mode: Mode
56
56
 
57
57
  can_store_payment_method: bool
58
58
 
@@ -10,10 +10,10 @@ from .method import Method
10
10
  from .paymentservicestatus import PaymentServiceStatus
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
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 Dict, List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -73,7 +73,7 @@ class PaymentService(BaseModel):
73
73
  payment_service_definition_id: str
74
74
  r"""The definition ID of the service that has been configured."""
75
75
 
76
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
76
+ method: Method
77
77
 
78
78
  display_name: str
79
79
  r"""The display name for the payment service."""
@@ -119,9 +119,7 @@ class PaymentService(BaseModel):
119
119
  active: Optional[bool] = True
120
120
  r"""Defines if this payment service is currently active."""
121
121
 
122
- status: Annotated[
123
- Optional[PaymentServiceStatus], PlainValidator(validate_open_enum(False))
124
- ] = None
122
+ status: Optional[PaymentServiceStatus] = None
125
123
 
126
124
  three_d_secure_enabled: OptionalNullable[bool] = UNSET
127
125
  r"""Defines if this payment service has 3DS enabled."""
@@ -3,9 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .approvaltarget import ApprovalTarget
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_open_enum
7
- from pydantic.functional_validators import PlainValidator
8
- from typing_extensions import Annotated, TypedDict
6
+ from typing_extensions import TypedDict
9
7
 
10
8
 
11
9
  class PaymentServiceConfigurationTypedDict(TypedDict):
@@ -23,9 +21,7 @@ class PaymentServiceConfigurationTypedDict(TypedDict):
23
21
 
24
22
 
25
23
  class PaymentServiceConfiguration(BaseModel):
26
- approval_ui_target: Annotated[
27
- ApprovalTarget, PlainValidator(validate_open_enum(False))
28
- ]
24
+ approval_ui_target: ApprovalTarget
29
25
 
30
26
  approval_ui_height: str
31
27
  r"""Height of the approval interface in either pixels or view height (vh)."""
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .definitionfield import DefinitionField, DefinitionFieldTypedDict
5
+ from .integrationclient import IntegrationClient
5
6
  from .method import Method
6
7
  from .mode import Mode
7
8
  from .paymentserviceconfiguration import (
@@ -13,10 +14,10 @@ from .requiredcheckoutfields import (
13
14
  RequiredCheckoutFieldsTypedDict,
14
15
  )
15
16
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
16
- from gr4vy.utils import validate_const, validate_open_enum
17
+ from gr4vy.utils import validate_const
17
18
  import pydantic
18
19
  from pydantic import model_serializer
19
- from pydantic.functional_validators import AfterValidator, PlainValidator
20
+ from pydantic.functional_validators import AfterValidator
20
21
  from typing import Dict, List, Literal, Optional
21
22
  from typing_extensions import Annotated, NotRequired, TypedDict
22
23
 
@@ -41,6 +42,8 @@ class PaymentServiceDefinitionTypedDict(TypedDict):
41
42
  required_checkout_fields: List[RequiredCheckoutFieldsTypedDict]
42
43
  r"""A list of condition that define when some fields must be provided with a transaction request."""
43
44
  configuration: PaymentServiceConfigurationTypedDict
45
+ supported_integration_clients: Nullable[List[IntegrationClient]]
46
+ r"""List of supported integration clients. Defaults to redirect for most redirect connectors."""
44
47
  type: Literal["payment-service-definition"]
45
48
  r"""Always `payment-service-definition`."""
46
49
  icon_url: NotRequired[Nullable[str]]
@@ -54,7 +57,7 @@ class PaymentServiceDefinition(BaseModel):
54
57
  display_name: str
55
58
  r"""A human friendly name for this service."""
56
59
 
57
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
60
+ method: Method
58
61
 
59
62
  fields: List[DefinitionField]
60
63
  r"""A list of credentials and related fields which can be configured for this service."""
@@ -68,7 +71,7 @@ class PaymentServiceDefinition(BaseModel):
68
71
  supported_countries: List[str]
69
72
  r"""A list of two-letter ISO country codes that this service supports."""
70
73
 
71
- mode: Annotated[Mode, PlainValidator(validate_open_enum(False))]
74
+ mode: Mode
72
75
 
73
76
  supported_features: Dict[str, bool]
74
77
  r"""Features supported by the payment service."""
@@ -78,6 +81,9 @@ class PaymentServiceDefinition(BaseModel):
78
81
 
79
82
  configuration: PaymentServiceConfiguration
80
83
 
84
+ supported_integration_clients: Nullable[List[IntegrationClient]]
85
+ r"""List of supported integration clients. Defaults to redirect for most redirect connectors."""
86
+
81
87
  TYPE: Annotated[
82
88
  Annotated[
83
89
  Optional[Literal["payment-service-definition"]],
@@ -93,7 +99,7 @@ class PaymentServiceDefinition(BaseModel):
93
99
  @model_serializer(mode="wrap")
94
100
  def serialize_model(self, handler):
95
101
  optional_fields = ["type", "icon_url"]
96
- nullable_fields = ["icon_url"]
102
+ nullable_fields = ["icon_url", "supported_integration_clients"]
97
103
  null_default_fields = []
98
104
 
99
105
  serialized = handler(self)
@@ -5,4 +5,11 @@ from gr4vy.types import UnrecognizedStr
5
5
  from typing import Literal, Union
6
6
 
7
7
 
8
- PaymentServiceStatus = Union[Literal["pending", "created", "failed"], UnrecognizedStr]
8
+ PaymentServiceStatus = Union[
9
+ Literal[
10
+ "pending",
11
+ "created",
12
+ "failed",
13
+ ],
14
+ UnrecognizedStr,
15
+ ]
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .paymentmethodstatus import PaymentMethodStatus
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 Literal, Optional
12
12
  from typing_extensions import Annotated, NotRequired, TypedDict
13
13
 
@@ -42,7 +42,7 @@ class PaymentServiceToken(BaseModel):
42
42
  payment_service_id: str
43
43
  r"""The ID of the payment method used to generate this token."""
44
44
 
45
- status: Annotated[PaymentMethodStatus, PlainValidator(validate_open_enum(False))]
45
+ status: PaymentMethodStatus
46
46
 
47
47
  created_at: datetime
48
48
  r"""The date and time when this payment service token was first created in our system."""
@@ -5,4 +5,4 @@ from gr4vy.types import UnrecognizedStr
5
5
  from typing import Literal, Union
6
6
 
7
7
 
8
- PayoutCategory = Union[Literal["online_gambling"], UnrecognizedStr]
8
+ PayoutCategory = Union[Literal["online_gambling",], UnrecognizedStr]