import * as z from "zod/v3"; import { Airline, Airline$Outbound } from "./airline.js"; import { ApplePayPaymentMethodCreate, ApplePayPaymentMethodCreate$Outbound } from "./applepaypaymentmethodcreate.js"; import { BaseBankPaymentMethodCreate, BaseBankPaymentMethodCreate$Outbound } from "./basebankpaymentmethodcreate.js"; import { BrowserInfo, BrowserInfo$Outbound } from "./browserinfo.js"; import { CardWithUrlPaymentMethodCreate, CardWithUrlPaymentMethodCreate$Outbound } from "./cardwithurlpaymentmethodcreate.js"; import { CartItem, CartItem$Outbound } from "./cartitem.js"; import { CheckoutSessionWithUrlPaymentMethodCreate, CheckoutSessionWithUrlPaymentMethodCreate$Outbound } from "./checkoutsessionwithurlpaymentmethodcreate.js"; import { ClickToPayFPANPaymentMethodCreate, ClickToPayFPANPaymentMethodCreate$Outbound } from "./clicktopayfpanpaymentmethodcreate.js"; import { ClickToPayPaymentMethodCreate, ClickToPayPaymentMethodCreate$Outbound } from "./clicktopaypaymentmethodcreate.js"; import { GiftCardTokenTransactionCreate, GiftCardTokenTransactionCreate$Outbound } from "./giftcardtokentransactioncreate.js"; import { GiftCardTransactionCreate, GiftCardTransactionCreate$Outbound } from "./giftcardtransactioncreate.js"; import { GooglePayFPANPaymentMethodCreate, GooglePayFPANPaymentMethodCreate$Outbound } from "./googlepayfpanpaymentmethodcreate.js"; import { GooglePayPaymentMethodCreate, GooglePayPaymentMethodCreate$Outbound } from "./googlepaypaymentmethodcreate.js"; import { GuestBuyer, GuestBuyer$Outbound } from "./guestbuyer.js"; import { IntegrationClient } from "./integrationclient.js"; import { NetworkTokenPaymentMethodCreate, NetworkTokenPaymentMethodCreate$Outbound } from "./networktokenpaymentmethodcreate.js"; import { PazePaymentMethodCreate, PazePaymentMethodCreate$Outbound } from "./pazepaymentmethodcreate.js"; import { PlaidPaymentMethodCreate, PlaidPaymentMethodCreate$Outbound } from "./plaidpaymentmethodcreate.js"; import { Recipient, Recipient$Outbound } from "./recipient.js"; import { RedirectPaymentMethodCreate, RedirectPaymentMethodCreate$Outbound } from "./redirectpaymentmethodcreate.js"; import { StatementDescriptor, StatementDescriptor$Outbound } from "./statementdescriptor.js"; import { ThreeDSecure, ThreeDSecure$Outbound } from "./threedsecure.js"; import { ThreeDSecureDataV1, ThreeDSecureDataV1$Outbound } from "./threedsecuredatav1.js"; import { ThreeDSecureDataV2, ThreeDSecureDataV2$Outbound } from "./threedsecuredatav2.js"; import { TokenPaymentMethodCreate, TokenPaymentMethodCreate$Outbound } from "./tokenpaymentmethodcreate.js"; import { TransactionConnectionOptions, TransactionConnectionOptions$Outbound } from "./transactionconnectionoptions.js"; import { TransactionIntent } from "./transactionintent.js"; import { TransactionPaymentSource } from "./transactionpaymentsource.js"; /** * The optional payment method to use for this transaction. This field is required if no `gift_cards` have been added. */ export type TransactionCreatePaymentMethod = RedirectPaymentMethodCreate | ClickToPayPaymentMethodCreate | ClickToPayFPANPaymentMethodCreate | GooglePayFPANPaymentMethodCreate | NetworkTokenPaymentMethodCreate | CardWithUrlPaymentMethodCreate | ApplePayPaymentMethodCreate | GooglePayPaymentMethodCreate | PazePaymentMethodCreate | TokenPaymentMethodCreate | PlaidPaymentMethodCreate | BaseBankPaymentMethodCreate | CheckoutSessionWithUrlPaymentMethodCreate; export type TransactionCreateGiftCards = GiftCardTransactionCreate | GiftCardTokenTransactionCreate; /** * 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. */ export type ThreeDSecureData = ThreeDSecureDataV1 | ThreeDSecureDataV2; export type TransactionCreate = { /** * The monetary amount for this transaction, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. If the `intent` is set to `capture`, an amount greater than zero must be supplied. All gift card amounts are subtracted from this amount before the remainder is charged to the provided `payment_method`. */ amount: number; /** * A supported ISO 4217 currency code. For redirect requests, this value must match the one specified for `currency` in `payment_method`. */ currency: string; /** * 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. */ country?: string | null | undefined; /** * The optional payment method to use for this transaction. This field is required if no `gift_cards` have been added. */ paymentMethod?: RedirectPaymentMethodCreate | ClickToPayPaymentMethodCreate | ClickToPayFPANPaymentMethodCreate | GooglePayFPANPaymentMethodCreate | NetworkTokenPaymentMethodCreate | CardWithUrlPaymentMethodCreate | ApplePayPaymentMethodCreate | GooglePayPaymentMethodCreate | PazePaymentMethodCreate | TokenPaymentMethodCreate | PlaidPaymentMethodCreate | BaseBankPaymentMethodCreate | CheckoutSessionWithUrlPaymentMethodCreate | null | undefined; /** * 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. */ buyer?: GuestBuyer | null | undefined; /** * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field. */ buyerId?: string | null | undefined; /** * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field. */ buyerExternalIdentifier?: string | null | undefined; /** * 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. */ giftCards?: Array | null | undefined; /** * An external identifier that can be used to match the transaction against your own records. */ externalIdentifier?: string | null | undefined; intent?: TransactionIntent | undefined; /** * 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: * * @remarks * * * 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. */ store?: boolean | undefined; /** * 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. */ threeDSecureData?: ThreeDSecureDataV1 | ThreeDSecureDataV2 | null | undefined; /** * Optional 3-D Secure values to use during the authentication flow. */ threeDSecure?: ThreeDSecure | null | undefined; /** * 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. */ metadata?: { [k: string]: string; } | null | undefined; /** * 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. * * @remarks * * 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`. */ isSubsequentPayment?: boolean | undefined; /** * Indicates whether the transaction was initiated by the merchant (true) or customer (false). */ merchantInitiated?: boolean | undefined; /** * The way payment method information made it to this transaction. */ paymentSource?: TransactionPaymentSource | undefined; /** * The airline addendum data which describes the airline booking associated with this transaction. */ airline?: Airline | null | undefined; /** * An optional description for the transaction. Forwarded to the payment processor where supported. Unlike `statement_descriptor`, this field has no character limit and does not appear on the buyer's bank statement. */ description?: string | null | undefined; /** * An array of cart items that represents the line items of a transaction. */ cartItems?: Array | null | undefined; /** * Details about the payment and the merchant which may end up on the (bank) statement for the payment. */ statementDescriptor?: StatementDescriptor | null | undefined; /** * A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made with the stored payment method, then Gr4vy will populate this value with the identifier returned for that transaction. This field is also know as the Visa Transaction Identifier, or Mastercard Trace ID. */ previousSchemeTransactionId?: string | null | undefined; /** * A scheme's transaction link identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made with the stored payment method, then Gr4vy will populate this value with the identifier returned for that transaction. This field is also know as the Mastercard Transaction Link ID (TLID). */ previousTransactionLinkId?: string | null | undefined; /** * Information about the browser used by the buyer. This can be used by anti-fraud services. */ browserInfo?: BrowserInfo | null | undefined; /** * 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. */ shippingDetailsId?: string | null | undefined; /** * 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. */ connectionOptions?: TransactionConnectionOptions | null | undefined; /** * Whether to capture the transaction asynchronously when an authorization-capture split occurs. * * @remarks * * This flag is only used if the transaction flow is split between authorization and capture. * The split itself is not controlled by this flag and depends on other conditions, including delayed capture support, direct capture support, card scheme, gift cards, and anti-fraud decision. * * - When `async_capture` is `false` (default) and applicable, the capture is attempted in the same request. * - When `async_capture` is `true` and applicable, the capture is performed outside the context of this request. * * Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`. Please check the public documentation for full authorization-capture split behavior details. */ asyncCapture?: boolean | undefined; /** * This field represents the fingerprint data to be passed to the active anti-fraud service. */ antiFraudFingerprint?: string | null | undefined; /** * 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. */ paymentServiceId?: string | null | undefined; /** * Marks the transaction as an AFT. Requires the payment service to support this feature, and might `recipient` and `buyer` data */ accountFundingTransaction?: boolean | undefined; /** * Defines if the transaction will allow for a partial authorization. */ allowPartialAuthorization?: boolean | undefined; /** * The recipient of any account to account funding. For use with AFTs. */ recipient?: Recipient | null | undefined; /** * The number of installments a buyer is required to make. */ installmentCount?: number | null | undefined; /** * 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` */ taxAmount?: number | null | undefined; /** * Merchant tax ID (for example, EIN or VAT number). */ merchantTaxId?: string | null | undefined; /** * Invoice number or Purchase Order number. */ purchaseOrderNumber?: string | null | undefined; /** * Customer code or reference. */ customerReferenceNumber?: string | null | undefined; /** * Whether the tax is included in the amount. */ amountIncludesTax?: boolean | null | undefined; /** * The merchant's unique identifier for the sales order or invoice. */ supplierOrderNumber?: string | null | undefined; /** * Total charges for import/export duties. */ dutyAmount?: number | null | undefined; /** * Total shipping amount. */ shippingAmount?: number | null | undefined; /** * Defines the client where the session for this transaction is going to be used. Please refer to the connections documentation for more guidance. */ integrationClient?: IntegrationClient | null | undefined; /** * The date and time when the buyer's approval window for this transaction expires. If not provided, this is automatically computed from the connector's default expiration time. The value cannot exceed the connector's maximum approval window. */ approvalExpiresAt?: Date | null | undefined; }; /** @internal */ export type TransactionCreatePaymentMethod$Outbound = RedirectPaymentMethodCreate$Outbound | ClickToPayPaymentMethodCreate$Outbound | ClickToPayFPANPaymentMethodCreate$Outbound | GooglePayFPANPaymentMethodCreate$Outbound | NetworkTokenPaymentMethodCreate$Outbound | CardWithUrlPaymentMethodCreate$Outbound | ApplePayPaymentMethodCreate$Outbound | GooglePayPaymentMethodCreate$Outbound | PazePaymentMethodCreate$Outbound | TokenPaymentMethodCreate$Outbound | PlaidPaymentMethodCreate$Outbound | BaseBankPaymentMethodCreate$Outbound | CheckoutSessionWithUrlPaymentMethodCreate$Outbound; /** @internal */ export declare const TransactionCreatePaymentMethod$outboundSchema: z.ZodType; export declare function transactionCreatePaymentMethodToJSON(transactionCreatePaymentMethod: TransactionCreatePaymentMethod): string; /** @internal */ export type TransactionCreateGiftCards$Outbound = GiftCardTransactionCreate$Outbound | GiftCardTokenTransactionCreate$Outbound; /** @internal */ export declare const TransactionCreateGiftCards$outboundSchema: z.ZodType; export declare function transactionCreateGiftCardsToJSON(transactionCreateGiftCards: TransactionCreateGiftCards): string; /** @internal */ export type ThreeDSecureData$Outbound = ThreeDSecureDataV1$Outbound | ThreeDSecureDataV2$Outbound; /** @internal */ export declare const ThreeDSecureData$outboundSchema: z.ZodType; export declare function threeDSecureDataToJSON(threeDSecureData: ThreeDSecureData): string; /** @internal */ export type TransactionCreate$Outbound = { amount: number; currency: string; country?: string | null | undefined; payment_method?: RedirectPaymentMethodCreate$Outbound | ClickToPayPaymentMethodCreate$Outbound | ClickToPayFPANPaymentMethodCreate$Outbound | GooglePayFPANPaymentMethodCreate$Outbound | NetworkTokenPaymentMethodCreate$Outbound | CardWithUrlPaymentMethodCreate$Outbound | ApplePayPaymentMethodCreate$Outbound | GooglePayPaymentMethodCreate$Outbound | PazePaymentMethodCreate$Outbound | TokenPaymentMethodCreate$Outbound | PlaidPaymentMethodCreate$Outbound | BaseBankPaymentMethodCreate$Outbound | CheckoutSessionWithUrlPaymentMethodCreate$Outbound | null | undefined; buyer?: GuestBuyer$Outbound | null | undefined; buyer_id?: string | null | undefined; buyer_external_identifier?: string | null | undefined; gift_cards?: Array | null | undefined; external_identifier?: string | null | undefined; intent?: string | undefined; store: boolean; three_d_secure_data?: ThreeDSecureDataV1$Outbound | ThreeDSecureDataV2$Outbound | null | undefined; three_d_secure?: ThreeDSecure$Outbound | null | undefined; metadata?: { [k: string]: string; } | null | undefined; is_subsequent_payment: boolean; merchant_initiated: boolean; payment_source?: string | undefined; airline?: Airline$Outbound | null | undefined; description?: string | null | undefined; cart_items?: Array | null | undefined; statement_descriptor?: StatementDescriptor$Outbound | null | undefined; previous_scheme_transaction_id?: string | null | undefined; previous_transaction_link_id?: string | null | undefined; browser_info?: BrowserInfo$Outbound | null | undefined; shipping_details_id?: string | null | undefined; connection_options?: TransactionConnectionOptions$Outbound | null | undefined; async_capture: boolean; anti_fraud_fingerprint?: string | null | undefined; payment_service_id?: string | null | undefined; account_funding_transaction: boolean; allow_partial_authorization: boolean; recipient?: Recipient$Outbound | null | undefined; installment_count?: number | null | undefined; tax_amount?: number | null | undefined; merchant_tax_id?: string | null | undefined; purchase_order_number?: string | null | undefined; customer_reference_number?: string | null | undefined; amount_includes_tax?: boolean | null | undefined; supplier_order_number?: string | null | undefined; duty_amount?: number | null | undefined; shipping_amount?: number | null | undefined; integration_client?: string | null | undefined; approval_expires_at?: string | null | undefined; }; /** @internal */ export declare const TransactionCreate$outboundSchema: z.ZodType; export declare function transactionCreateToJSON(transactionCreate: TransactionCreate): string; //# sourceMappingURL=transactioncreate.d.ts.map