Getting Started

Express Checkout APIs are built around basic HTTP communication and closely follows the standards of REST. While the URL themselves are not specific to resources, the URL path is intuitive to reflect the action performed by the API.

Installation

To install and use the package:

  1. Add :juspay_api_library to your list of dependencies in mix.exs:

    def deps do
      [{:juspay_api_library, "~>0.1.0"}]
    end
  2. Ensure juspay_api_library is started before your application:

    def application do
      [applications: [:juspay_api_library]]
    end

API KEY Configuration

API key can be obtained from https://merchant.juspay.in/settings/api-keys.

Note: API Key is like password to your account. You must never send this information to browser or application clients. Also, do not publish your API Key in publicly accessible areas such as Git repositories, Android/iOS clients, support forums, etc..

  # in your config/config.exs file add the following lines

  config :juspay_api_library,
    api_key: "ACE565EAB40F4AA78853F03F496F7DB5"   

  # Ensure that you replace this sample api key ("ACE565EAB40F4AA78853F03F496F7DB5") with
  # the api key that pertains to your account

Usage

Refer “https://www.juspay.in/docs/api/ec/”” to know the type of parameters, required parameters etc for each API.

You are ready to get going. Here is a test example

iex> Juspay.Cards.create([ merchant_id: "merchant_101", customer_id: "user_108", name_on_card: "Sindbad",
                               card_exp_year: 2015, card_exp_month: 7, customer_email: "customer@mail.com",
                               nickname: "Visa card", card_number: "4123567890123456"  ])

     %{"card_fingerprint" => "2bp6l17bhqm700ktnv7h28q4qi",
       "card_reference" => "ed72bf71dacb394b6285ade971a19d05",
       "card_token" => "5c649100-4298-44de-b56a-d1118280042b"}

Important Note

Input parameters for the functions in this API Library can be of any of the following format

  1) List  -->   ["a":1,"b":2]  or [a:1 or b:2]
  2) String keyed map -->   %{"a" => 1, "b" => 2}
  3) Atom keyed map -->   %{:a => 1, :b => 2} or %{"a": 1,"b": 2} or %{a: 1,b: 2}

Output response of the functions in the API Library are either of the following format

  1) Lists
  2) String keyed map  --> %{"a" => 1}

Support

Should you have any questions, feel free to reach us at support@juspay.in.

Note: Remember to send your merchant_id in the subject line of the email so that we can help you better.