### C# SDK Example for Viewing Client Wallet Source: https://docs.mangopay.com/api-reference/client-wallets/view-client-wallet This C# example shows how to get a client wallet using the MangoPay SDK. It sets up the API configuration and serializes the wallet response for pretty printing. ```csharp using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var viewWallet = await api.Clients.GetWalletAsync(FundsType.FEES, CurrencyIso.EUR, null); string prettyPrint = JsonConvert.SerializeObject(viewWallet, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` -------------------------------- ### View Wallet - C# SDK Source: https://docs.mangopay.com/api-reference/wallets/view-wallet This C# example demonstrates how to get wallet information using the Mangopay SDK. Configure the SDK with your credentials before execution. ```csharp using MangoPay.SDK; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var walletId = "wlt_m_01J2Y06CEN8J3K19KP0F7YJVNT"; var viewWallet = await api.Wallets.GetAsync(walletId); string prettyPrint = JsonConvert.SerializeObject(viewWallet, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` -------------------------------- ### Create Wallet with Node.js SDK Source: https://docs.mangopay.com/api-reference/wallets/create-wallet Shows how to create a wallet using the MangoPay NodeJS SDK. This example requires the SDK to be installed and configured with your client credentials. ```javascript const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key' }) let userId = '165863393' let wallet = { Owners: [userId], Currency: 'EUR', Description: 'Wallet in EUR', Tag: 'Created using Mangopay NodeJS SDK' } const createWallet = async (walletObject) => { return await mangopay.Wallets.create(wallet) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createWallet(wallet) ``` -------------------------------- ### Python SDK Example Source: https://docs.mangopay.com/api-reference/cards/list-cards-user Use the Python SDK to fetch and print all cards for a given natural user. Ensure you have the SDK installed and configured with your client ID and API key. ```python from pprint import pprint import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import NaturalUser natural_user = NaturalUser.get('211919260') cards = natural_user.cards.all() for card in cards: pprint(vars(card)) ``` -------------------------------- ### Java SDK Example Source: https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-card-deposit-preauthorization Example demonstrating how to create a card deposit preauthorization using the MangoPay Java SDK. ```APIDOC ## Create Card Deposit Preauthorization (Java) ### Description Initiates a preauthorization for a card deposit using the MangoPay Java SDK. ### Method POST (implied by `mangopay.getDepositApi().create()`) ### Endpoint (Not explicitly defined in the example, but typically related to deposits) ### Parameters #### Request Body - **authorId** (string) - Required - The ID of the user who is initiating the deposit. - **cardId** (string) - Required - The ID of the card to be used for the preauthorization. - **debitedFunds** (object) - Required - The amount and currency of the funds to be debited. - **currency** (enum) - Required - The ISO currency code (e.g., CurrencyIso.EUR). - **value** (long) - Required - The amount in the smallest currency unit (e.g., cents). - **secureModeReturnUrl** (string) - Required - The URL to redirect the user to after the secure mode process. - **culture** (enum) - Required - The culture code for the transaction (e.g., CultureCode.EN). - **ipAddress** (string) - Required - The IP address of the user. - **browserInfo** (object) - Optional - Information about the user's browser. - **userAgent** (string) - Required - The user agent string. - **javaEnabled** (boolean) - Required - Whether Java is enabled. - **language** (string) - Required - The user's preferred language. - **colorDepth** (integer) - Required - The color depth of the screen. - **screenHeight** (integer) - Required - The screen height in pixels. - **screenWidth** (integer) - Required - The screen width in pixels. - **timeZoneOffset** (string) - Required - The timezone offset from UTC. - **acceptHeader** (string) - Required - The Accept header from the browser. - **javascriptEnabled** (boolean) - Required - Whether JavaScript is enabled. ### Request Example ```java CreateDeposit deposit = new CreateDeposit(); deposit.setAuthorId("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"); deposit.setCardId("card_m_01HY0MA4E2WQ0NRYQJP8X8SXMB"); deposit.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); deposit.setSecureModeReturnUrl("https://docs.mangopay.com/please-ignore"); deposit.setCulture(CultureCode.EN); deposit.setIpAddress("192.158.1.38"); deposit.setBrowserInfo(new BrowserInfo()); deposit.getBrowserInfo().setAcceptHeader("text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8"); deposit.getBrowserInfo().setJavaEnabled(true); deposit.getBrowserInfo().setLanguage("EN"); deposit.getBrowserInfo().setColorDepth(4); deposit.getBrowserInfo().setScreenHeight(1800); deposit.getBrowserInfo().setScreenWidth(400); deposit.getBrowserInfo().setTimeZoneOffset("60"); deposit.getBrowserInfo().setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"); deposit.getBrowserInfo().setJavascriptEnabled(true); Deposit createDeposit = mangopay.getDepositApi().create(deposit, null); ``` ### Response #### Success Response (200) (Response structure not explicitly detailed, but would typically include transaction details) #### Response Example ```json { "Id": "deposit_m_01HY0MA4E2WQ0NRYQJP8X8SXMB", "CreationDate": 1678886400, "Tag": null, "AuthorId": "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT", "CreditedUserId": null, "DebitedFunds": { "Currency": "EUR", "Amount": 1000 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "Status": "SUCCEEDED", "Type": "CARD", "Nature": "REGULAR", "CardId": "card_m_01HY0MA4E2WQ0NRYQJP8X8SXMB", "SecureModeRedirectURL": "https://secure.mangopay.com/?...", "SecureModeNeeded": true, "StatementDescriptor": null, "Culture": "EN", "RedirectURL": null, "ReturnURL": "https://docs.mangopay.com/please-ignore", "PaymentType": "CARD", "CardType": "CB_VISA_MASTERCARD", "ExpirationDate": null, "CardExpirationDate": null, "CardPreauthorizationId": null, "BrowserInfo": { "IpAddress": "192.158.1.38", "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8", "Language": "EN", "ScreenHeight": 1800, "ScreenWidth": 400, "ColorDepth": 4, "JavaEnabled": true, "JavascriptEnabled": true, "TimeZoneOffset": "60" } } ``` ``` -------------------------------- ### Get IDV Session Status (Python) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Retrieve the status of an Identity Verification session using its ID. This example initializes the MangoPay client and makes a GET request for the specified session. Ensure the 'mangopay' library is installed. ```python import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import IdentityVerification identity_verification_id = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS' result = IdentityVerification.get(identity_verification_id) ``` -------------------------------- ### Get IDV Session Status (Ruby) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Retrieve the status of an Identity Verification session by its ID. This example configures the MangoPay client and includes a method to fetch the session details with error handling. Ensure the MangoPay gem is installed. ```ruby require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def get_identity_verification(identity_verification_id) begin response = MangoPay::IdentityVerification.get(identity_verification_id) puts response return response rescue MangoPay::ResponseError => error puts "Failed to get IdentityVerification: #{error.message}" puts "Error details: #{error.details}" return false end end identity_verification_id = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS' get_identity_verification(identity_verification_id) ``` -------------------------------- ### Python SDK Example Source: https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-card-deposit-preauthorization Example demonstrating how to create a card deposit preauthorization using the MangoPay Python SDK. ```APIDOC ## Create Card Deposit Preauthorization (Python) ### Description Initiates a preauthorization for a card deposit. ### Method POST (implied by `.save()` method on a resource object) ### Endpoint (Not explicitly defined in the example, but typically related to deposits) ### Parameters #### Request Body - **author_id** (string) - Required - The ID of the user who is initiating the deposit. - **debited_funds** (object) - Required - The amount and currency of the funds to be debited. - **amount** (integer) - Required - The amount in the smallest currency unit (e.g., cents). - **currency** (string) - Required - The ISO currency code (e.g., 'EUR'). - **card_id** (string) - Required - The ID of the card to be used for the preauthorization. - **secure_mode_return_url** (string) - Required - The URL to redirect the user to after the secure mode process. - **browser_info** (object) - Optional - Information about the user's browser. - **user_agent** (string) - Required - The user agent string. - **screen_width** (integer) - Required - The screen width in pixels. - **screen_height** (integer) - Required - The screen height in pixels. - **color_depth** (integer) - Required - The color depth of the screen. - **language** (string) - Required - The user's preferred language. - **accept_header** (string) - Required - The Accept header from the browser. - **timezone_offset** (string) - Required - The timezone offset from UTC. - **java_enabled** (boolean) - Required - Whether Java is enabled. - **javascript_enabled** (boolean) - Required - Whether JavaScript is enabled. - **ip_address** (string) - Required - The IP address of the user. - **tag** (string) - Optional - A custom tag for the transaction. ### Request Example ```python { "author_id": "213753890", "debited_funds": { "amount": 3000, "currency": "EUR" }, "card_id": "213944219", "secure_mode_return_url": "https://docs.mangopay.com/please-ignore", "browser_info": { "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "screen_width": 375, "screen_height": 667, "color_depth": 32, "language": "EN", "accept_header": "application/json,text/javascript,*/*;q=0.01<", "timezone_offset": "-120", "java_enabled": true, "javascript_enabled": true }, "ip_address": "159.180.248.187", "tag": "Created using the Mangopay Python SDK" } ``` ### Response #### Success Response (200) (Response structure not explicitly detailed, but would typically include transaction details) #### Response Example (Not provided in the source) ``` -------------------------------- ### Python SDK Example Source: https://docs.mangopay.com/api-reference/direct-card-payins/create-direct-card-payin Demonstrates creating a direct card pay-in using the MangoPay Python SDK. It shows how to instantiate a DirectPayIn object with all required details and save it. ```APIDOC ## Create Direct Card PayIn - Python SDK ### Description This example shows how to create a direct card pay-in using the MangoPay Python SDK. It involves instantiating the `DirectPayIn` object with user, fund, fee, wallet, card, security, browser, and IP address details, then saving it. ### Method POST (Implicitly via SDK method `save()`) ### Endpoint (Not explicitly defined in SDK usage, but corresponds to the PayIns API endpoint) ### Parameters (as attributes of `DirectPayIn` object) - **author** (User object) - The user initiating the pay-in. - **debited_funds** (Money object) - The amount and currency to be debited from the card. - **fees** (Money object) - The fees associated with the transaction. - **credited_wallet_id** (string) - The ID of the wallet where funds will be credited. - **card_id** (Card object) - The card to be used for the pay-in. - **secure_mode** (string) - The mode for secure processing (e.g., 'DEFAULT'). - **secure_mode_return_url** (string) - The URL to redirect to after secure mode processing. - **tag** (string) - Optional metadata for the transaction. - **browser_info** (BrowserInfo object) - Information about the user's browser. - **ip_address** (string) - The IP address of the user. ### Request Example ```python from mangopay.resources import NaturalUser, LegalUser, Wallet, Card, DirectPayIn from mangopay.utils import Money, BrowserInfo # Assuming legal_user, legal_user_wallet, natural_user, natural_user_card are already fetched direct_payin = DirectPayIn( author = natural_user, debited_funds = Money(amount=1000, currency='EUR'), fees = Money(amount=1, currency='EUR'), credited_wallet_id = legal_user_wallet.id, card_id = natural_user_card, secure_mode = 'DEFAULT', secure_mode_return_url = "https://docs.mangopay.com/please-ignore", tag = 'Created with Mangopay Python SDK', browser_info = BrowserInfo( user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', screen_width = 375, screen_height = 667, color_depth = 32, language = 'EN', accept_header = 'application/json,text/javascript,*/*;q=0.01<', timezone_offset = '-120', java_enabled = True, javascript_enabled = True ), ip_address = '159.180.248.187', ) create_direct_payin = direct_payin.save() ``` ### Response (The `pprint(create_direct_payin)` output would show the created PayIn object details.) ``` -------------------------------- ### Get IDV Session Status (Node.js) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Retrieve an Identity Verification session's status using its ID. This example demonstrates asynchronous retrieval and includes basic error handling. Ensure the SDK is installed and configured with your client ID and API key. ```javascript const mangopayInstance = require('mangopay4-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }); const identityVerificationId = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS'; const getIdentityVerification = async (identityVerificationId) => { return await mangopay.IdentityVerifications.get(identityVerificationId) .then((response) => { console.info(response); return response; }) .catch((err) => { console.log(err); return false; }); }; getIdentityVerification(identityVerificationId); ``` -------------------------------- ### Java SDK Example Source: https://docs.mangopay.com/api-reference/bank-accounts/create-other-bank-account Shows how to create an 'OTHER' bank account for a user using the MangoPay Java SDK. ```APIDOC ## Create Other Bank Account ### Description This operation allows you to create an 'OTHER' type bank account for a user. ### Method POST ### Endpoint /v2.01/{Payline}/users/{userId}/bankaccounts ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user for whom to create the bank account. #### Request Body - **Type** (string) - Required - Must be set to 'OTHER'. - **OwnerName** (string) - Required - The name of the account owner. - **OwnerAddress** (object) - Required - The address of the account owner. - **AddressLine1** (string) - Required - **AddressLine2** (string) - Optional - **City** (string) - Required - **Region** (string) - Required - **PostalCode** (string) - Required - **Country** (string) - Required (ISO 3166-1 alpha-2 format) - **AccountNumber** (string) - Required - The bank account number. - **BIC** (string) - Required - The Bank Identifier Code (SWIFT code). - **Country** (string) - Required - The country of the bank account (ISO 3166-1 alpha-2 format). - **Tag** (string) - Optional - A custom tag associated with the bank account. ### Request Example ```json { "OwnerName": "John Doe", "Details": { "AccountNumber": "11696419", "Bic": "BNPAFRPP", "Country": "FR" }, "OwnerAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "FR", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "Type": "OTHER", "Tag": "Created using the Mangopay Java SDK" } ``` ### Response #### Success Response (200) - **OwnerAddress** (object) - The owner's address. - **AccountNumber** (string) - The bank account number. - **BIC** (string) - The Bank Identifier Code. - **Country** (string) - The country of the bank account. - **UserId** (string) - The ID of the user associated with this bank account. - **OwnerName** (string) - The name of the account owner. - **Type** (string) - The type of the bank account ('OTHER'). - **Id** (string) - The unique identifier of the bank account. - **Tag** (string) - The custom tag. - **CreationDate** (integer) - The creation timestamp. - **Active** (boolean) - Indicates if the bank account is active. #### Response Example ```json { "OwnerAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "FR", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "AccountNumber": "11696419", "BIC": "BNPAFRPP", "Country": "FR", "UserId": "user_m_01J29D5XMKKNPX72AR5HRV804X", "OwnerName": "John Doe", "Type": "OTHER", "Id": "bankaccount_id_12345", "Tag": "Created using the Mangopay Java SDK", "CreationDate": 1678886400, "Active": true } ``` ``` -------------------------------- ### Get Identity Verification (Ruby) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Example of how to get an Identity Verification object using the Ruby SDK. ```APIDOC ## Get Identity Verification ### Description Retrieves the details of an Identity Verification. ### Method GET ### Endpoint /v2.01/{Id}/identityverifications/{identityVerificationId} ### Parameters #### Path Parameters - **identityVerificationId** (string) - Required - The ID of the Identity Verification to retrieve. ### Request Example ```ruby identity_verification_id = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS' response = MangoPay::IdentityVerification.get(identity_verification_id) ``` ``` -------------------------------- ### Ruby SDK Example for Viewing Client Wallet Source: https://docs.mangopay.com/api-reference/client-wallets/view-client-wallet This Ruby example shows how to fetch a client wallet using the MangoPay gem. It configures the client and includes a method for fetching wallet details with error handling. ```ruby require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def viewClientWallet(fundsType, currency) begin response = MangoPay::Client.fetch_wallet(fundsType, currency) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch client wallets: #{error.message}" puts "Error details: #{error.details}" return false end end myClientWallet = { FundsType: 'FEES', Currency: 'EUR' } viewClientWallet(myClientWallet[:FundsType], myClientWallet[:Currency]) ``` -------------------------------- ### Get Identity Verification (Python) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Example of how to get an Identity Verification object using the Python SDK. ```APIDOC ## Get Identity Verification ### Description Retrieves the details of an Identity Verification. ### Method GET ### Endpoint /v2.01/{Id}/identityverifications/{identityVerificationId} ### Parameters #### Path Parameters - **identityVerificationId** (string) - Required - The ID of the Identity Verification to retrieve. ### Request Example ```python from mangopay.resources import IdentityVerification identity_verification_id = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS' result = IdentityVerification.get(identity_verification_id) ``` ``` -------------------------------- ### Get Identity Verification (PHP) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Example of how to get an Identity Verification object using the PHP SDK. ```APIDOC ## Get Identity Verification ### Description Retrieves the details of an Identity Verification. ### Method GET ### Endpoint /v2.01/{Id}/identityverifications/{identityVerificationId} ### Parameters #### Path Parameters - **identityVerificationId** (string) - Required - The ID of the Identity Verification to retrieve. ### Request Example ```php $identityVerificationId = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS'; $response = $api->IdentityVerifications->Get($identityVerificationId); ``` ``` -------------------------------- ### Python SDK Example Source: https://docs.mangopay.com/api-reference/bank-accounts/create-other-bank-account Demonstrates how to create an 'OTHER' bank account for a natural user using the MangoPay Python SDK. ```APIDOC ## Create Other Bank Account ### Description This operation allows you to create an 'OTHER' type bank account for a user. ### Method POST ### Endpoint /v2.01/{Payline}/users/{userId}/bankaccounts ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user for whom to create the bank account. #### Request Body - **Type** (string) - Required - Must be set to 'OTHER'. - **OwnerName** (string) - Required - The name of the account owner. - **OwnerAddress** (object) - Required - The address of the account owner. - **AddressLine1** (string) - Required - **AddressLine2** (string) - Optional - **City** (string) - Required - **Region** (string) - Required - **PostalCode** (string) - Required - **Country** (string) - Required (ISO 3166-1 alpha-2 format) - **AccountNumber** (string) - Required - The bank account number. - **BIC** (string) - Required - The Bank Identifier Code (SWIFT code). - **Country** (string) - Required - The country of the bank account (ISO 3166-1 alpha-2 format). - **Tag** (string) - Optional - A custom tag associated with the bank account. ### Request Example ```json { "Type": "OTHER", "OwnerName": "Joe Blogs", "OwnerAddress": { "AddressLine1": "The Oasis", "AddressLine2": "Rue des plantes", "City": "Paris", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "AccountNumber": "11696419", "BIC": "BNPAFRPP", "Country": "FR", "Tag": "Created using the Mangopay Python SDK" } ``` ### Response #### Success Response (200) - **OwnerAddress** (object) - The owner's address. - **AccountNumber** (string) - The bank account number. - **BIC** (string) - The Bank Identifier Code. - **Country** (string) - The country of the bank account. - **UserId** (string) - The ID of the user associated with this bank account. - **OwnerName** (string) - The name of the account owner. - **Type** (string) - The type of the bank account ('OTHER'). - **Id** (string) - The unique identifier of the bank account. - **Tag** (string) - The custom tag. - **CreationDate** (integer) - The creation timestamp. - **Active** (boolean) - Indicates if the bank account is active. #### Response Example ```json { "OwnerAddress": { "AddressLine1": "The Oasis", "AddressLine2": "Rue des plantes", "City": "Paris", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "AccountNumber": "11696419", "BIC": "BNPAFRPP", "Country": "FR", "UserId": "142036728", "OwnerName": "Joe Blogs", "Type": "OTHER", "Id": "150298347", "Tag": null, "CreationDate": 1661866304, "Active": true } ``` ``` -------------------------------- ### PHP SDK Example Source: https://docs.mangopay.com/api-reference/preauthorizations/create-preauthorization Example of creating a preauthorization using the MangoPay PHP SDK. ```APIDOC ## Create Preauthorization (PHP SDK) ### Description This snippet demonstrates how to create a card preauthorization using the MangoPay PHP SDK. ### Method POST ### Endpoint /v2.01/{Payline}/preauthorizations ### Parameters #### Request Body - **AuthorId** (string) - Required - The ID of the user who is creating the preauthorization. - **DebitedFunds** (object) - Required - The amount to be debited. - **Currency** (string) - Required - The currency of the amount (e.g., 'EUR'). - **Amount** (integer) - Required - The amount in the smallest currency unit (e.g., cents). - **SecureMode** (string) - Required - The secure mode to use ('DEFAULT', 'FORCE', 'NO'). - **CardId** (string) - Required - The ID of the card to preauthorize. - **SecureModeReturnURL** (string) - Required - The URL to redirect the user to after secure mode. - **Tag** (string) - Optional - A custom tag for the preauthorization. - **StatementDescriptor** (string) - Optional - The statement descriptor for the transaction. - **BrowserInfo** (object) - Optional - Information about the user's browser. - **AcceptHeader** (string) - Optional. - **JavaEnabled** (boolean) - Optional. - **Language** (string) - Optional. - **ColorDepth** (integer) - Optional. - **ScreenHeight** (integer) - Optional. - **ScreenWidth** (integer) - Optional. - **TimeZoneOffset** (integer) - Optional. - **UserAgent** (string) - Optional. - **JavascriptEnabled** (boolean) - Optional. - **Culture** (string) - Optional - The culture code for the transaction (e.g., 'EN'). - **IpAddress** (string) - Optional - The IP address of the user. - **Address** (object) - Optional - The billing or shipping address. - **AddressLine1** (string) - Required. - **City** (string) - Required. - **Country** (string) - Required. - **PostalCode** (string) - Required. - **Region** (string) - Optional. ### Request Example ```php $cardPreauthorization = new MangoPay\CardPreAuthorization(); $cardPreauthorization->AuthorId = 'user_m_01HSDQD2RPPQ8NMM36EDGYBMEY'; $cardPreauthorization->DebitedFunds = new MangoPay\Money(); $cardPreauthorization->DebitedFunds->Currency = 'EUR'; $cardPreauthorization->DebitedFunds->Amount = 1000; $cardPreauthorization->SecureMode = 'DEFAULT'; $cardPreauthorization->CardId = 'card_m_01HW8BJ2MS5PBV5EB1ZQG5E8T9'; $cardPreauthorization->SecureModeReturnURL = 'https://docs.mangopay.com/please-ignore'; $cardPreauthorization->Tag = 'Created using Mangopay PHP SDK'; $cardPreauthorization->StatementDescriptor = 'Mangopay'; $cardPreauthorization->BrowserInfo = new MangoPay\BrowserInfo(); $cardPreauthorization->BrowserInfo->AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8";; $cardPreauthorization->BrowserInfo->JavaEnabled = true; $cardPreauthorization->BrowserInfo->Language = "FR-FR"; $cardPreauthorization->BrowserInfo->ColorDepth = 4; $cardPreauthorization->BrowserInfo->ScreenHeight = 1800; $cardPreauthorization->BrowserInfo->ScreenWidth = 400; $cardPreauthorization->BrowserInfo->TimeZoneOffset = 60; $cardPreauthorization->BrowserInfo->UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"; $cardPreauthorization->BrowserInfo->JavascriptEnabled = true; $cardPreauthorization->Culture = 'EN'; $cardPreauthorization->IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C"; $address = new MangoPay\Address(); $address->AddressLine1 = '4 rue des Plantes'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75009'; $address->Region = 'IDF'; $shipping = new MangoPay\Shipping(); $shipping->FirstName = 'Alex'; $shipping->LastName = 'Smith'; $shipping->Address = $address; $billing = new MangoPay\Billing(); $billing->FirstName = 'Alex'; $billing->LastName = 'Smith'; $billing->Address = $address; $response = $api->CardPreAuthorizations->Create($cardPreauthorization); ``` ### Response #### Success Response (200) - **Status** (string) - The status of the preauthorization. - **Id** (string) - The unique identifier of the preauthorization. - **Type** (string) - The type of preauthorization (e.g., 'CARD'). - **Nature** (string) - The nature of the transaction (e.g., 'REGULAR'). - **AuthorId** (string) - The ID of the user who created the preauthorization. - **CreditedWalletId** (string) - The ID of the wallet that will be credited. - **DebitedFunds** (object) - The amount debited. - **Currency** (string) - The currency of the amount. - **Amount** (integer) - The amount in the smallest currency unit. - **Fees** (object) - The fees applied. - **Currency** (string) - The currency of the fees. - **Amount** (integer) - The amount of the fees in the smallest currency unit. - **CardId** (string) - The ID of the card used for the preauthorization. - **CardType** (string) - The type of card used. - **SecureMode** (string) - The secure mode used. - **SecureModeRedirectURL** (string) - The URL for secure mode redirection. - **SecureModeNeeded** (boolean) - Indicates if secure mode was needed. - **StatementDescriptor** (string) - The statement descriptor. - **OriginalPreauthorizationId** (string) - The ID of the original preauthorization (if applicable). - **ResponseCode** (string) - The response code from the card network. - **Country** (string) - The country of the transaction. - **CreationDate** (integer) - The creation date as a Unix timestamp. - **Tag** (string) - The custom tag. - **BrowserInfo** (object) - Information about the user's browser. - **Billing** (object) - Billing address details. - **Shipping** (object) - Shipping address details. - **Culture** (string) - The culture code. - **IpAddress** (string) - The IP address of the user. - **ExecutionType** (string) - The execution type of the preauthorization. #### Response Example ```json { "Status": "SUCCEEDED", "Id": "123456789", "Type": "CARD", "Nature": "REGULAR", "AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY", "CreditedWalletId": "12345678", "DebitedFunds": { "Currency": "EUR", "Amount": 1000 }, "Fees": { "Currency": "EUR", "Amount": 100 }, "CardId": "card_m_01HW8BJ2MS5PBV5EB1ZQG5E8T9", "CardType": "CB_VISA_MASTERCARD", "SecureMode": "DEFAULT", "SecureModeRedirectURL": "https://secure.mangopay.com/...". "SecureModeNeeded": true, "StatementDescriptor": "Mangopay", "OriginalPreauthorizationId": null, "ResponseCode": "00", "Country": "FR", "CreationDate": 1678886400, "Tag": "Created using Mangopay PHP SDK", "BrowserInfo": { "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8", "JavaEnabled": true, "Language": "FR-FR", "ColorDepth": 4, "ScreenHeight": 1800, "ScreenWidth": 400, "TimeZoneOffset": 60, "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "JavascriptEnabled": true }, "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "4 rue des Plantes", "City": "Paris", "Country": "FR", "PostalCode": "75009", "Region": "IDF" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "4 rue des Plantes", "City": "Paris", "Country": "FR", "PostalCode": "75009", "Region": "IDF" } }, "Culture": "EN", "IpAddress": "2001:0620:0000:0000:0211:24FF:FE80:C12C", "ExecutionType": "DIRECT" } ``` ``` -------------------------------- ### Get Identity Verification (JavaScript) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Example of how to get an Identity Verification object using the JavaScript SDK. ```APIDOC ## Get Identity Verification ### Description Retrieves the details of an Identity Verification. ### Method GET ### Endpoint /v2.01/{Id}/identityverifications/{identityVerificationId} ### Parameters #### Path Parameters - **identityVerificationId** (string) - Required - The ID of the Identity Verification to retrieve. ### Request Example ```javascript const identityVerificationId = 'idnver_01KMD8R2W6XP8NYQBRTPGFFJGS'; const getIdentityVerification = async (identityVerificationId) => { return await mangopay.IdentityVerifications.get(identityVerificationId); }; getIdentityVerification(identityVerificationId); ``` ``` -------------------------------- ### C# Example for Direct Card Payin Source: https://docs.mangopay.com/api-reference/direct-card-payins/create-direct-card-payin This C# example demonstrates how to create a direct card payin using the MangoPay SDK. It includes setting up the API client, defining payin details such as user, wallet, card, amounts, and browser/billing/shipping information, and then executing the payin. ```APIDOC ## Create Direct Card Payin (C#) ### Description Initiates a direct card payment transaction using the MangoPay C# SDK. ### Method `api.PayIns.CreateCardDirectAsync(PayInCardDirectPostDTO payIn)` ### Parameters #### Request Body (`PayInCardDirectPostDTO`) - **AuthorId** (string) - Required - The ID of the user initiating the payin. - **CreditedWalletId** (string) - Required - The ID of the wallet to be credited. - **DebitedFunds** (Money) - Required - The amount and currency to be debited. - **Fees** (Money) - Required - The fees to be applied. - **PaymentType** (string) - Required - Must be 'CARD'. - **CardId** (string) - Required - The ID of the card to be used for the payment. - **CardType** (CardType) - Optional - The type of the card (e.g., CB_VISA_MASTERCARD). - **IpAddress** (string) - Optional - The IP address of the user. - **Requested3DSVersion** (string) - Optional - The requested version of 3D Secure. - **BrowserInfo** (BrowserInfo) - Optional - Information about the user's browser. - **Billing** (Billing) - Optional - Billing address details. - **Shipping** (Shipping) - Optional - Shipping address details. ### Request Example ```csharp var directCardPayin = new PayInCardDirectPostDTO("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN", "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN", new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, "wlt_m_01J30991BXBB7VF28PBS82EWD3", "http://www.mangopay.com/docs/please-ignore", "card_m_01J3049JBA2XPA7GC7GEFJRQG4") { CardType = CardType.CB_VISA_MASTERCARD, IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C", Requested3DSVersion = "V2_1", BrowserInfo = new BrowserInfo { AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8", JavaEnabled = true, Language = "FR-FR", ColorDepth = 4, ScreenHeight = 1800, ScreenWidth = 400, JavascriptEnabled = true, TimeZoneOffset = "+60", UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" }, Billing = new Billing { Address = new Address { City = "Paris", AddressLine1 = "17 Rue de la République", Country = CountryIso.FR, PostalCode = "65400" }, FirstName = "Joe", LastName = "Doe" }, Shipping = new Shipping { Address = new Address { City = "Paris", AddressLine1 = "17 Rue de la République", Country = CountryIso.FR, PostalCode = "65400" }, FirstName = "Joe", LastName = "Doe" } }; var createDirectCardPayIn = await api.PayIns.CreateCardDirectAsync(directCardPayin); ``` ### Response #### Success Response (200) Returns a `PayIn` object representing the created direct card payin. ``` -------------------------------- ### Get Identity Verification (C#) Source: https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session Example of how to get an Identity Verification object using the C# SDK. ```APIDOC ## Get Identity Verification ### Description Retrieves the details of an Identity Verification. ### Method GET ### Endpoint /v2.01/{Id}/identityverifications/{identityVerificationId} ### Parameters #### Path Parameters - **identityVerificationId** (string) - Required - The ID of the Identity Verification to retrieve. ### Request Example ```csharp var identityVerificationId = "idnver_01KMD8R2W6XP8NYQBRTPGFFJGS"; var result = await api.IdentityVerifications.GetAsync(identityVerificationId); ``` ```