Simple way to integrate with Malga
Learn how to quickly integrate Malga into your project. For more details on integration, simply click here.
- First of all, you'll need to install our SDK into your project:
yarn add malga
# or
npm install malga
# or
pnpm add malga
- Make your first charge in a simplified way
import { Malga } from 'malga'
const malga = new Malga({
apiKey: 'YOUR_API_KEY',
clientId: 'YOUR_CLIENT_ID',
options: { sandbox: true },
})
(async function () {
try {
const data = await malga.charges.create({
merchantId: 'YOUR_MERCHANT_ID',
amount: 100,
paymentMethod: {
type: 'credit',
installments: 1,
card: {
holderName: 'João da Silva',
number: '5453881028277600',
cvv: '170',
expirationDate: '10/2030',
},
},
})
console.log(data)
} catch (error) {
console.error(error)
}
})()
If you have any doubts about the integration, you can click here to see some examples
Feel free to contribute to this project by submitting pull requests, creating documentation, or bringing ideas to make the project even better!