MoIP SDK
Node.js sdk for MoIP, able to create payment and get payment info.
Usage
-
Add dependency 'moip' in your package.json file.
-
Require 'moip' in your file.
var Moip = ;var moip =token: '01010101010101010101010101010101'key: 'ABABABABABABABABABABABABABABABABABABABAB'sandbox: true // defaults to false;// When you are ready to go live, use your token and keyvar moip =token: 'your_token'key: 'your_key';
API
-
CreatePayment (alias: EnviarInstrucaoUnica)
var payload =EnviarInstrucao:InstrucaoUnica:Razao: 'Sandbox'IdProprio:Valores:Valor:$: 'moeda': 'BRL'_: 150;moip;// This method has an alias: enviarInstrucaoUnicamoip; -
GetPaymentInfo (alias: ConsultarInstrucao)
var token = 'payment_token';moip;// This method has an alias: consultarInstrucaomoip;
Tests
Tests can be runned with:
mocha
Reference
CreatePayment/EnviarInstrucaoUnica
GetPaymentInfo/ConsultarInstrucao