npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-mangopay

v1.1.4

Published

mangopay package for payment implementation with nodejs

Downloads

20

Readme

What is this repository for?

  • node-mangopay is npm package for implement payment gateway mangopay implementation.

Documentation

  • See documentation https://docs.mangopay.com/endpoints/v2.01/

How do I get set up?

  • npm install node-mangopay --save

  • Two way of create instance of node-mangopay object


var mangopay=require("node-mangopay")({
	clientid:"*******", // Client id of mangopay
	passphrase:"************************", //passphrase string
	production:false, //optional by default is false
	version:"v2.01" //optional by defaulr version is 2.01
});

* OR

var mangopay=require("node-mangopay");

var mango=new mangopay({
	clientid:"*******",
	passphrase:"************************",
	production:false, //optional by default is false
	version:"v2.01" //optional by defaulr version is 2.01
});

Method used for mangopay implementation

  • Create natural user
var data={
   FirstName: "Happy" // Required 
   ,
   LastName: "kaur" // Required 
       ,
   Birthday: 1300186358 // Required 
       ,
   Nationality: "FR" // Required - default: 'FR' 
       ,
   CountryOfResidence: "FR" // Required - default: 'FR' 
       ,
   Occupation: "Devoeloper",
   IncomeRange: "6",
   ProofOfIdentity: "",
   ProofOfAddress: "",
   PersonType: "NATURAL",
   Email: "[email protected]",
   Tag: "custom tag",
   Address: {
       AddressLine1: "4101 Reservoir Rd NW",
       AddressLine2: "",
       City: "Washington",
       Region: "District of Columbia",
       PostalCode: "20007",
       Country: "US"
   }
};

mango.createNaturalUser(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • Update natural user
mango.updateNaturalUser({mangoPayId:"39273181",LastName:"xyz"},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • view user
mango.viewUser({
	"mangoPayId": "1463440221",
	},function(err,result){
		if(err)	
			console.log(err);
		else
			console.log(result);
})
  • get all user
mango.listUsers({
	"Page": 1,
	"Per_Page": 25,
	"Sort": "CreationDate:ASC",
	"BeforeDate": 1463440221,
	"AfterDate": 1431817821
	},function(err,result){
		if(err)	
			console.log(err);
		else
			console.log(result);
})
  • create legal user
var data={
	"Tag": "custom meta",
	"HeadquartersAddress": {
		"AddressLine1": "1 test Street",
		"AddressLine2": "The Loop",
		"City": "Paris",
		"Region": "Ile de France",
		"PostalCode": "75001",
		"Country": "FR"
	},
	"LegalPersonType": "BUSINESS",
	"Name": "Test Ltd",
	"LegalRepresentativeAddress": {
		"AddressLine1": "1 test Street",
		"AddressLine2": "The Loop",
		"City": "Paris",
		"Region": "Ile de France",
		"PostalCode": "75001",
		"Country": "FR"
	},
	"LegalRepresentativeBirthday": 1463496101,
	"LegalRepresentativeCountryOfResidence": "ES",
	"LegalRepresentativeNationality": "FR",
	"LegalRepresentativeEmail": "[email protected]",
	"LegalRepresentativeFirstName": "Joe",
	"LegalRepresentativeLastName": "Blogs",
	"Email": "[email protected]",
	"CompanyNumber": "LU72HN11"
};


mango.createLegalUser(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
})
  • update legal user
var data={
	"legalUserId":"1245211",
	"Tag": "custom meta",
	"Name":"Jon"
};


mango.updateLegalUser(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
})
  • wallet functions
mango.createWallet({
	"Tag": "custom meta",
    "Owners": [ "39273181" ], //mangopayID
    "Description": "wallet description",
    "Currency": "EUR"
},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});


mango.viewWallet({	
    "walletId": "39280469",
},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});


mango.updateWallet({	
    "walletId": "39280469",
    "Tag": "custom meta",
},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});


mango.listWallets({	
    "mangoPayId": "39280469",
},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • card related functions (create card from node end)
var data={
	Tag:"create card",
	mangoPayId:"39273181",
	currency:"EUR",
	cardType:"CB_VISA_MASTERCARD",
	cardNumber:"497010000000015",
	cardExpirationDate:"1020",
	cardCvx:"123"
};
mango.createCardAuto(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result); 
});


mango.viewCard({cardId:"39285307"},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});

mango.userCards({mangoPayId:"39273181"},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});


mango.deactivateCard({cardId:"39285307",active:false},function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • payin function

1 Create a Card Direct PayIn

var data={
    "Tag": "custom meta",
    "AuthorId": "38976011",
    "CreditedUserId": "38976011",
    "CreditedWalletId": "38980242",
    "DebitedFunds": {
    "Currency": "EUR",
      "Amount": 12
    },
    "Fees": {
    "Currency": "EUR",
      "Amount": 1
    },
    "SecureModeReturnURL": "http://www.my-site.com/returnURL",
    "CardId": "38978448",
    "SecureMode": "DEFAULT",
    "StatementDescriptor": "Mar2017"
}

mango.cardDirectPayin(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • Transfer Wallet to wallet
var data={
   "Tag": "custom meta",
	"AuthorId": "38976011",
	"CreditedUserId": "38976011",
	"DebitedFunds": {
		"Currency": "EUR",
		"Amount": 12
	},
	"Fees": {
		"Currency": "EUR",
		"Amount": 12
	},
	"DebitedWalletId": "38980242",
	"CreditedWalletId": "39280469"
}

mango.transferWallet(data,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • add bank account
mango.addBankIban({
	"mangopayId":"38976011",
	"Tag": "custom meta",
	"OwnerAddress": {
		"AddressLine1": "1 Mangopay Street",
		"AddressLine2": "The Loop",
		"City": "Paris",
		"Region": "Ile de France",
		"PostalCode": "75001",
		"Country": "FR"
	},
	"OwnerName": "Joe Blogs",
	"IBAN": "FR3020041010124530725S03383",
	"BIC": "CRLYFRPP"
},function(err,result){
 if(err)
		console.log(err);
	else
		console.log(result);
});
  • view bank detail
mango.viewBank({
  	bankId:"39797690",	// bankid
  	mangopayId:"38976011"	// mango pay id
},function(err,result){
 	if(err)
		console.log(err);
	else
		console.log(result);
});
  • tranfer money from wallet to bank acount or payouts bankwire

var opt={
	"Tag": "Transferred money from wallet to your bank account",
	"AuthorId": "38976011", //mangopay id
	"DebitedFunds": {
		"Currency": "EUR",
		"Amount": 10
	},
	"Fees": {
		"Currency": "EUR",
		"Amount": 0
	},
	"BankAccountId": 39797690, //bank account id
	"DebitedWalletId": 38980242, // wallet id
	"BankWireRef": "invoice"
};

mango.bankPayout(opt,function(err,result){
	if(err)
		console.log(err);
	else
		console.log(result);
});
  • owner or admin: Hermenpreet singh