zarankumar / razorpay-php-testapp

Sample App for Razorpay PHP Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

razorpay-php

Build Status Latest Stable Version License

Razorpay client PHP Api. The api follows the following practices:

  • namespaced under Razorpay\Api
  • call $api->class->function() to access the api
  • api throws exceptions instead of returning errors
  • options are passed as an array instead of multiple arguments wherever possible
  • All request and responses are communicated over JSON
  • A minimum of PHP 5.3 is required

Installation

  • If your project uses composer, add following to composer.json
{
    "require": {
        "razorpay/razorpay": "1.*"
    }
}

Then, run composer update. If you are not using composer, download the latest release from the releases section. You should download the razorpay-php.zip file.

After that include Razorpay.php in your application and you can use the API as usual.

Usage

use Razorpay\Api\Api;

$api = new Api($api_key, $api_secret);
$api->payment->all($options); // Returns array of payment objects
$payment = $api->payment->fetch($id); // Returns a particular payment
$api->payment->fetch($id)->capture(array('amount'=>$amount)); // Captures a payment
$api->payment->fetch($id)->refund($id); // Refunds a payment

// To get the payment details
echo $payment->amount;
echo $payment->currency;
// And so on for other attributes

For further help, see our documentation on https://docs.razorpay.com.

Hacking

See the doc.md file for getting started with development.

License

The Razorpay PHP SDK is released under the MIT License.

Release

Steps to follow for a release:

  1. Merge the branch with the new code to master.
  2. Bump the Version in src/Api.php.
  3. Rename Unreleased to the new tag in CHANGELOG
  4. Fix links at bottom in CHANGELOG
  5. Commit
  6. Tag the release and push to GitHub
  7. Create a release on GitHub using the website with more details about the release

About

Sample App for Razorpay PHP Integration

License:MIT License


Languages

Language:PHP 98.9%Language:Smarty 0.8%Language:HTML 0.3%