A tutorial to enable Payments acceptance via Payabbhi .Net library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
custom
dropin
tools
LICENSE
README.md
build.cake
build.ps1
build.sh

README.md

Superheroes - A tutorial to enable Payments acceptance via Payabbhi .Net library

Superheroes Store allows purchase of a superhero, to run errands for you, by paying a random amount between ₹1 to ₹5.

The Payments Acceptance workflow is implemented as described in the Payabbhi Integration Guide using Payabbhi .Net Library.

The Superheroes tutorial is designed to take you to full implementation in four graded steps:

  • Step 1 : Basic implementation of Payments Acceptance workflow
  • Step 2 : Add Payment Response Handling
  • Step 3 : Add Exception Handling
  • Step 4 : Reorganize and Refactor to bring everything together

Getting started

  • Clone the Superheroes repository
  • Install Payabbhi .Net Library
  • Sign up for a Payabbhi account and download API Keys
  • Set up local env for running Superheroes

Clone the Superheroes repository

 $ git clone https://github.com/paypermint/superheroes-dotnet.git

Install the Payabbhi .Net Client library

To run any of the steps, you will first need to install the Payabbhi .Net Library as per instructions provided with it for Nuget etc..

  • packages.config

     <package id="Payabbhi" version="1.0.0" targetFramework="net45" />
    
  • SuperHeroes.csproj

      <Reference Include="Payabbhi">
         <HintPath>packages\Payabbhi.1.0.0\lib\net45\Payabbhi.dll</HintPath>
      </Reference>

Sign up for a Payabbhi account and download API Keys

Next, sign up for a Payabbhi Account and download the API keys from the Portal.

As you go through the tutorial, you will need to replace every instance of <ACCESS-ID> and <SECRET-KEY> in HomeController.cs file with your actual keys. You would typically want to use your test mode API keys for this tutorial.

Running Superheroes

With Visual Studio

For each step of the tutorial,

  1. Go to a particular step of the tutorial using the following command
$ cd <method>/step<step>

where <method> is either custom or dropin and <step> is any of 1, 2, 3 or 4.

  1. Open the SuperHeroes.sln file in Visual Studio.
  2. Build and Run.

With command line

Windows

For each step of the tutorial,

  1. Open Powershell.
  2. Execute following commands to create a distributable dist folder.
$ ./build.ps1 -method <method> -step <step>

where <method> is either custom or dropin and <step> is any of 1, 2, 3 or 4

  1. A dist folder is created for distribution containing a zip file.
  2. Unzip and copy the contents of dist\SuperHeroes<method>step<step>\_PublishedWebsites\SuperHeroes to the appropriate sub-folder of the IIS server as appropriate
Mac

Prerequisite - Install Mono

For each step of the tutorial,

  1. Execute following command to start the xsp webserver.
$ ./build.sh -method <method> -step <step>
$ cd <method>/step<step>
$ xsp4

where <method> is either custom or dropin and <step> is any of 1, 2, 3 or 4