Git Product home page Git Product logo

midtrans-payment-api-postman-collections's Introduction

Midtrans Payment API Postman Collection

Midtrans  ❤️ Postman!

Description

This repository contains Postman collection for various payment API call to Midtrans Payment API.

API covered:

Usage Instruction

  1. Download and open Postman
  2. Import:
  3. Register to Midtrans
  4. Login to Midtrans, switch to Sandbox, go to menu Settings > Access Keys. Copy your Server Key
  5. In Postman, open Midtrans Payment API then choose one request you want to try, click on Authorization tab (beside Headers tab)
  6. Select Type as Basic Auth, fill Username with your Server Key (looks like this VT-server-xxxxxx). Leave Password field blank, click Update Request
  7. Now you can save then click send the request. You will get server response.

Authorization Config

Specific Usage

You need to download/clone this repo to your local to use these:

SNAP - Snap Popup Viewer

If you are testing Snap transaction token request you will get response like:

{ "token": "bffb82ff-f8bb-4651-86b0-0c2316b77c0a" }

To see how that token works, you can open file ../snap-opener/index.html in your web browser to preview the SNAP payment page.

  • Tips: you can also append snap token like this in url ../snap-opener/index.html?snap_token=bffb82ff-f8bb-4651-86b0-0c2316b77c0a&is_production=false

You can also edit file snap/index.html and insert your own token to the HTML, then open in web browser.

This file is for snap token viewer only, you should not use this for integration reference, for front-end integration sample, see below section

SNAP - Snap Front-End Integration Example

For real example on how you can use Snap token in your website front-end, you can see sample minimum implementation here: ../sample-frontend/index.html

Edit the file and insert <Your-Client-Key-Here> with your client key.

Core API - Credit Card Get Token Example

To get credit card token for Core API Credit Card charge process, you can open ../coreAPI-getTokenCC/index.html in your web browser. (mandiri clickpay also need get token process).

Edit the file and insert <Your-Client-Key-Here> with your client key.

All implementation in this example are pure HTML & Javascript so you don't need to have any server running.

Production Mode

All endpoint used in this postman collection is for sandbox transaction, to switch to production change endpoint URL from:

https://api.sandbox.midtrans.com/../..

to

https://api.midtrans.com/../..

(Just remove the sandbox. from url)

Troubleshooting

If you get error

{
  "error_messages": [
    "Access denied due to unauthorized transaction, please check client or server key",
    "Visit https://snap-docs.midtrans.com/#request-headers for more details"
  ]
}
  • Please make sure you do step 4-7 properly like instructed in Usage Instruction section.
  • Please make sure you are using correct Server Key (Serverkey for sandbox & production are different).

Changelog

15/11/2018

  • Add sample collection for flow recurring Credit Cards.
  • Add a list of information and contacts to help understand the use of the Midtrans product API.

25/01/2018

  • Add gopay & danamon online banking example.
  • Change mandiri clickpay request, according to docs.
  • Change sample customer email.

Get Help

midtrans-payment-api-postman-collections's People

Contributors

carolus10benny avatar

Watchers

James Cloos avatar Andhika Maheva Wicaksono avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.