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
gr4vy/transactions.py CHANGED
@@ -5,6 +5,7 @@ from .sdkconfiguration import SDKConfiguration
5
5
  from datetime import datetime
6
6
  from gr4vy import errors, models, utils
7
7
  from gr4vy._hooks import HookContext
8
+ from gr4vy.actions import Actions
8
9
  from gr4vy.events import Events
9
10
  from gr4vy.transactions_refunds import TransactionsRefunds
10
11
  from gr4vy.transactions_settlements import TransactionsSettlements
@@ -17,18 +18,26 @@ from typing import Any, Dict, List, Mapping, Optional, Union
17
18
 
18
19
  class Transactions(BaseSDK):
19
20
  refunds: TransactionsRefunds
21
+ actions: Actions
20
22
  events: Events
21
23
  settlements: TransactionsSettlements
22
24
 
23
- def __init__(self, sdk_config: SDKConfiguration) -> None:
24
- BaseSDK.__init__(self, sdk_config)
25
+ def __init__(
26
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
27
+ ) -> None:
28
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
25
29
  self.sdk_configuration = sdk_config
26
30
  self._init_sdks()
27
31
 
28
32
  def _init_sdks(self):
29
- self.refunds = TransactionsRefunds(self.sdk_configuration)
30
- self.events = Events(self.sdk_configuration)
31
- self.settlements = TransactionsSettlements(self.sdk_configuration)
33
+ self.refunds = TransactionsRefunds(
34
+ self.sdk_configuration, parent_ref=self.parent_ref
35
+ )
36
+ self.actions = Actions(self.sdk_configuration, parent_ref=self.parent_ref)
37
+ self.events = Events(self.sdk_configuration, parent_ref=self.parent_ref)
38
+ self.settlements = TransactionsSettlements(
39
+ self.sdk_configuration, parent_ref=self.parent_ref
40
+ )
32
41
 
33
42
  def list(
34
43
  self,
@@ -75,6 +84,7 @@ class Transactions(BaseSDK):
75
84
  is_subsequent_payment: OptionalNullable[bool] = UNSET,
76
85
  merchant_initiated: OptionalNullable[bool] = UNSET,
77
86
  used_3ds: OptionalNullable[bool] = UNSET,
87
+ disputed: OptionalNullable[bool] = UNSET,
78
88
  buyer_search: OptionalNullable[List[str]] = UNSET,
79
89
  merchant_account_id: Optional[str] = None,
80
90
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
@@ -128,6 +138,7 @@ class Transactions(BaseSDK):
128
138
  :param is_subsequent_payment: Filters for transactions where the `is_subsequent_payment` matches the provided value.
129
139
  :param merchant_initiated: Filters for transactions where the `merchant_initiated` matches the provided value.
130
140
  :param used_3ds: Filters for transactions that attempted 3DS authentication or not.
141
+ :param disputed: Filters for transactions that have been disputed.
131
142
  :param buyer_search: Filters the results to only get the items for which some of the buyer data contains exactly the provided `buyer_search` values.
132
143
  :param merchant_account_id: The ID of the merchant account to use for this request.
133
144
  :param retries: Override the default retry configuration for this method
@@ -188,6 +199,7 @@ class Transactions(BaseSDK):
188
199
  is_subsequent_payment=is_subsequent_payment,
189
200
  merchant_initiated=merchant_initiated,
190
201
  used_3ds=used_3ds,
202
+ disputed=disputed,
191
203
  buyer_search=buyer_search,
192
204
  merchant_account_id=merchant_account_id,
193
205
  )
@@ -208,6 +220,7 @@ class Transactions(BaseSDK):
208
220
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
209
221
  ),
210
222
  security=self.sdk_configuration.security,
223
+ allow_empty_value=None,
211
224
  timeout_ms=timeout_ms,
212
225
  )
213
226
 
@@ -228,7 +241,7 @@ class Transactions(BaseSDK):
228
241
  config=self.sdk_configuration,
229
242
  base_url=base_url or "",
230
243
  operation_id="list_transactions",
231
- oauth2_scopes=[],
244
+ oauth2_scopes=None,
232
245
  security_source=get_security_from_env(
233
246
  self.sdk_configuration.security, models.Security
234
247
  ),
@@ -261,7 +274,7 @@ class Transactions(BaseSDK):
261
274
  return None
262
275
 
263
276
  next_cursor = next_cursor[0]
264
- if next_cursor is None:
277
+ if next_cursor is None or str(next_cursor).strip() == "":
265
278
  return None
266
279
 
267
280
  return self.list(
@@ -307,6 +320,7 @@ class Transactions(BaseSDK):
307
320
  is_subsequent_payment=is_subsequent_payment,
308
321
  merchant_initiated=merchant_initiated,
309
322
  used_3ds=used_3ds,
323
+ disputed=disputed,
310
324
  buyer_search=buyer_search,
311
325
  merchant_account_id=merchant_account_id,
312
326
  retries=retries,
@@ -410,6 +424,7 @@ class Transactions(BaseSDK):
410
424
  is_subsequent_payment: OptionalNullable[bool] = UNSET,
411
425
  merchant_initiated: OptionalNullable[bool] = UNSET,
412
426
  used_3ds: OptionalNullable[bool] = UNSET,
427
+ disputed: OptionalNullable[bool] = UNSET,
413
428
  buyer_search: OptionalNullable[List[str]] = UNSET,
414
429
  merchant_account_id: Optional[str] = None,
415
430
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
@@ -463,6 +478,7 @@ class Transactions(BaseSDK):
463
478
  :param is_subsequent_payment: Filters for transactions where the `is_subsequent_payment` matches the provided value.
464
479
  :param merchant_initiated: Filters for transactions where the `merchant_initiated` matches the provided value.
465
480
  :param used_3ds: Filters for transactions that attempted 3DS authentication or not.
481
+ :param disputed: Filters for transactions that have been disputed.
466
482
  :param buyer_search: Filters the results to only get the items for which some of the buyer data contains exactly the provided `buyer_search` values.
467
483
  :param merchant_account_id: The ID of the merchant account to use for this request.
468
484
  :param retries: Override the default retry configuration for this method
@@ -523,6 +539,7 @@ class Transactions(BaseSDK):
523
539
  is_subsequent_payment=is_subsequent_payment,
524
540
  merchant_initiated=merchant_initiated,
525
541
  used_3ds=used_3ds,
542
+ disputed=disputed,
526
543
  buyer_search=buyer_search,
527
544
  merchant_account_id=merchant_account_id,
528
545
  )
@@ -543,6 +560,7 @@ class Transactions(BaseSDK):
543
560
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
544
561
  ),
545
562
  security=self.sdk_configuration.security,
563
+ allow_empty_value=None,
546
564
  timeout_ms=timeout_ms,
547
565
  )
548
566
 
@@ -563,7 +581,7 @@ class Transactions(BaseSDK):
563
581
  config=self.sdk_configuration,
564
582
  base_url=base_url or "",
565
583
  operation_id="list_transactions",
566
- oauth2_scopes=[],
584
+ oauth2_scopes=None,
567
585
  security_source=get_security_from_env(
568
586
  self.sdk_configuration.security, models.Security
569
587
  ),
@@ -596,7 +614,7 @@ class Transactions(BaseSDK):
596
614
  return None
597
615
 
598
616
  next_cursor = next_cursor[0]
599
- if next_cursor is None:
617
+ if next_cursor is None or str(next_cursor).strip() == "":
600
618
  return None
601
619
 
602
620
  return self.list(
@@ -642,6 +660,7 @@ class Transactions(BaseSDK):
642
660
  is_subsequent_payment=is_subsequent_payment,
643
661
  merchant_initiated=merchant_initiated,
644
662
  used_3ds=used_3ds,
663
+ disputed=disputed,
645
664
  buyer_search=buyer_search,
646
665
  merchant_account_id=merchant_account_id,
647
666
  retries=retries,
@@ -716,7 +735,7 @@ class Transactions(BaseSDK):
716
735
  ]
717
736
  ] = UNSET,
718
737
  buyer: OptionalNullable[
719
- Union[models.GuestBuyerInput, models.GuestBuyerInputTypedDict]
738
+ Union[models.GuestBuyer, models.GuestBuyerTypedDict]
720
739
  ] = UNSET,
721
740
  buyer_id: OptionalNullable[str] = UNSET,
722
741
  buyer_external_identifier: OptionalNullable[str] = UNSET,
@@ -762,6 +781,15 @@ class Transactions(BaseSDK):
762
781
  Union[models.Recipient, models.RecipientTypedDict]
763
782
  ] = UNSET,
764
783
  installment_count: OptionalNullable[int] = UNSET,
784
+ tax_amount: OptionalNullable[int] = UNSET,
785
+ merchant_tax_id: OptionalNullable[str] = UNSET,
786
+ purchase_order_number: OptionalNullable[str] = UNSET,
787
+ customer_reference_number: OptionalNullable[str] = UNSET,
788
+ amount_includes_tax: OptionalNullable[bool] = UNSET,
789
+ supplier_order_number: OptionalNullable[str] = UNSET,
790
+ duty_amount: OptionalNullable[int] = UNSET,
791
+ shipping_amount: OptionalNullable[int] = UNSET,
792
+ integration_client: OptionalNullable[models.IntegrationClient] = UNSET,
765
793
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
766
794
  server_url: Optional[str] = None,
767
795
  timeout_ms: Optional[int] = None,
@@ -775,7 +803,9 @@ class Transactions(BaseSDK):
775
803
  :param currency: A supported ISO 4217 currency code. For redirect requests, this value must match the one specified for `currency` in `payment_method`.
776
804
  :param merchant_account_id: The ID of the merchant account to use for this request.
777
805
  :param idempotency_key: A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
778
- :param x_forwarded_for: The IP address to forward from the customer. Use this when calling our API from the server side to ensure the customer's address is passed to downstream services, rather than your server IP.
806
+ :param x_forwarded_for: The IP address to forward from the customer. Use this when calling
807
+ our API from the server side to ensure the customer's address is
808
+ passed to downstream services, rather than your server IP.
779
809
  :param country: The 2-letter ISO code of the country where the transaction is processed. This is also used to filter the payment services that can process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly.
780
810
  :param payment_method: The optional payment method to use for this transaction. This field is required if no `gift_cards` have been added.
781
811
  :param buyer: Guest buyer details provided inline rather than creating a buyer resource beforehand and using the `buyer_id` or `buyer_external_identifier` keys. No buyer resource will be created on Gr4vy when used.
@@ -784,10 +814,23 @@ class Transactions(BaseSDK):
784
814
  :param gift_cards: The optional gift card(s) to use for this transaction. At least one gift card is required if no other `payment_method` has been added. By default, only a maximum limit of 10 gift cards may be used in a single transaction. Please contact our team to change this limit.
785
815
  :param external_identifier: An external identifier that can be used to match the transaction against your own records.
786
816
  :param intent:
787
- :param store: Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.
817
+ :param store: Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set:
818
+
819
+ * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`.
820
+ * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.
788
821
  :param three_d_secure_data: Pass through 3-D Secure data to support external 3-D Secure authorisation. If using an external 3-D Secure provider, you should not pass a `redirect_url` in the `payment_method` object for a transaction.
789
822
  :param metadata: Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.
790
- :param is_subsequent_payment: Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.
823
+ :param is_subsequent_payment: Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used.
824
+
825
+ The flag can only be `false` (or not set) when the transaction meets one of the following criteria:
826
+
827
+ * It is not `merchant_initiated`.
828
+ * `payment_source` is set to `card_on_file`.
829
+
830
+ The flag can only be set to `true` when the transaction meets one of the following criteria:
831
+ * It is not `merchant_initiated`.
832
+ * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`.
833
+ * `payment_source` is set to `card_on_file`.
791
834
  :param merchant_initiated: Indicates whether the transaction was initiated by the merchant (true) or customer (false).
792
835
  :param payment_source: The way payment method information made it to this transaction.
793
836
  :param airline: The airline addendum data which describes the airline booking associated with this transaction.
@@ -797,13 +840,27 @@ class Transactions(BaseSDK):
797
840
  :param browser_info: Information about the browser used by the buyer. This can be used by anti-fraud services.
798
841
  :param shipping_details_id: The unique identifier of a set of shipping details stored for the buyer. If provided, the created transaction will include a copy of the details at the point of transaction creation; i.e. it will not be affected by later changes to the detail in the database.
799
842
  :param connection_options: Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake case, for example `merchant_defined_data` or camel case to match an external API that the connector uses.
800
- :param async_capture: Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.
843
+ :param async_capture: Whether to capture the transaction asynchronously.
844
+
845
+ - When `async_capture` is `false` (default), the transaction is captured in the same request.
846
+ - When `async_capture` is `true`, the transaction is automatically captured at a later time.
847
+
848
+ Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.
801
849
  :param anti_fraud_fingerprint: This field represents the fingerprint data to be passed to the active anti-fraud service.
802
850
  :param payment_service_id: The unique identifier of an existing payment service. When provided, the created transaction will be processed by the given payment service and any routing rules will be skipped.
803
851
  :param account_funding_transaction: Marks the transaction as an AFT. Requires the payment service to support this feature, and might `recipient` and `buyer` data
804
852
  :param allow_partial_authorization: Defines if the transaction will allow for a partial authorization.
805
853
  :param recipient: The recipient of any account to account funding. For use with AFTs.
806
854
  :param installment_count: The number of installments a buyer is required to make.
855
+ :param tax_amount: The sales tax amount for this transaction, represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`
856
+ :param merchant_tax_id: Merchant tax ID (for example, EIN or VAT number).
857
+ :param purchase_order_number: Invoice number or Purchase Order number.
858
+ :param customer_reference_number: Customer code or reference.
859
+ :param amount_includes_tax: Whether the tax is included in the amount.
860
+ :param supplier_order_number: The merchant's unique identifier for the sales order or invoice.
861
+ :param duty_amount: Total charges for import/export duties.
862
+ :param shipping_amount: Total shipping amount.
863
+ :param integration_client: Defines the client where the session for this transaction is going to be used. Please refer to the connections documentation for more guidance.
807
864
  :param retries: Override the default retry configuration for this method
808
865
  :param server_url: Override the default server URL for this method
809
866
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -832,7 +889,7 @@ class Transactions(BaseSDK):
832
889
  OptionalNullable[models.TransactionCreatePaymentMethod],
833
890
  ),
834
891
  buyer=utils.get_pydantic_model(
835
- buyer, OptionalNullable[models.GuestBuyerInput]
892
+ buyer, OptionalNullable[models.GuestBuyer]
836
893
  ),
837
894
  buyer_id=buyer_id,
838
895
  buyer_external_identifier=buyer_external_identifier,
@@ -876,6 +933,15 @@ class Transactions(BaseSDK):
876
933
  recipient, OptionalNullable[models.Recipient]
877
934
  ),
878
935
  installment_count=installment_count,
936
+ tax_amount=tax_amount,
937
+ merchant_tax_id=merchant_tax_id,
938
+ purchase_order_number=purchase_order_number,
939
+ customer_reference_number=customer_reference_number,
940
+ amount_includes_tax=amount_includes_tax,
941
+ supplier_order_number=supplier_order_number,
942
+ duty_amount=duty_amount,
943
+ shipping_amount=shipping_amount,
944
+ integration_client=integration_client,
879
945
  ),
880
946
  )
881
947
 
@@ -902,6 +968,7 @@ class Transactions(BaseSDK):
902
968
  "json",
903
969
  models.TransactionCreate,
904
970
  ),
971
+ allow_empty_value=None,
905
972
  timeout_ms=timeout_ms,
906
973
  )
907
974
 
@@ -918,7 +985,7 @@ class Transactions(BaseSDK):
918
985
  config=self.sdk_configuration,
919
986
  base_url=base_url or "",
920
987
  operation_id="create_transaction",
921
- oauth2_scopes=[],
988
+ oauth2_scopes=None,
922
989
  security_source=get_security_from_env(
923
990
  self.sdk_configuration.security, models.Security
924
991
  ),
@@ -1009,7 +1076,7 @@ class Transactions(BaseSDK):
1009
1076
  ]
1010
1077
  ] = UNSET,
1011
1078
  buyer: OptionalNullable[
1012
- Union[models.GuestBuyerInput, models.GuestBuyerInputTypedDict]
1079
+ Union[models.GuestBuyer, models.GuestBuyerTypedDict]
1013
1080
  ] = UNSET,
1014
1081
  buyer_id: OptionalNullable[str] = UNSET,
1015
1082
  buyer_external_identifier: OptionalNullable[str] = UNSET,
@@ -1055,6 +1122,15 @@ class Transactions(BaseSDK):
1055
1122
  Union[models.Recipient, models.RecipientTypedDict]
1056
1123
  ] = UNSET,
1057
1124
  installment_count: OptionalNullable[int] = UNSET,
1125
+ tax_amount: OptionalNullable[int] = UNSET,
1126
+ merchant_tax_id: OptionalNullable[str] = UNSET,
1127
+ purchase_order_number: OptionalNullable[str] = UNSET,
1128
+ customer_reference_number: OptionalNullable[str] = UNSET,
1129
+ amount_includes_tax: OptionalNullable[bool] = UNSET,
1130
+ supplier_order_number: OptionalNullable[str] = UNSET,
1131
+ duty_amount: OptionalNullable[int] = UNSET,
1132
+ shipping_amount: OptionalNullable[int] = UNSET,
1133
+ integration_client: OptionalNullable[models.IntegrationClient] = UNSET,
1058
1134
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
1059
1135
  server_url: Optional[str] = None,
1060
1136
  timeout_ms: Optional[int] = None,
@@ -1068,7 +1144,9 @@ class Transactions(BaseSDK):
1068
1144
  :param currency: A supported ISO 4217 currency code. For redirect requests, this value must match the one specified for `currency` in `payment_method`.
1069
1145
  :param merchant_account_id: The ID of the merchant account to use for this request.
1070
1146
  :param idempotency_key: A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
1071
- :param x_forwarded_for: The IP address to forward from the customer. Use this when calling our API from the server side to ensure the customer's address is passed to downstream services, rather than your server IP.
1147
+ :param x_forwarded_for: The IP address to forward from the customer. Use this when calling
1148
+ our API from the server side to ensure the customer's address is
1149
+ passed to downstream services, rather than your server IP.
1072
1150
  :param country: The 2-letter ISO code of the country where the transaction is processed. This is also used to filter the payment services that can process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly.
1073
1151
  :param payment_method: The optional payment method to use for this transaction. This field is required if no `gift_cards` have been added.
1074
1152
  :param buyer: Guest buyer details provided inline rather than creating a buyer resource beforehand and using the `buyer_id` or `buyer_external_identifier` keys. No buyer resource will be created on Gr4vy when used.
@@ -1077,10 +1155,23 @@ class Transactions(BaseSDK):
1077
1155
  :param gift_cards: The optional gift card(s) to use for this transaction. At least one gift card is required if no other `payment_method` has been added. By default, only a maximum limit of 10 gift cards may be used in a single transaction. Please contact our team to change this limit.
1078
1156
  :param external_identifier: An external identifier that can be used to match the transaction against your own records.
1079
1157
  :param intent:
1080
- :param store: Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.
1158
+ :param store: Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set:
1159
+
1160
+ * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`.
1161
+ * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.
1081
1162
  :param three_d_secure_data: Pass through 3-D Secure data to support external 3-D Secure authorisation. If using an external 3-D Secure provider, you should not pass a `redirect_url` in the `payment_method` object for a transaction.
1082
1163
  :param metadata: Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.
1083
- :param is_subsequent_payment: Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.
1164
+ :param is_subsequent_payment: Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used.
1165
+
1166
+ The flag can only be `false` (or not set) when the transaction meets one of the following criteria:
1167
+
1168
+ * It is not `merchant_initiated`.
1169
+ * `payment_source` is set to `card_on_file`.
1170
+
1171
+ The flag can only be set to `true` when the transaction meets one of the following criteria:
1172
+ * It is not `merchant_initiated`.
1173
+ * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`.
1174
+ * `payment_source` is set to `card_on_file`.
1084
1175
  :param merchant_initiated: Indicates whether the transaction was initiated by the merchant (true) or customer (false).
1085
1176
  :param payment_source: The way payment method information made it to this transaction.
1086
1177
  :param airline: The airline addendum data which describes the airline booking associated with this transaction.
@@ -1090,13 +1181,27 @@ class Transactions(BaseSDK):
1090
1181
  :param browser_info: Information about the browser used by the buyer. This can be used by anti-fraud services.
1091
1182
  :param shipping_details_id: The unique identifier of a set of shipping details stored for the buyer. If provided, the created transaction will include a copy of the details at the point of transaction creation; i.e. it will not be affected by later changes to the detail in the database.
1092
1183
  :param connection_options: Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake case, for example `merchant_defined_data` or camel case to match an external API that the connector uses.
1093
- :param async_capture: Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.
1184
+ :param async_capture: Whether to capture the transaction asynchronously.
1185
+
1186
+ - When `async_capture` is `false` (default), the transaction is captured in the same request.
1187
+ - When `async_capture` is `true`, the transaction is automatically captured at a later time.
1188
+
1189
+ Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.
1094
1190
  :param anti_fraud_fingerprint: This field represents the fingerprint data to be passed to the active anti-fraud service.
1095
1191
  :param payment_service_id: The unique identifier of an existing payment service. When provided, the created transaction will be processed by the given payment service and any routing rules will be skipped.
1096
1192
  :param account_funding_transaction: Marks the transaction as an AFT. Requires the payment service to support this feature, and might `recipient` and `buyer` data
1097
1193
  :param allow_partial_authorization: Defines if the transaction will allow for a partial authorization.
1098
1194
  :param recipient: The recipient of any account to account funding. For use with AFTs.
1099
1195
  :param installment_count: The number of installments a buyer is required to make.
1196
+ :param tax_amount: The sales tax amount for this transaction, represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`
1197
+ :param merchant_tax_id: Merchant tax ID (for example, EIN or VAT number).
1198
+ :param purchase_order_number: Invoice number or Purchase Order number.
1199
+ :param customer_reference_number: Customer code or reference.
1200
+ :param amount_includes_tax: Whether the tax is included in the amount.
1201
+ :param supplier_order_number: The merchant's unique identifier for the sales order or invoice.
1202
+ :param duty_amount: Total charges for import/export duties.
1203
+ :param shipping_amount: Total shipping amount.
1204
+ :param integration_client: Defines the client where the session for this transaction is going to be used. Please refer to the connections documentation for more guidance.
1100
1205
  :param retries: Override the default retry configuration for this method
1101
1206
  :param server_url: Override the default server URL for this method
1102
1207
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -1125,7 +1230,7 @@ class Transactions(BaseSDK):
1125
1230
  OptionalNullable[models.TransactionCreatePaymentMethod],
1126
1231
  ),
1127
1232
  buyer=utils.get_pydantic_model(
1128
- buyer, OptionalNullable[models.GuestBuyerInput]
1233
+ buyer, OptionalNullable[models.GuestBuyer]
1129
1234
  ),
1130
1235
  buyer_id=buyer_id,
1131
1236
  buyer_external_identifier=buyer_external_identifier,
@@ -1169,6 +1274,15 @@ class Transactions(BaseSDK):
1169
1274
  recipient, OptionalNullable[models.Recipient]
1170
1275
  ),
1171
1276
  installment_count=installment_count,
1277
+ tax_amount=tax_amount,
1278
+ merchant_tax_id=merchant_tax_id,
1279
+ purchase_order_number=purchase_order_number,
1280
+ customer_reference_number=customer_reference_number,
1281
+ amount_includes_tax=amount_includes_tax,
1282
+ supplier_order_number=supplier_order_number,
1283
+ duty_amount=duty_amount,
1284
+ shipping_amount=shipping_amount,
1285
+ integration_client=integration_client,
1172
1286
  ),
1173
1287
  )
1174
1288
 
@@ -1195,6 +1309,7 @@ class Transactions(BaseSDK):
1195
1309
  "json",
1196
1310
  models.TransactionCreate,
1197
1311
  ),
1312
+ allow_empty_value=None,
1198
1313
  timeout_ms=timeout_ms,
1199
1314
  )
1200
1315
 
@@ -1211,7 +1326,7 @@ class Transactions(BaseSDK):
1211
1326
  config=self.sdk_configuration,
1212
1327
  base_url=base_url or "",
1213
1328
  operation_id="create_transaction",
1214
- oauth2_scopes=[],
1329
+ oauth2_scopes=None,
1215
1330
  security_source=get_security_from_env(
1216
1331
  self.sdk_configuration.security, models.Security
1217
1332
  ),
@@ -1338,6 +1453,7 @@ class Transactions(BaseSDK):
1338
1453
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
1339
1454
  ),
1340
1455
  security=self.sdk_configuration.security,
1456
+ allow_empty_value=None,
1341
1457
  timeout_ms=timeout_ms,
1342
1458
  )
1343
1459
 
@@ -1358,7 +1474,7 @@ class Transactions(BaseSDK):
1358
1474
  config=self.sdk_configuration,
1359
1475
  base_url=base_url or "",
1360
1476
  operation_id="get_transaction",
1361
- oauth2_scopes=[],
1477
+ oauth2_scopes=None,
1362
1478
  security_source=get_security_from_env(
1363
1479
  self.sdk_configuration.security, models.Security
1364
1480
  ),
@@ -1485,6 +1601,7 @@ class Transactions(BaseSDK):
1485
1601
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
1486
1602
  ),
1487
1603
  security=self.sdk_configuration.security,
1604
+ allow_empty_value=None,
1488
1605
  timeout_ms=timeout_ms,
1489
1606
  )
1490
1607
 
@@ -1505,7 +1622,7 @@ class Transactions(BaseSDK):
1505
1622
  config=self.sdk_configuration,
1506
1623
  base_url=base_url or "",
1507
1624
  operation_id="get_transaction",
1508
- oauth2_scopes=[],
1625
+ oauth2_scopes=None,
1509
1626
  security_source=get_security_from_env(
1510
1627
  self.sdk_configuration.security, models.Security
1511
1628
  ),
@@ -1658,6 +1775,7 @@ class Transactions(BaseSDK):
1658
1775
  "json",
1659
1776
  models.TransactionUpdate,
1660
1777
  ),
1778
+ allow_empty_value=None,
1661
1779
  timeout_ms=timeout_ms,
1662
1780
  )
1663
1781
 
@@ -1674,7 +1792,7 @@ class Transactions(BaseSDK):
1674
1792
  config=self.sdk_configuration,
1675
1793
  base_url=base_url or "",
1676
1794
  operation_id="update_transaction",
1677
- oauth2_scopes=[],
1795
+ oauth2_scopes=None,
1678
1796
  security_source=get_security_from_env(
1679
1797
  self.sdk_configuration.security, models.Security
1680
1798
  ),
@@ -1827,6 +1945,7 @@ class Transactions(BaseSDK):
1827
1945
  "json",
1828
1946
  models.TransactionUpdate,
1829
1947
  ),
1948
+ allow_empty_value=None,
1830
1949
  timeout_ms=timeout_ms,
1831
1950
  )
1832
1951
 
@@ -1843,7 +1962,7 @@ class Transactions(BaseSDK):
1843
1962
  config=self.sdk_configuration,
1844
1963
  base_url=base_url or "",
1845
1964
  operation_id="update_transaction",
1846
- oauth2_scopes=[],
1965
+ oauth2_scopes=None,
1847
1966
  security_source=get_security_from_env(
1848
1967
  self.sdk_configuration.security, models.Security
1849
1968
  ),
@@ -1992,6 +2111,7 @@ class Transactions(BaseSDK):
1992
2111
  "json",
1993
2112
  models.TransactionCaptureCreate,
1994
2113
  ),
2114
+ allow_empty_value=None,
1995
2115
  timeout_ms=timeout_ms,
1996
2116
  )
1997
2117
 
@@ -2008,7 +2128,7 @@ class Transactions(BaseSDK):
2008
2128
  config=self.sdk_configuration,
2009
2129
  base_url=base_url or "",
2010
2130
  operation_id="capture_transaction",
2011
- oauth2_scopes=[],
2131
+ oauth2_scopes=None,
2012
2132
  security_source=get_security_from_env(
2013
2133
  self.sdk_configuration.security, models.Security
2014
2134
  ),
@@ -2157,6 +2277,7 @@ class Transactions(BaseSDK):
2157
2277
  "json",
2158
2278
  models.TransactionCaptureCreate,
2159
2279
  ),
2280
+ allow_empty_value=None,
2160
2281
  timeout_ms=timeout_ms,
2161
2282
  )
2162
2283
 
@@ -2173,7 +2294,7 @@ class Transactions(BaseSDK):
2173
2294
  config=self.sdk_configuration,
2174
2295
  base_url=base_url or "",
2175
2296
  operation_id="capture_transaction",
2176
- oauth2_scopes=[],
2297
+ oauth2_scopes=None,
2177
2298
  security_source=get_security_from_env(
2178
2299
  self.sdk_configuration.security, models.Security
2179
2300
  ),
@@ -2303,6 +2424,7 @@ class Transactions(BaseSDK):
2303
2424
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2304
2425
  ),
2305
2426
  security=self.sdk_configuration.security,
2427
+ allow_empty_value=None,
2306
2428
  timeout_ms=timeout_ms,
2307
2429
  )
2308
2430
 
@@ -2319,7 +2441,7 @@ class Transactions(BaseSDK):
2319
2441
  config=self.sdk_configuration,
2320
2442
  base_url=base_url or "",
2321
2443
  operation_id="void_transaction",
2322
- oauth2_scopes=[],
2444
+ oauth2_scopes=None,
2323
2445
  security_source=get_security_from_env(
2324
2446
  self.sdk_configuration.security, models.Security
2325
2447
  ),
@@ -2449,6 +2571,7 @@ class Transactions(BaseSDK):
2449
2571
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2450
2572
  ),
2451
2573
  security=self.sdk_configuration.security,
2574
+ allow_empty_value=None,
2452
2575
  timeout_ms=timeout_ms,
2453
2576
  )
2454
2577
 
@@ -2465,7 +2588,7 @@ class Transactions(BaseSDK):
2465
2588
  config=self.sdk_configuration,
2466
2589
  base_url=base_url or "",
2467
2590
  operation_id="void_transaction",
2468
- oauth2_scopes=[],
2591
+ oauth2_scopes=None,
2469
2592
  security_source=get_security_from_env(
2470
2593
  self.sdk_configuration.security, models.Security
2471
2594
  ),
@@ -2540,6 +2663,294 @@ class Transactions(BaseSDK):
2540
2663
 
2541
2664
  raise errors.APIError("Unexpected response received", http_res)
2542
2665
 
2666
+ def cancel(
2667
+ self,
2668
+ *,
2669
+ transaction_id: str,
2670
+ merchant_account_id: Optional[str] = None,
2671
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2672
+ server_url: Optional[str] = None,
2673
+ timeout_ms: Optional[int] = None,
2674
+ http_headers: Optional[Mapping[str, str]] = None,
2675
+ ) -> models.TransactionCancel:
2676
+ r"""Cancel transaction
2677
+
2678
+ Cancels a pending transaction. If the transaction was successfully authorized, or was already captured, the cancel will not be processed.
2679
+
2680
+ :param transaction_id: The ID of the transaction
2681
+ :param merchant_account_id: The ID of the merchant account to use for this request.
2682
+ :param retries: Override the default retry configuration for this method
2683
+ :param server_url: Override the default server URL for this method
2684
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2685
+ :param http_headers: Additional headers to set or replace on requests.
2686
+ """
2687
+ base_url = None
2688
+ url_variables = None
2689
+ if timeout_ms is None:
2690
+ timeout_ms = self.sdk_configuration.timeout_ms
2691
+
2692
+ if server_url is not None:
2693
+ base_url = server_url
2694
+ else:
2695
+ base_url = self._get_url(base_url, url_variables)
2696
+
2697
+ request = models.CancelTransactionRequest(
2698
+ transaction_id=transaction_id,
2699
+ merchant_account_id=merchant_account_id,
2700
+ )
2701
+
2702
+ req = self._build_request(
2703
+ method="POST",
2704
+ path="/transactions/{transaction_id}/cancel",
2705
+ base_url=base_url,
2706
+ url_variables=url_variables,
2707
+ request=request,
2708
+ request_body_required=False,
2709
+ request_has_path_params=True,
2710
+ request_has_query_params=True,
2711
+ user_agent_header="user-agent",
2712
+ accept_header_value="application/json",
2713
+ http_headers=http_headers,
2714
+ _globals=models.CancelTransactionGlobals(
2715
+ merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2716
+ ),
2717
+ security=self.sdk_configuration.security,
2718
+ allow_empty_value=None,
2719
+ timeout_ms=timeout_ms,
2720
+ )
2721
+
2722
+ if retries == UNSET:
2723
+ if self.sdk_configuration.retry_config is not UNSET:
2724
+ retries = self.sdk_configuration.retry_config
2725
+
2726
+ retry_config = None
2727
+ if isinstance(retries, utils.RetryConfig):
2728
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2729
+
2730
+ http_res = self.do_request(
2731
+ hook_ctx=HookContext(
2732
+ config=self.sdk_configuration,
2733
+ base_url=base_url or "",
2734
+ operation_id="cancel_transaction",
2735
+ oauth2_scopes=None,
2736
+ security_source=get_security_from_env(
2737
+ self.sdk_configuration.security, models.Security
2738
+ ),
2739
+ ),
2740
+ request=req,
2741
+ error_status_codes=[
2742
+ "400",
2743
+ "401",
2744
+ "403",
2745
+ "404",
2746
+ "405",
2747
+ "409",
2748
+ "422",
2749
+ "425",
2750
+ "429",
2751
+ "4XX",
2752
+ "500",
2753
+ "502",
2754
+ "504",
2755
+ "5XX",
2756
+ ],
2757
+ retry_config=retry_config,
2758
+ )
2759
+
2760
+ response_data: Any = None
2761
+ if utils.match_response(http_res, "200", "application/json"):
2762
+ return unmarshal_json_response(models.TransactionCancel, http_res)
2763
+ if utils.match_response(http_res, "400", "application/json"):
2764
+ response_data = unmarshal_json_response(errors.Error400Data, http_res)
2765
+ raise errors.Error400(response_data, http_res)
2766
+ if utils.match_response(http_res, "401", "application/json"):
2767
+ response_data = unmarshal_json_response(errors.Error401Data, http_res)
2768
+ raise errors.Error401(response_data, http_res)
2769
+ if utils.match_response(http_res, "403", "application/json"):
2770
+ response_data = unmarshal_json_response(errors.Error403Data, http_res)
2771
+ raise errors.Error403(response_data, http_res)
2772
+ if utils.match_response(http_res, "404", "application/json"):
2773
+ response_data = unmarshal_json_response(errors.Error404Data, http_res)
2774
+ raise errors.Error404(response_data, http_res)
2775
+ if utils.match_response(http_res, "405", "application/json"):
2776
+ response_data = unmarshal_json_response(errors.Error405Data, http_res)
2777
+ raise errors.Error405(response_data, http_res)
2778
+ if utils.match_response(http_res, "409", "application/json"):
2779
+ response_data = unmarshal_json_response(errors.Error409Data, http_res)
2780
+ raise errors.Error409(response_data, http_res)
2781
+ if utils.match_response(http_res, "422", "application/json"):
2782
+ response_data = unmarshal_json_response(
2783
+ errors.HTTPValidationErrorData, http_res
2784
+ )
2785
+ raise errors.HTTPValidationError(response_data, http_res)
2786
+ if utils.match_response(http_res, "425", "application/json"):
2787
+ response_data = unmarshal_json_response(errors.Error425Data, http_res)
2788
+ raise errors.Error425(response_data, http_res)
2789
+ if utils.match_response(http_res, "429", "application/json"):
2790
+ response_data = unmarshal_json_response(errors.Error429Data, http_res)
2791
+ raise errors.Error429(response_data, http_res)
2792
+ if utils.match_response(http_res, "500", "application/json"):
2793
+ response_data = unmarshal_json_response(errors.Error500Data, http_res)
2794
+ raise errors.Error500(response_data, http_res)
2795
+ if utils.match_response(http_res, "502", "application/json"):
2796
+ response_data = unmarshal_json_response(errors.Error502Data, http_res)
2797
+ raise errors.Error502(response_data, http_res)
2798
+ if utils.match_response(http_res, "504", "application/json"):
2799
+ response_data = unmarshal_json_response(errors.Error504Data, http_res)
2800
+ raise errors.Error504(response_data, http_res)
2801
+ if utils.match_response(http_res, "4XX", "*"):
2802
+ http_res_text = utils.stream_to_text(http_res)
2803
+ raise errors.APIError("API error occurred", http_res, http_res_text)
2804
+ if utils.match_response(http_res, "5XX", "*"):
2805
+ http_res_text = utils.stream_to_text(http_res)
2806
+ raise errors.APIError("API error occurred", http_res, http_res_text)
2807
+
2808
+ raise errors.APIError("Unexpected response received", http_res)
2809
+
2810
+ async def cancel_async(
2811
+ self,
2812
+ *,
2813
+ transaction_id: str,
2814
+ merchant_account_id: Optional[str] = None,
2815
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2816
+ server_url: Optional[str] = None,
2817
+ timeout_ms: Optional[int] = None,
2818
+ http_headers: Optional[Mapping[str, str]] = None,
2819
+ ) -> models.TransactionCancel:
2820
+ r"""Cancel transaction
2821
+
2822
+ Cancels a pending transaction. If the transaction was successfully authorized, or was already captured, the cancel will not be processed.
2823
+
2824
+ :param transaction_id: The ID of the transaction
2825
+ :param merchant_account_id: The ID of the merchant account to use for this request.
2826
+ :param retries: Override the default retry configuration for this method
2827
+ :param server_url: Override the default server URL for this method
2828
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2829
+ :param http_headers: Additional headers to set or replace on requests.
2830
+ """
2831
+ base_url = None
2832
+ url_variables = None
2833
+ if timeout_ms is None:
2834
+ timeout_ms = self.sdk_configuration.timeout_ms
2835
+
2836
+ if server_url is not None:
2837
+ base_url = server_url
2838
+ else:
2839
+ base_url = self._get_url(base_url, url_variables)
2840
+
2841
+ request = models.CancelTransactionRequest(
2842
+ transaction_id=transaction_id,
2843
+ merchant_account_id=merchant_account_id,
2844
+ )
2845
+
2846
+ req = self._build_request_async(
2847
+ method="POST",
2848
+ path="/transactions/{transaction_id}/cancel",
2849
+ base_url=base_url,
2850
+ url_variables=url_variables,
2851
+ request=request,
2852
+ request_body_required=False,
2853
+ request_has_path_params=True,
2854
+ request_has_query_params=True,
2855
+ user_agent_header="user-agent",
2856
+ accept_header_value="application/json",
2857
+ http_headers=http_headers,
2858
+ _globals=models.CancelTransactionGlobals(
2859
+ merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2860
+ ),
2861
+ security=self.sdk_configuration.security,
2862
+ allow_empty_value=None,
2863
+ timeout_ms=timeout_ms,
2864
+ )
2865
+
2866
+ if retries == UNSET:
2867
+ if self.sdk_configuration.retry_config is not UNSET:
2868
+ retries = self.sdk_configuration.retry_config
2869
+
2870
+ retry_config = None
2871
+ if isinstance(retries, utils.RetryConfig):
2872
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2873
+
2874
+ http_res = await self.do_request_async(
2875
+ hook_ctx=HookContext(
2876
+ config=self.sdk_configuration,
2877
+ base_url=base_url or "",
2878
+ operation_id="cancel_transaction",
2879
+ oauth2_scopes=None,
2880
+ security_source=get_security_from_env(
2881
+ self.sdk_configuration.security, models.Security
2882
+ ),
2883
+ ),
2884
+ request=req,
2885
+ error_status_codes=[
2886
+ "400",
2887
+ "401",
2888
+ "403",
2889
+ "404",
2890
+ "405",
2891
+ "409",
2892
+ "422",
2893
+ "425",
2894
+ "429",
2895
+ "4XX",
2896
+ "500",
2897
+ "502",
2898
+ "504",
2899
+ "5XX",
2900
+ ],
2901
+ retry_config=retry_config,
2902
+ )
2903
+
2904
+ response_data: Any = None
2905
+ if utils.match_response(http_res, "200", "application/json"):
2906
+ return unmarshal_json_response(models.TransactionCancel, http_res)
2907
+ if utils.match_response(http_res, "400", "application/json"):
2908
+ response_data = unmarshal_json_response(errors.Error400Data, http_res)
2909
+ raise errors.Error400(response_data, http_res)
2910
+ if utils.match_response(http_res, "401", "application/json"):
2911
+ response_data = unmarshal_json_response(errors.Error401Data, http_res)
2912
+ raise errors.Error401(response_data, http_res)
2913
+ if utils.match_response(http_res, "403", "application/json"):
2914
+ response_data = unmarshal_json_response(errors.Error403Data, http_res)
2915
+ raise errors.Error403(response_data, http_res)
2916
+ if utils.match_response(http_res, "404", "application/json"):
2917
+ response_data = unmarshal_json_response(errors.Error404Data, http_res)
2918
+ raise errors.Error404(response_data, http_res)
2919
+ if utils.match_response(http_res, "405", "application/json"):
2920
+ response_data = unmarshal_json_response(errors.Error405Data, http_res)
2921
+ raise errors.Error405(response_data, http_res)
2922
+ if utils.match_response(http_res, "409", "application/json"):
2923
+ response_data = unmarshal_json_response(errors.Error409Data, http_res)
2924
+ raise errors.Error409(response_data, http_res)
2925
+ if utils.match_response(http_res, "422", "application/json"):
2926
+ response_data = unmarshal_json_response(
2927
+ errors.HTTPValidationErrorData, http_res
2928
+ )
2929
+ raise errors.HTTPValidationError(response_data, http_res)
2930
+ if utils.match_response(http_res, "425", "application/json"):
2931
+ response_data = unmarshal_json_response(errors.Error425Data, http_res)
2932
+ raise errors.Error425(response_data, http_res)
2933
+ if utils.match_response(http_res, "429", "application/json"):
2934
+ response_data = unmarshal_json_response(errors.Error429Data, http_res)
2935
+ raise errors.Error429(response_data, http_res)
2936
+ if utils.match_response(http_res, "500", "application/json"):
2937
+ response_data = unmarshal_json_response(errors.Error500Data, http_res)
2938
+ raise errors.Error500(response_data, http_res)
2939
+ if utils.match_response(http_res, "502", "application/json"):
2940
+ response_data = unmarshal_json_response(errors.Error502Data, http_res)
2941
+ raise errors.Error502(response_data, http_res)
2942
+ if utils.match_response(http_res, "504", "application/json"):
2943
+ response_data = unmarshal_json_response(errors.Error504Data, http_res)
2944
+ raise errors.Error504(response_data, http_res)
2945
+ if utils.match_response(http_res, "4XX", "*"):
2946
+ http_res_text = await utils.stream_to_text_async(http_res)
2947
+ raise errors.APIError("API error occurred", http_res, http_res_text)
2948
+ if utils.match_response(http_res, "5XX", "*"):
2949
+ http_res_text = await utils.stream_to_text_async(http_res)
2950
+ raise errors.APIError("API error occurred", http_res, http_res_text)
2951
+
2952
+ raise errors.APIError("Unexpected response received", http_res)
2953
+
2543
2954
  def sync(
2544
2955
  self,
2545
2956
  *,
@@ -2592,6 +3003,7 @@ class Transactions(BaseSDK):
2592
3003
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2593
3004
  ),
2594
3005
  security=self.sdk_configuration.security,
3006
+ allow_empty_value=None,
2595
3007
  timeout_ms=timeout_ms,
2596
3008
  )
2597
3009
 
@@ -2608,7 +3020,7 @@ class Transactions(BaseSDK):
2608
3020
  config=self.sdk_configuration,
2609
3021
  base_url=base_url or "",
2610
3022
  operation_id="sync_transaction",
2611
- oauth2_scopes=[],
3023
+ oauth2_scopes=None,
2612
3024
  security_source=get_security_from_env(
2613
3025
  self.sdk_configuration.security, models.Security
2614
3026
  ),
@@ -2735,6 +3147,7 @@ class Transactions(BaseSDK):
2735
3147
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
2736
3148
  ),
2737
3149
  security=self.sdk_configuration.security,
3150
+ allow_empty_value=None,
2738
3151
  timeout_ms=timeout_ms,
2739
3152
  )
2740
3153
 
@@ -2751,7 +3164,7 @@ class Transactions(BaseSDK):
2751
3164
  config=self.sdk_configuration,
2752
3165
  base_url=base_url or "",
2753
3166
  operation_id="sync_transaction",
2754
- oauth2_scopes=[],
3167
+ oauth2_scopes=None,
2755
3168
  security_source=get_security_from_env(
2756
3169
  self.sdk_configuration.security, models.Security
2757
3170
  ),