🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

midtrans-node-client

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midtrans-node-client

Unoffficial Midtrans Payment API Client for Node JS | Alternative for Midtrans Official Module

0.0.6
latest
Source
npm
Version published
Weekly downloads
151
-6.79%
Maintainers
1
Weekly downloads
 
Created
Source

Midtrans Node

Build Status Language grade: JavaScript Coverage Status node-current npm npm bundle size npm bundle size (version) Snyk Vulnerabilities for npm package PRs Welcome

Installation

npm install midtrans-node-client -S or yarn add midtrans-node-client -S

API Documentation

  • Core API Documentation

    follow this link for more related information Core Midtrans API Reference official

  • Iris API Documentation

    follow this link for more related information Iris Midtrans API Reference official

  • Snap API Documentation

    follow this link for more related information Snap Midtrans API Reference official

API Reference

Core API Services

  • charge( parameter: object ) : Promise

    MethodRequestDescription
    chargePOSTCreate transaction with various available payment methods and features
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.charge({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 10000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.charge({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 20000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
  • capture( parameter: object ) : Promise

    MethodRequestDescription
    capturePOSTCapture an authorized transaction for card payment
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
               
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.capture({
          transaction_id: "be4f3e44-d6ee-4355-8c64-c1d1dc7f4590",
          gross_amount: 100000
        })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.capture({
         transaction_id: "be4f3e44-d6ee-4355-8c64-c1d1dc7f4590",
         gross_amount: 100000
       })
       .then(console.log)
       .catch(console.error)
    
  • cardRegister( parameter: object ) : Promise

    MethodRequestDescription
    cardRegisterGETRegister card information (card number and expiry) to be used for two clicks and one click
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardRegister({
    		   card_number: '5421813858532415',
    		   card_exp_month: '10',
    		   card_exp_year: '2024',
    		   card_cvv: '426',
    		   client_key: core.apiConfig.get().clientKey
    	   })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardRegister({
    		   card_number: '5421813858532415',
    		   card_exp_month: '10',
    		   card_exp_year: '2024',
    		   card_cvv: '426',
    		   client_key: core.apiConfig.get().clientKey
    	   })
       .then(console.log)
       .catch(console.error)
    
  • cardToken( parameter: object ) : Promise

    MethodRequestDescription
    cardTokenGETTokenize Credit Card information before being charged
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardToken({
    		  card_number: '5421813858532415',
    		  card_exp_month: '10',
    		  card_exp_year: '2024',
    		  card_cvv: '426',
    		  client_key: core.apiConfig.get().clientKey
    	  })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardToken({
    		  card_number: '5421813858532415',
    		  card_exp_month: '10',
    		  card_exp_year: '2024',
    		  card_cvv: '426',
    		  client_key: core.apiConfig.get().clientKey
    	  })
       .then(console.log)
       .catch(console.error)
    
  • cardPointInquiry( tokenId: string ) : Promise

    MethodRequestDescription
    cardPointInquiryGETGet the point balance of the card in denomination amount
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardPointInquiry("526422-4659-80f25158-71dd-4a87-aad2-3c37689e6bfd")
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.cardPointInquiry("526422-4659-80f25158-71dd-4a87-aad2-3c37689e6bfd")
       .then(console.log)
       .catch(console.error)
    

Iris API Services

  • ping(): Promise

    MethodRequestDescription
    pingGETReturns pong message for monitoring purpose
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.ping()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.ping()
       .then(console.log)
       .catch(console.error)
    
  • createBeneficiaries( parameter: object ): Promise

    MethodRequestDescription
    createBeneficiariesPOSTcreate a new beneficiary information for quick access on the payout page in Iris Portal.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.createBeneficiaries({
    			name: 'Restu Wahyu Saputra',
    			account: '5432198760',
    			bank: 'bca',
    			alias_name: 'restu',
    			email: 'restuwahyu13@zetmail.com'
    		})
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.createBeneficiaries({
    			 name: 'Restu Wahyu Saputra',
    			 account: '5432198760',
    			 bank: 'bca',
    			 alias_name: 'restu',
    			 email: 'restuwahyu13@zetmail.com'
    		 })
        .then(console.log)
        .catch(console.error)
    
  • updateBeneficiaries( aliasName: string, parameter: object ): Promise

    MethodRequestDescription
    updateBeneficiariesPATCHUpdate an existing beneficiary identified by its alias_name
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.updateBeneficiaries('restu',{
    			name: 'Restu Wahyu Saputra',
    			account: '5432198760',
    			bank: 'bca',
    			alias_name: 'restu',
    			email: 'restuwahyu13@zetmail.com'
    		})
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.updateBeneficiaries('restu',{
    			 name: 'Restu Wahyu Saputra',
    			 account: '5432198760',
    			 bank: 'bca',
    			 alias_name: 'restu',
    			 email: 'restuwahyu13@zetmail.com'
    		 })
        .then(console.log)
        .catch(console.error)
    
  • getBeneficiaries(): Promise

    MethodRequestDescription
    getBeneficiariesGETFetch list of all beneficiaries saved in Iris Portal
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBeneficiaries()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBeneficiaries()
       .then(console.log)
       .catch(console.error)
    
  • createPayouts( parameter: object ): Promise

    MethodRequestDescription
    createPayoutsPOSTCreator to create a payout. It can be used for single payout and also multiple payouts.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.createPayouts({
        payouts: [
           {
             beneficiary_name: 'Restu Wahyu Saputra',
             beneficiary_account: '5432198760',
             beneficiary_bank: 'bca',
             beneficiary_email: 'restuwahyu13@zetmail.com',
             amount: '100000',
             notes: 'Payout 31 January 2021'
           }
         ]
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.createPayouts({
        payouts: [
           {
             beneficiary_name: 'Restu Wahyu Saputra',
             beneficiary_account: '5432198760',
             beneficiary_bank: 'bca',
             beneficiary_email: 'restuwahyu13@zetmail.com',
             amount: '100000',
             notes: 'Payout 31 January 2021'
           }
         ]
       })
       .then(console.log)
       .catch(console.error)
    
  • approvePayouts( parameter: object ): Promise

    MethodRequestDescription
    approvePayoutsPOSTApporver to approve multiple payout request.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.approvePayouts({
    			reference_nos: ['20543502291'],
    			otp: '335163'
    		})
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.approvePayouts({
    			reference_nos: ['20543502291'],
    			otp: '335163'
    		})
       .then(console.log)
       .catch(console.error)
    
  • rejectPayouts( parameter: object ): Promise

    MethodRequestDescription
    rejectPayoutsPOSTApporver to reject multiple payout request.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.rejectPayouts({
    		  reference_nos: ['eyad5swd9b026c5kmr'],
    		  reject_reason: 'Reason to reject payouts'
    	  })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.rejectPayouts({
    		  reference_nos: ['eyad5swd9b026c5kmr'],
    		  reject_reason: 'Reason to reject payouts'
    	  })
       .then(console.log)
       .catch(console.error)
    
  • getPayoutDetails( referenceNo: string ): Promise

    MethodRequestDescription
    getPayoutDetailsGETGet details of a single payout
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.rejectPayouts({
    		  reference_nos: ['eyad5swd9b026c5kmr'],
    		  reject_reason: 'Reason to reject payouts'
    	  })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.rejectPayouts({
    		  reference_nos: ['eyad5swd9b026c5kmr'],
    		  reject_reason: 'Reason to reject payouts'
    	  })
       .then(console.log)
       .catch(console.error)
    
  • getTransactionHistory( parameter: string): Promise

    MethodRequestDescription
    getTransactionHistoryGETList all transactions history for a month.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getTransactionHistory({ from_date: "2020-11-01", to_date: "2020-12-28" })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getTransactionHistory({ from_date: "2020-11-01", to_date: "2020-12-28" })
       .then(console.log)
       .catch(console.error)
    
  • getTopupChannels(): Promise

    MethodRequestDescription
    getTopupChannelsGETProvide top up information channel for Aggregator Partner
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getTopupChannels()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getTopupChannels()
       .then(console.log)
       .catch(console.error)
    
  • getBalance(): Promise

    MethodRequestDescription
    getBalanceGETget current balance
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBalance()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBalance()
       .then(console.log)
       .catch(console.error)
    
  • getFacilitatorBankAccounts(): Promise

    MethodRequestDescription
    getFacilitatorBankAccountsGETShow list of registered bank accounts for facilitator partner
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getFacilitatorBankAccounts()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getFacilitatorBankAccounts()
       .then(console.log)
       .catch(console.error)
    
  • getFacilitatorBalance( bankAccountId: string ): Promise

    MethodRequestDescription
    getFacilitatorBalanceGETGet current balance information of your registered bank account.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getFacilitatorBalance('mandiri38fd1f0e')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getFacilitatorBalance('mandiri38fd1f0e')
       .then(console.log)
       .catch(console.error)
    
  • getBeneficiaryBanks(): Promise

    MethodRequestDescription
    getBeneficiaryBanksGETShow list of supported banks in IRIS.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBeneficiaryBanks()
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.getBeneficiaryBanks()
       .then(console.log)
       .catch(console.error)
    
  • validateBankAccount( parameter: object ): Promise

    MethodRequestDescription
    validateBankAccountGETCheck if an account is valid, if valid return account information.
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.validateBankAccount({ bank: 'danamon', account: '000001137298' )
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       
       const iris = new MidtransClient.Iris({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       iris.validateBankAccount({ bank: 'danamon', account: '000001137298' )
       .then(console.log)
       .catch(console.error)
    

Snap API Services

  • createTransaction( parameter: object ): Promise

    MethodRequestDescription
    createTransactionPOSTcreate transaction payment using snap integaration payment method
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransaction({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 10000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransaction({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 20000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
  • createTransactionToken( parameter: object ): Promise

    MethodRequestDescription
    createTransactionTokenPOSTcreate transaction payment token using snap integaration payment method
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransactionToken({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 10000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransactionToken({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 20000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
  • createTransactionRedirectUrl( parameter: object ): Promise

    MethodRequestDescription
    createTransactionRedirectUrlPOSTcreate transaction payment redirect using snap integaration payment method
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransactionRedirectUrl({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 10000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransactionRedirectUrl({
        	payment_type: 'bank_transfer',
          bank_transfer: { bank: 'bca' },
          transaction_details: {
            order_id: uuidv4(),
            gross_amount: 100000
          },
          item_details: [
            {
             id: uuidv4(),
             name: 'ayam bakar sambal balado'
             quantity: 2
             price: 25000
            },
            {
             id: uuidv4(),
             name: 'sop iga bakar daging lunak'
             quantity: 1
             price: 30000
            },
            {
             id: uuidv4(),
             name: 'just alpuckat'
             quantity: 2
             price: 20000
            }
          ],
          customer_details: {
          	first_name: 'restu wahyu',
            last_name: ' saputra',
            email: 'restuwahyu13@zetmail.com',
            phone: '087820154350',
            billing_address:  {
            	address: 'jl.sibuta gua hantu no.120',
              city: 'Depok',
              postal_code: '16436'
            }
          }
       })
       .then(console.log)
       .catch(console.error)
    

Transaction API Services

  • status( transactionId: string ): Promise

    MethodRequestDescription
    statusGETGet information status of a transaction with certain order_id or transaction_id
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.status('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.status('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • statusb2b( transactionId: string ): Promise

    MethodRequestDescription
    statusb2bGETGet information status of multiple B2B transactions related to certain order_id or transaction_id
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.status('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.statusb2b('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • approve( transactionId: string ): Promise

    MethodRequestDescription
    approvePOSTApprove a transaction with certain order_id or transaction_id which gets challenge status from Fraud Detection System
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.approve('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.approve('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • deny( transactionId: string ): Promise

    MethodRequestDescription
    denyPOSTDeny a transaction with certain order_id or transaction_id which gets challenge status from Fraud Detection System
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.deny('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.deny('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • cancel( transactionId: string ): Promise

    MethodRequestDescription
    cancelPOSTCancel a transaction with certain order_id or transaction_id before settlement process
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.cancel('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.cancel('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • expire( transactionId: string ): Promise

    MethodRequestDescription
    expirePOSTUpdate order_id or transaction_id with pending status to be expired
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.expire('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.expire('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then(console.log)
       .catch(console.error)
    
  • refund( transactionId: string, parameter?: object): Promise

    MethodRequestDescription
    refundPOSTUpdate order_id or transaction_id with settlement status to be refund
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.refund('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590', {
         amount: 1000000, 
         reason: 'Reason to refund payouts'
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.refund('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590', {
         amount: 1000000, 
         reason: 'Reason to refund payouts'
       })
       .then(console.log)
       .catch(console.error)
    
  • refundDirect( transactionId: string, parameter?: object): Promise

    MethodRequestDescription
    refundDirectPOSTAttempt to send refund to bank or payment provider and update the transaction status to refund if it succeeded
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.refundDirect('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590', {
         amount: 1000000, 
         reason: 'Reason to refund direct payouts'
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.refundDirect('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590', {
         amount: 1000000, 
         reason: 'Reason to direct payouts'
       })
       .then(console.log)
       .catch(console.error)
    
  • notification( notification: object ): Promise

    MethodRequestDescription
    notificationundefinedadditional mechanism we provide to verify the content and the origin of the notification is to challenge
    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       let getResponse;
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
        snap.transaction.status('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then((res) => getResponse = res)
       .catch(console.error)
       
       snap.transaction.notification(JSON.stringify(getResponse))
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       let getResponse;
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.transaction.status('be4f3e44-d6ee-4355-8c64-c1d1dc7f4590')
       .then((res) => getResponse = res)
       .catch(console.error)
       
       snap.transaction.notification(JSON.stringify(getResponse))
       .then(console.log)
       .catch(console.error)
    

Custome Usage

For custom usage already using type definitions for ease of use and for all functions that use parameters all have type definitions.

  • charge( parameter: object ) : Promise

    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.charge({
          chargeBankTransfer: {
            payment_type: 'bank_transfer',
            bank_transfer: { bank: 'bca' },
            transaction_details: {
              order_id: uuidv4(),
              gross_amount: 100000
            },
            item_details: [
              {
               id: uuidv4(),
               name: 'ayam bakar sambal balado'
               quantity: 2
               price: 25000
              },
              {
               id: uuidv4(),
               name: 'sop iga bakar daging lunak'
               quantity: 1
               price: 30000
              },
              {
               id: uuidv4(),
               name: 'just alpuckat'
               quantity: 2
               price: 10000
              }
            ],
            customer_details: {
              first_name: 'restu wahyu',
              last_name: ' saputra',
              email: 'restuwahyu13@zetmail.com',
              phone: '087820154350',
              billing_address:  {
                address: 'jl.sibuta gua hantu no.120',
                city: 'Depok',
                postal_code: '16436'
              }
            }
         }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const core = new MidtransClient.CoreApi({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       core.charge({
          chargeBankTransfer: {
            payment_type: 'bank_transfer',
            bank_transfer: { bank: 'bca' },
            transaction_details: {
              order_id: uuidv4(),
              gross_amount: 100000
            },
            item_details: [
              {
               id: uuidv4(),
               name: 'ayam bakar sambal balado'
               quantity: 2
               price: 25000
              },
              {
               id: uuidv4(),
               name: 'sop iga bakar daging lunak'
               quantity: 1
               price: 30000
              },
              {
               id: uuidv4(),
               name: 'just alpuckat'
               quantity: 2
               price: 10000
              }
            ],
            customer_details: {
              first_name: 'restu wahyu',
              last_name: ' saputra',
              email: 'restuwahyu13@zetmail.com',
              phone: '087820154350',
              billing_address:  {
                address: 'jl.sibuta gua hantu no.120',
                city: 'Depok',
                postal_code: '16436'
              }
            }
         }
       })
       .then(console.log)
       .catch(console.error)
    
  • createTransaction( parameter: object ): Promise

    • Example Usage Using CommonJS
       const { MidtransClient } = require('midtrans-node-client')
       const { v4: uuidv4 } = require('uuid')
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransaction({
          BcaVirtualAccount: {
            payment_type: 'bank_transfer',
            bank_transfer: { bank: 'bca' },
            transaction_details: {
              order_id: uuidv4(),
              gross_amount: 100000
            },
            item_details: [
              {
               id: uuidv4(),
               name: 'ayam bakar sambal balado'
               quantity: 2
               price: 25000
              },
              {
               id: uuidv4(),
               name: 'sop iga bakar daging lunak'
               quantity: 1
               price: 30000
              },
              {
               id: uuidv4(),
               name: 'just alpuckat'
               quantity: 2
               price: 20000
              }
            ],
            customer_details: {
              first_name: 'restu wahyu',
              last_name: ' saputra',
              email: 'restuwahyu13@zetmail.com',
              phone: '087820154350',
              billing_address:  {
                address: 'jl.sibuta gua hantu no.120',
                city: 'Depok',
                postal_code: '16436'
              }
            }
         }
       })
       .then(console.log)
       .catch(console.error)
    
    • Example Usage Using ES6
       import { MidtransClient } from 'midtrans-node-client'
       import { v4 as uuidv4 } from 'uuid'
       
       const snap = new MidtransClient.Snap({
         isProduction: process.env.DEVELOPMENT,
         serverKey: process.env.SERVER_KEY,
         clientKey: process.env.CLIENT_KEY
       })
        
       snap.createTransaction({
          BcaVirtualAccount: {
            payment_type: 'bank_transfer',
            bank_transfer: { bank: 'bca' },
            transaction_details: {
              order_id: uuidv4(),
              gross_amount: 100000
            },
            item_details: [
              {
               id: uuidv4(),
               name: 'ayam bakar sambal balado'
               quantity: 2
               price: 25000
              },
              {
               id: uuidv4(),
               name: 'sop iga bakar daging lunak'
               quantity: 1
               price: 30000
              },
              {
               id: uuidv4(),
               name: 'just alpuckat'
               quantity: 2
               price: 20000
              }
            ],
            customer_details: {
              first_name: 'restu wahyu',
              last_name: ' saputra',
              email: 'restuwahyu13@zetmail.com',
              phone: '087820154350',
              billing_address:  {
                address: 'jl.sibuta gua hantu no.120',
                city: 'Depok',
                postal_code: '16436'
              }
            }
         }
       })
       .then(console.log)
       .catch(console.error)
    

Custome Reference

  • Custome Core API Service - charge Request

    chargeBankTransfer?: ChargeBankTransfer
      chargeCreditCard?: ChargeCreditCard
      chargeNon3DS?: ChargeNon3DS
      charge3DS?: Charge3DS
      chargePermata?: ChargePermataVirtualAccount
      chargeBca?: ChargeBcaVirtualAccount
      chargeMandiri?: ChargeMandiriVirtualAccount
      chargeBni?: ChargeBniVirtualAccount
      chargeBri?: ChargeBriVirtualAccount
      chargeBcaKlikPay?: ChargeBcaKlikpay
      chargeKlikBca?: ChargeKlikBca
      chargeBriEpay?: ChargeBriEpay
      chargeChimbClick?: ChargeCimbClick
      chargeDanamonOnline?: ChargeDanamonOnline
      chargeQris?: ChargeQris
      chargeGopay?: ChargeGopay
      chargeShopeePay?: ChargeShoopePay
      chargeIndomaret?: ChargeIndomaret
      chargeAlfamart?: ChargeAlfamart
      chargeAkuLaku?: ChargeAkuLaku
    
  • Custome Snap Service - createTransaction Request

      snapCreditCard?: SnapCreditCard
      snapFull?: SnapFull
      snapBca?: SnapBcaVirtualAccount
      snapPermata?: SnapPermataVirtualAccount
      snapBni?: SnapBniVirtualAccount
      snapBri?: SnapBriVirtualAccount
      snapMandiri?: SnapMandiriVirtualAccount
      snapGopay?: SnapGopay
      snapKlikBca?: SnapKlikBCA
      snapBcaKlikPay?: SnapBcaKlikPay
      snapCimbKlik?: SnapCimbKlik
      snapDanamonOnline?: SnapDanamonOnlineBanking
      snapBriEpay?: SnapBriEpay
      snapIndomaret?: SnapIndomaret
      snapAlfamart?: SnapAlfamart
      snapAkuLaku?: SnapAkuLaku
      snapShopePay?: SnapShopeePay
    

Testing

  • Testing Via Local

    npm test or make test
    
  • Testing Via Local And Build

    make build
    
  • Testing Via Docker

    docker build -t midtrans-node or make dkb tag=midtrans-node
    

Bugs

For information on bugs related to package libraries, please visit here

Contributing

Want to make Midtrans Node more perfect ? Let's contribute and follow the contribution guide.

License

BACK TO TOP

Keywords

midtrans-node-client

FAQs

Package last updated on 19 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts