UNPKG

mangopay2-nodejs-sdk

Version:
1,676 lines (1,318 loc) 110 kB
import { CountryISO, CultureISO, CurrencyISO, PickPartialRequired, SecureMode, Timestamp, ValueOf } from "../types"; import { enums } from "../enums"; import { transaction } from "./transaction"; import { card } from "./card"; import { entityBase } from "./entityBase"; import { billing } from "./billing"; import { base } from "../base"; import { money } from "./money"; import { securityInfo } from "./securityInfo"; import { shipping } from "./shipping"; import { address } from "./address"; export namespace payIn { import BillingData = billing.BillingData; import BillingOrShippingRecurringPayInData = billing.BillingOrShippingRecurringPayInData; import BrowserInfoData = base.BrowserInfoData; import MoneyData = money.MoneyData; import SecurityInfoData = securityInfo.SecurityInfoData; import ShippingData = shipping.ShippingData; import CreateShipping = shipping.CreateShipping; import CreateBilling = billing.CreateBilling; import CardInfoData = card.CardInfoData; type _3DSVersion = "V1" | "V2_1"; type PayInData = | CardDirectPayInData | CardPreAuthorizedPayInData | CardWebPayInData | BankWireDirectPayInData | BankWireExternalInstructionPayInData | PayconiqWebPayInData | DirectDebitDirectPayInData | MbwayWebPayInData | BancontactWebPayInData | BizumWebPayInData | MultibancoWebPayInData | SatispayWebPayInData | BlikWebPayInData | ApplePayPayInData | GooglePayDirectPayInData | KlarnaWebPayInData | IdealWebPayInData | GiropayWebPayInData | SwishWebPayInData | PayByBankWebPayInData; type PayInPaymentType = ValueOf<enums.IPayInPaymentType>; type RecurringPayInRegistrationPaymentType = ValueOf<enums.IRecurringPayInRegistrationPaymentType>; type PayInExecutionType = ValueOf<enums.IPayInExecutionType> | "EXTERNAL_INSTRUCTION"; type RecurringType = "CLASSIC_SUBSCRIPTION" | "FRACTIONED_PAYMENT" | "CUSTOM"; type DirectDebitType = "SOFORT" | "GIROPAY"; type FrequencyType = "Daily" | "Weekly" | "TwiceAMonth" | "Monthly" | "Bimonthly" | "Quarterly" | "Semiannual" | "Annual" | "Biannual"; type RecurringPaymentStatus = "CREATED" | "AUTHENTICATION_NEEDED" | "IN_PROGRESS" | "ENDED"; type UpdateRecurringPaymentStatus = "ENDED"; type ShippingPreference = ValueOf<enums.IShippingPreference>; interface TemplateURLOptions { Payline: string; PAYLINEV2: string; } interface BasePayInData extends entityBase.EntityBaseData { /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) */ CreditedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The ID of the wallet that was debited */ DebitedWalletId: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * A user's ID */ AuthorId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId: string; /** * The nature of the transaction */ Nature: transaction.TransactionNature; /** * The status of the transaction */ Status: transaction.TransactionStatus; /** * When the transaction happened */ ExecutionDate: Timestamp; /** * The result code */ ResultCode: string; /** * A verbal explanation of the ResultCode */ ResultMessage: string; /** * The type of the transaction */ Type: transaction.TransactionType; /** * The type of payin */ PaymentType: PayInPaymentType; /** * The type of execution for the payin */ ExecutionType: PayInExecutionType; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CardWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "CARD"; /** * The URL to redirect to after payment (whether successful or not) */ ReturnURL: string; /** * The type of card */ CardType: card.CardType; /** * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). */ SecureMode: SecureMode; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture: CountryISO; /** * The URL to use for the payment page template */ TemplateURL: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * The URL to redirect to user to for them to proceed with the payment */ RedirectURL: string; /** * Name of the end-user’s bank */ BankName: string; } interface CardWebExtendedPayInData { /** * The unique identifier of the object. */ Id: string; /** * The type of payin */ PaymentType: PayInPaymentType; /** * The type of execution for the payin */ ExecutionType: PayInExecutionType; /** * Time in millis when the page consult will expire. */ ExpirationDate: Timestamp; /** * A partially obfuscated version of the credit card number */ Alias: string; /** * The type of card */ CardType: card.CardType; /** * The Country of the Card */ Country: CountryISO; /** * A unique representation of a 16-digits card number */ Fingerprint: string; } interface CreateCardWebPayIn { ExecutionType: "WEB"; PaymentType: "CARD"; /** * A user's ID */ AuthorId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId?: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The URL to redirect to after payment (whether successful or not) */ ReturnURL: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * The type of card */ CardType: card.CardType; /** * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects * there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). */ SecureMode?: SecureMode; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture: CountryISO; /** * A URL to an SSL page to allow you to customise the payment page. Must be in the format: array("PAYLINE"=>"https://...") and meet all the * specifications listed here. Note that only a template for Payline is currently available */ TemplateURLOptions?: TemplateURLOptions; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and * can only include alphanumeric characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Contains useful information related to the user billing */ Billing?: BillingData; /** * Contains every useful information's related to the user shipping */ Shipping?: ShippingData; /** * The BIC identifier of the end-user’s bank */ Bic?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CardDirectPayInData extends BasePayInData { ExecutionType: "DIRECT"; PaymentType: "CARD"; /** * This is the URL where users are automatically redirected after 3D secure validation (if activated) */ SecureModeReturnURL: string; /** * The ID of a card */ CardId: string; /** * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). */ SecureMode: SecureMode; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * Contains useful information related to the user billing */ Billing: BillingData; /** * Contains information related to security and fraud */ SecurityInfo: SecurityInfoData; /** * The value is 'true' if the SecureMode was used */ SecureModeNeeded: boolean; /** * This is the URL where to redirect users to proceed to 3D secure validation */ SecureModeRedirectURL: string; /** * Information about the card */ CardInfo: CardInfoData; /** * The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: * * ECommerce – Payment received online. * * TelephoneOrder – Payment received via mail order or telephone order (MOTO). */ PaymentCategory: string; } interface MbwayWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "MBWAY"; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * The mobile phone number of the user initiating the pay-in * Country code followed by hash symbol (#) followed by the rest of the number. Only digits and hash allowed */ Phone: string; } interface BancontactWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "BCMC"; /** * The URL to which the user is redirected to complete the payment */ RedirectURL: string; /** * The URL where users are automatically redirected after the payment is validated */ ReturnURL: string; /** * The URL where you should redirect your client in a mobile app experience */ DeepLinkURL: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture: CountryISO; /** * Whether the Bancontact pay-ins are being made to be re-used in a recurring payment flow */ Recurring: boolean; } interface BizumWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "BIZUM"; /** * The URL to which the user is redirected to complete the payment */ RedirectURL?: string; /** * The URL where users are automatically redirected after the payment is validated */ ReturnURL?: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Format: International E.164 standard (preceded by plus sign and country code, +34 in Spain); pattern: ^\+[1-9][\d]{4,14}$ * If the Phone parameter is sent, then RedirectURL is not returned and ReturnURL is ignored. */ Phone?: string; } interface PayPalWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "PAYPAL"; /** * The URL where users are automatically redirected after the payment is validated */ ReturnURL: string; /** * The URL to which the user is redirected to complete the payment */ RedirectURL: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * Information about the shipping address */ Shipping: ShippingData; /** * List of items and quantity bought by the buyer */ LineItems: LineItemData[]; /** * The language in which the PayPal payment page is to be displayed. */ Culture: CountryISO; ShippingPreference: ShippingPreference; Reference: string; PaypalPayerID: string; BuyerCountry: string; BuyerFirstname: string; BuyerLastname: string; BuyerPhone: string; PaypalOrderID: string; CancelURL: string; /** * The email address registered on the PayPal account used to make the payment. */ PaypalBuyerAccountEmail: string; /** * Shipping information of the LineItems added to the pay-in object. */ Trackings: PayPalWebTrackingData; } interface PayPalWebTrackingData { /** * The shipment’s tracking number provided by the carrier. */ TrackingNumber: string; /** * The carrier for the shipment. Use the country-specific version of the carrier if it exists, * otherwise use its global version. * * Returned values: One of the carriers supported by PayPal. */ Carrier: string; /** * If true, sends an email notification to the PaypalBuyerAccountEmail containing the TrackingNumber and Carrier, * which allows the end user to track their shipment with the carrier. * * Default value: false */ NotifyBuyer: boolean; } interface MultibancoWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "MULTIBANCO"; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; } interface SatispayWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "SATISPAY"; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * The end-user country of residence */ Country: CountryISO; } interface BlikWebPayInData extends BasePayInData { ExecutionType: "WEB"; PaymentType: "BLIK"; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor: string; /** * The 6-digit code from the user’s banking application. * Required when creating a Blik PayIn with code. */ Code: string; /** * The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. * Required when creating a Blik PayIn with code. */ IpAddress: string; /** * Information about the browser used by the end user (author) to perform the payment. * Required when creating a Blik PayIn with code. */ BrowserInfo: BrowserInfoData; } interface CreateCardDirectPayIn { ExecutionType: "DIRECT"; PaymentType: "CARD"; /** * A user's ID */ AuthorId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId?: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * This is the URL where users are automatically redirected after 3D secure validation (if activated) */ SecureModeReturnURL: string; /** * The ID of a card */ CardId: string; /** * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it automatically * with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). */ SecureMode?: SecureMode; /** * Contains useful information related to the user billing */ Billing?: BillingData; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture?: CountryISO; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * IP Address of the end user (format IPV4 or IPV6) */ IpAddress?: string; /** * This object describes the Browser being user by an end user */ BrowserInfo?: BrowserInfoData; /** * Contains every useful information's related to the user shipping */ Shipping?: ShippingData; /** * Custom data that you can add to this item */ Tag?: string; /** * The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: * * ECommerce – Payment received online. * * TelephoneOrder – Payment received via mail order or telephone order (MOTO). */ PaymentCategory?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CreateMbwayWebPayIn { ExecutionType: "WEB"; PaymentType: "MBWAY"; /** * A user's ID */ AuthorId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The mobile phone number of the user initiating the pay-in * Country code followed by hash symbol (#) followed by the rest of the number. Only digits and hash allowed */ Phone: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CreateBancontactWebPayIn { ExecutionType: "WEB"; PaymentType: "BCMC"; /** * A user's ID */ AuthorId: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The URL where users are automatically redirected after the payment is validated */ ReturnURL: string; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture?: CountryISO; /** * Whether the Bancontact pay-ins are being made to be re-used in a recurring payment flow */ Recurring?: boolean; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CreateBizumWebPayIn { ExecutionType: "WEB"; PaymentType: "BIZUM"; /** * A user's ID */ AuthorId: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * Format: International E.164 standard (preceded by plus sign and country code, +34 in Spain); pattern: ^\+[1-9][\d]{4,14}$ * If the Phone parameter is sent, then RedirectURL is not returned and ReturnURL is ignored. */ Phone?: string; /** * The URL where users are automatically redirected after the payment is validated */ ReturnURL?: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; /** * Custom data that you can add to this item */ Tag?: string; } interface CreatePayPalWebPayIn { ExecutionType: "WEB"; PaymentType: "PAYPAL"; /** * A user's ID */ AuthorId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the items bought by the customer */ LineItems: CreateLineItem[]; /** * This is the URL where users are automatically redirected after the payment is validated */ ReturnURL: string; /** * Contains every useful information's related to the user shipping */ Shipping?: CreateShipping; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The language in which the PayPal payment page is to be displayed. */ Culture?: CountryISO; ShippingPreference?: ShippingPreference; Reference?: string; CancelURL?: string; DataCollectionId?: string; } interface CreateMultibancoWebPayIn { ExecutionType: "WEB"; PaymentType: "MULTIBANCO"; /** * A user's ID */ AuthorId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The URL to redirect to after the payment, whether the transaction */ ReturnURL: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CreateSatispayWebPayIn { ExecutionType: "WEB"; PaymentType: "SATISPAY"; /** * A user's ID */ AuthorId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * The URL to redirect to after the payment, whether the transaction */ ReturnURL: string; /** * The end-user country of residence */ Country: CountryISO; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CreateBlikWebPayIn { ExecutionType: "WEB"; PaymentType: "BLIK"; /** * A user's ID */ AuthorId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * The URL to redirect to after the payment, whether the transaction */ ReturnURL: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. * See here for important info. Note that each bank handles this information differently, some show less or no information. */ StatementDescriptor?: string; /** * Custom data that you can add to this item */ Tag?: string; /** * The 6-digit code from the user’s banking application. * Required when creating a Blik PayIn with code. */ Code?: string; /** * The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. * Required when creating a Blik PayIn with code. */ IpAddress?: string; /** * Information about the browser used by the end user (author) to perform the payment. * Required when creating a Blik PayIn with code. */ BrowserInfo?: BrowserInfoData; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface LineItemData { /** * Item name */ Name: string; /** * Quantity of item bought */ Quantity: number; /** * The item cost */ UnitAmount: number; /** * The item tax */ TaxAmount: number; /** * A consistent and unique reference for the seller. It can be: * - The user ID created on MANGOPAY for the seller * - Or the firstname and lastname of the seller */ Description: string; /** * The category of the item, allowing line items of different types to be distinguished */ Category: string; /** * The unique identifier of the line item. */ Sku: string; } interface CreateLineItem { /** * Item name */ Name: string; /** * Quantity of item bought */ Quantity: number; /** * The item cost */ UnitAmount: number; /** * The item tax */ TaxAmount?: number; /** * A consistent and unique reference for the seller. It can be: * - The user ID created on MANGOPAY for the seller * - Or the firstname and lastname of the seller */ Description: string; /** * The category of the item, allowing line items of different types to be distinguished */ Category?: string; /** * The unique identifier of the line item. */ Sku?: string; } interface DirectDebitDirectPayInData extends BasePayInData { /** * The date the user will be charged. Note that for direct debit payments, it will take one more day more the payment becomes successful */ ChargeDate: Timestamp; /** * The ID of a Mandate */ MandateId: string; /** * A custom description to appear on the user's bank statement. * It can be up to 100 characters long, and can only include alphanumeric characters or spaces. * See here for important info and note that this functionality is only available for SEPA payments. */ StatementDescriptor: string; } interface CreateDirectDebitDirectPayIn { ExecutionType: "DIRECT"; PaymentType: "DIRECT_DEBIT"; AuthorId: string; CreditedUserId?: string; CreditedWalletId: string; DebitedFunds: MoneyData; Fees: MoneyData; MandateId: string; StatementDescriptor?: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface DirectDebitWebPayInData extends BasePayInData { /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture: CountryISO; /** * The type of web direct debit */ DirectDebitType: DirectDebitType; /** * The URL to redirect to after payment (whether successful or not) */ ReturnUrl: string; /** * The SecureMode is used to select a 3DS1 and 3DS2 protocol for CB Visa and MasterCard. * The field lets you ask for an Frictionless payment with the value "DEFAULT". * The value "NO_CHOICE" will allow you to make the transaction eligible for Frictionless, but the exemption will be applied by the other payment actors. * The value force "FORCE" will force customer authentification. */ SecureMode: SecureMode; /** * The URL to use for the payment page template */ TemplateURL: string; /** * The URL to redirect to user to for them to proceed with the payment */ ReturnURL: string; } interface CreateDirectDebitWebPayIn { ExecutionType: "WEB"; PaymentType: "DIRECT_DEBIT"; /** * A user's ID */ AuthorId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId?: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The URL to redirect to after payment (whether successful or not) */ ReturnURL: string; /** * The language to use for the payment page - needs to be the ISO code of the language */ Culture: CountryISO; /** * The type of web direct debit */ DirectDebitType: DirectDebitType; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface CardPreAuthorizedPayInData extends BasePayInData { PreauthorizationId: string; ExecutionType: "DIRECT"; PaymentType: "PREAUTHORIZED"; DepositId: string; } interface CreateCardPreAuthorizedPayIn { ExecutionType: "DIRECT"; PaymentType: "PREAUTHORIZED"; /** * Custom data that you can add to this item */ Tag?: string; /** * A user's ID */ AuthorId?: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId?: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Information about the funds that are being debited */ DebitedFunds: MoneyData; /** * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) */ Fees: MoneyData; /** * The ID of the Preauthorization object */ PreauthorizationId: string; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface BankAccountData { /** * The BIC of the bank account */ BIC: string; /** * The IBAN of the bank account */ IBAN: string; /** * The name of the owner of the bank account */ OwnerName: string; /** * The address of the owner of the bank account */ OwnerAddress: string; /** * The type of bank account */ Type: ValueOf<enums.IBankAccountType>; } interface BankWireDirectPayInData extends BasePayInData { ExecutionType: "DIRECT"; PaymentType: "BANK_WIRE"; /** * The declared debited funds */ DeclaredDebitedFunds: MoneyData; /** * The declared fees */ DeclaredFees: MoneyData; /** * Wire reference */ WireReference: string; /** * Bank account details */ BankAccount: BankAccountData; } interface BankWireExternalInstructionPayInData extends BasePayInData { ExecutionType: "EXTERNAL_INSTRUCTION"; PaymentType: "BANK_WIRE"; /** * The reference of the wire made to a banking alias */ WireReference: string; /** * The unique identifier of the banking alias */ BankingAliasId: string; /** * Debited bank account details */ DebitedBankAccount: BankAccountData; } interface CreateBankWireDirectPayIn extends PickPartialRequired<BankWireDirectPayInData, "Tag" | "CreditedUserId", "AuthorId" | "CreditedWalletId" | "DeclaredDebitedFunds" | "DeclaredFees"> { ExecutionType: "DIRECT"; PaymentType: "BANK_WIRE"; /** * The unique reference generated for the profiling session, * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data. */ ProfilingAttemptReference?: string; } interface PayInRecurringRegistrationState { PayinsLinked: number; CumulatedDebitedAmount: MoneyData; CumulatedFeesAmount: MoneyData; LastPayinId: number; } interface PayInRecurringRegistrationData extends entityBase.EntityBaseData { /** * The status of the transaction */ Status: RecurringPaymentStatus; CurrentState: PayInRecurringRegistrationState; RecurringType: RecurringType; TotalAmount: number; CycleNumber: number; /** * A user's ID */ AuthorId: string; /** * The ID of a card */ CardId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Contains every useful informations related to the user billing */ Billing: BillingOrShippingRecurringPayInData; /** * Contains every useful information's related to the user shipping */ Shipping: BillingOrShippingRecurringPayInData; /** * Date on which the recurring payments will end */ EndDate: Timestamp; /** * Frequency at which the recurring payments will be made */ Frequency: FrequencyType; /** * Indicates whether the payment amount is likely to change during the payment period */ FixedNextAmount: boolean; /** * Indicates whether this recurring payment is a payment in installments in N times */ FractionedPayment: boolean; FreeCycles?: number; /** * Amount of the first payment. This amount may be different from the NextTransactionDebitedFunds. */ FirstTransactionDebitedFunds: MoneyData; /** * Amount of the first payment fees. This amount may be different from the NextTransactionFees. */ FirstTransactionFees: MoneyData; /** * Amount of subsequent payments. If this field is empty and either FixedNextAmount or FractionedPayment are TRUE, * we will take the amount of the FirstTransactionDebitedFunds as the subsequent payment amount. */ NextTransactionDebitedFunds: MoneyData; /** * Amount of subsequent fees. If this field is empty and either FixedNextAmount or FractionedPayment are TRUE, * we will take the amount of the FirstTransactionFees as the subsequent fees. */ NextTransactionFees: MoneyData; /** * Indicates whether the object is being used to attempt registration of an existing recurring payment */ Migration: boolean; PaymentType: RecurringPayInRegistrationPaymentType; } interface CreatePayInRecurringRegistration { /** * A user's ID */ AuthorId: string; /** * The ID of a card */ CardId: string; /** * The user ID who is credited (defaults to the owner of the wallet) */ CreditedUserId?: string; /** * The ID of the wallet where money will be credited */ CreditedWalletId: string; /** * Amount of the first payment. This amount may be different from the NextTransactionDebitedFunds. */ FirstTransactionDebitedFunds: MoneyData; /** * Amount of the first payment fees. This amount may be different from the NextTransactionFees. */ FirstTransactionFees: MoneyData; /** * Contains every useful informations related to the user billing */ Billing?: BillingOrShippingRecurringPayInData; /** * Contains every useful information's related to the user shipping */ Shipping?: BillingOrShippingRecurringPayInData; /** * Date on which the recurring payments will end */ EndDate?: Timestamp; /** * Frequency at which the recurring payments will be made */ Frequency?: FrequencyType; /** * Indicates whether the payment amount is likely to change during the payment period */ FixedNextAmount?: boolean; /** * Indicates whether this recurring payment is a payment in installments in N times */ FractionedPayment?: boolean; /** * Indicates whether the object is being used to attempt registration of an existing recurring payment */ Migration?: boolean; /** * Amount of subsequent payments. If this field is empty and either FixedNextAmount or FractionedPayment are TRUE, * we will take the amount of the FirstTransactionDebitedFunds as the subsequent payment amount. */ NextTransactionDebitedFunds?: MoneyData; /** * Amount of subsequent fees. If this field is empty and either FixedNextAmount or FractionedPayment are TRUE, * we will take the amount of the FirstTransactionFees as the subsequent fees. */ NextTransactionFees?: MoneyData; FreeCycles?: number; PaymentType?: RecurringPayInRegistrationPaymentType } interface UpdatePayInRecurringRegistration { CardId?: string; Billing?: BillingOrShippingRecurringPayInData; Shipping?: BillingOrShippingRecurringPayInData; Status?: UpdateRecurringPaymentStatus; } interface RecurringPayInData extends BasePayInData { /** * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), * "FORCE" (if you wish to specifically force the secured mode). */ SecureMode: SecureMode; /**