Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MidtransNode

Index

Constructors

  • new MidtransNode(isProduction: boolean, authKey: string): MidtransNode
  • Parameters

    • isProduction: boolean

      Are you ready to production?

    • authKey: string

      Your midtrans server-key

    Returns MidtransNode

Properties

config: IConfig

Methods

  • description

    This method is used to capture transaction balance when transaction_status is authorize. Transaction with status authorize is only available after Pre Authorization Credit Card transaction. More info: https://api-docs.midtrans.com/#capture-transaction

    Parameters

    • orderID: string

      Transaction id from charge response

    • Optional grossAmount: number

      Amount to be captured. By default will capture whole transaction amount. NOTE: Cannot be decimal

    Returns Promise<ITransaction | ITransactionFail>

  • createTransaction(args: SnapTransaction): Promise<undefined | { redirect_url: string; token: string }>
  • disableSubscription(subscriptionId: string): Promise<undefined | { status_message: string }>
  • enableSubscription(subscriptionId: string): Promise<undefined | { status_message: string }>
  • description

    Midtrans API provide Bin Lookup API to get metadata for a particular bin, such as card type (Debit/Credit) or the card brand (ex. Visa, Master). More info: https://api-docs.midtrans.com/#bin-api

    Parameters

    • binNumber: number

      Bin ID want to check.

    Returns Promise<undefined | BinApiResponse>

  • getPayAccount(accountID: string): Promise<undefined | IPayAccount>
  • getPayoutDetails(refNo: string): Promise<undefined | IPayout>
  • getSubscription(subscriptionId: string): Promise<undefined | ISubcription>
  • listBeneficiaries(limit?: number): Promise<undefined | IBeneficiaries[]>
  • ping(): Promise<undefined | string>
  • description

    Returns pong message for monitoring purpose

    Returns Promise<undefined | string>

  • pointInquiry(tokenId: string, grossAmount?: number): Promise<undefined | IPointInquiry>
  • Parameters

    • tokenId: string

      Card Token

    • Optional grossAmount: number

      The volume of the following transaction. This number can decide the remaining point balance amount which can be used on the response. NOTE: Needed for Mandiri Point.

    Returns Promise<undefined | IPointInquiry>

  • description

    As opposed to previous refund API, this is used to directly send the refund request to bank or payment provider (third party). This API is useful to skip the standard operation process which may take 1 or 2 days after the initial refund request. The status of corresponding transaction will immediately be updated following the refund result received from third party. It will send HTTP notification only if the refund succeeded. More info: https://api-docs.midtrans.com/#refund-transaction

    Parameters

    • orderID: string

      Transaction ID given by Midtrans

    • args: IRefundObjRequest

      Request Refund Object includes refund_key,amount,and reason.

    Returns Promise<ITransactionFail | IRefundObj>

  • setOverrideNotificationURL(urls: string | string[]): MidtransNode
  • Set override notification url.

    Parameters

    • urls: string | string[]

      Website URL(s)

    Returns MidtransNode

  • statusb2bTransaction(orderID: string, page?: undefined | number, perPage?: undefined | number): Promise<undefined | { status_code: string; status_message: string; transactions: ITransaction[] }>
  • description

    Transaction status for all B2B transactions related to an order_id can be obtained by triggering the Get Status B2B Method. More info: https://api-docs.midtrans.com/#get-transaction-status-b2b

    Parameters

    • orderID: string

      Transaction ID given by Midtrans

    • page: undefined | number = 0

      Index of the search. Default is 0.

    • perPage: undefined | number = 10

      Number of transactions which is presented. Default is 10.

    Returns Promise<undefined | { status_code: string; status_message: string; transactions: ITransaction[] }>

  • validateBankAccount(bankName: string, accountID: string): Promise<undefined | IValidateBankResult>

Generated using TypeDoc