{"id":31589414,"url":"https://github.com/martinsoliz9/mangopay-node","last_synced_at":"2025-10-06T02:52:39.944Z","repository":{"id":309976977,"uuid":"1020524492","full_name":"martinsoliz9/mangopay-node","owner":"martinsoliz9","description":"Node.js SDK for Mangopay","archived":false,"fork":false,"pushed_at":"2025-07-21T12:20:43.000Z","size":1485,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T23:57:03.510Z","etag":null,"topics":["api","fintech","js","mangopay","payments","wallets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martinsoliz9.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T02:32:09.000Z","updated_at":"2025-07-21T12:22:12.000Z","dependencies_parsed_at":"2025-08-14T23:57:05.211Z","dependency_job_id":"dbd1994e-7559-43c8-aa98-951fc6a656a7","html_url":"https://github.com/martinsoliz9/mangopay-node","commit_stats":null,"previous_names":["martinsoliz9/mangopay-node"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/martinsoliz9/mangopay-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinsoliz9%2Fmangopay-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinsoliz9%2Fmangopay-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinsoliz9%2Fmangopay-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinsoliz9%2Fmangopay-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinsoliz9","download_url":"https://codeload.github.com/martinsoliz9/mangopay-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinsoliz9%2Fmangopay-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278551493,"owners_count":26005388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","fintech","js","mangopay","payments","wallets"],"created_at":"2025-10-06T02:52:38.774Z","updated_at":"2025-10-06T02:52:39.937Z","avatar_url":"https://github.com/martinsoliz9.png","language":"JavaScript","readme":"Mangopay Node.js SDK [![Build Status](https://travis-ci.org/Mangopay/mangopay2-nodejs-sdk.svg?branch=master)](https://travis-ci.org/Mangopay/mangopay2-nodejs-sdk)\n=================================================\nMangopaySDK is a Node.js client library to work with [Mangopay REST API](http://docs.mangopay.com/api-references/).\n\n\nInstallation\n-------------------------------------------------\nInstall the module via npm\n\n    npm install mangopay2-nodejs-sdk --save\n\nUsage inside your app\n\n    var mangopay = require('mangopay2-nodejs-sdk');\n\n    var api = new mangopay({\n        clientId: 'your_client_id',\n        clientApiKey: 'your_client_api_key',\n        // Set the right production API url. If testing, omit the property since it defaults to sandbox URL\n        baseUrl: 'https://api.mangopay.com'\n    });\n\n    api.Users.create(...)\n\nSupported options\n-------------------------------------------------\n| Option    | Default value | Description |\n| --------  | -----------   | ----------- |\n|clientId   |null      | API Client Id|\n|clientApiKey|null| API Client Api Key|\n|baseUrl|\"https://api.sandbox.mangopay.com\"| API Base URL. The default value points to sandbox. Production is 'https://api.mangopay.com'|\n|debugMode|false| Active debugging|\n|logClass|```function() {console.log(arguments)}```|Log function to be used for debug|\n|connectionTimeout|30000|Set the connection timeout limit (in milliseconds)|\n|responseTimeout|80000|Set the response timeout limit (in milliseconds)|\n|apiVersion|'v2.01'|API Version|\n|errorHandler|```function(options, err) {console.error(options, err)}```|Set a custom error handler\n\nDocumentation\n-------------------------------------------------\n[Github Full Node.js SDK Documentation](docs/README.md) is located in ``/docs`` folder.\nYou can also access [API References on our website](https://docs.mangopay.com/endpoints/).\n\nLicense\n-------------------------------------------------\nMangopaySDK is distributed under MIT license, see the [LICENSE file](LICENSE).\n\nContacts\n-------------------------------------------------\nReport bugs or suggest features using\n[issue tracker on GitHub](https://github.com/Mangopay/mangopay2-nodejs-sdk/issues).\n\nAccount creation\n-------------------------------------------------\nYou can get yourself a free sandbox account or sign up for a production account by [registering on the Mangopay site](https://www.mangopay.com/start/) (note that validation of your production account involves several steps, so think about doing it in advance of when you actually want to go live).\n\n\n### Creating a user\n\n#### Using a hash of properties:\n```ts\n    mangopay.Users.create({\n        \"FirstName\": \"Victor\",\n        \"LastName\": \"Hugo\",\n        \"Address\": \"1 rue des Misérables, Paris\",\n        \"Birthday\": 1300186358,\n        \"Nationality\": \"FR\",\n        \"CountryOfResidence\": \"FR\",\n        \"Occupation\": \"Writer\",\n        \"IncomeRange\": \"6\",\n        \"ProofOfIdentity\": null,\n        \"ProofOfAddress\": null,\n        \"PersonType\": \"NATURAL\",\n        \"Email\": \"victor@hugo.com\",\n        \"Tag\": \"custom tag\",\n    }, function(model) {\n        // User created - using callback\n    }).then(function(model){\n        // User created - using promise\n    });\n```\n\n#### Using Mangopay SDK pre-defined models:\n```ts\n    var myUser = new api.models.UserLegal({\n        Name: 'MangoPay',\n        Email: 'info@mangopay.com',\n        LegalPersonType: 'BUSINESS',\n        LegalRepresentativeFirstName: 'Mango',\n        LegalRepresentativeLastName: 'Pay',\n        LegalRepresentativeEmail: 'mango@mangopay.com',\n        HeadquartersAddress: new api.models.Address({\n            AddressLine1: \"4101 Reservoir Rd NW\",\n            AddressLine2: \"\",\n            City: \"Washington\",\n            Region: \"District of Columbia\",\n            PostalCode: \"20007\",\n            Country: \"US\"\n        }),\n        LegalRepresentativeBirthday: 1300186358,\n        LegalRepresentativeNationality: 'FR',\n        LegalRepresentativeCountryOfResidence: 'FR',\n        CompanyNumber: 123456789,\n        Tag: 'custom tag'\n    });\n\n    api.Users.create(myUser).then(function(){\n        // Output the created user data to console\n        console.log(myUser.Name + ' user created at ' + myUser.CreationDate);\n    });\n```\n\n#### Promise vs Callback\nMangopay Node.js SDK supports both callback and promise approach.\nHere is how they can be implemented :\n\n```ts\n    api.Service.method(... , function(data, response, err){\n        // Callback method\n    })\n\n    api.Service.method(...).then(function(data) {\n        // Promise function called\n    }, function(error) {\n        //exception\n    })\n```\n\n### Pagination / Filtering\nIn order to [paginate or filter](https://docs.mangopay.com/guide/lists-pagination-management) results,\nwe can use ``options.parameters`` to specify these options:\n```ts\n    api.Transactions.getAll({\n        parameters: {\n            // Pagination\n            per_page: 2,\n            page: 2,\n\n            // Filters\n            BeforeDate: 1414000367,\n            AfterDate: 1414000367,\n            Nature: REGULAR,\n            Status: FAILED,\n            Type: TRANSFER\n        }\n    }\n```\n\n### Reading server response headers\nFor [reading the server response headers](examples/readResponseHeaders.js) we can use ``options.resolveWithFullResponse: true``\n```ts\n    api.Users.getAll(null, {\n      parameters: {\n        per_page: 1\n      },\n      resolveWithFullResponse: true\n    }).then(function(response){\n      // Read pages count\n      console.log(response.headers['x-number-of-pages']);\n\n      // Read response body\n      console.log(response.body);\n    });\n```\n\nSample usage of Mangopay SDK installed with npm in a Node.js project\n-------------------------------------------------\nDon't forget to check examples folder !\n\nContributing\n-------------------------------------------------\n    npm start                       // installs dependencies and global mocha for testing and jsdox for documentation\n    npm test                        // runs the mocha tests\n    npm run-script documentation    // update documentation using jsdox, make sure to have it installed globally\n\nUnit Tests\n-------------------------------------------------\nMocha tests are placed under ``/test/`` folder. To run the tests, make sure you have all dependencies installed.\nCheck Contributing section for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinsoliz9%2Fmangopay-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinsoliz9%2Fmangopay-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinsoliz9%2Fmangopay-node/lists"}