API ReferenceIntegrationsKnowledge Base

PHP Client

The Razorpay Payment Gateway enables you to accept payments via debit card, credit card, netbanking (supports 3D Secure), UPI or through any of our supported wallets.

PHP Client API#

The api follows the following practices:

  • Namespaced under Razorpay\Api.
  • Call $api->class->function() to access the api.
  • The PHP client 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.

Installation#

You can install Razorpay using a composer or by downloading the required ZIP file.

Composer#

Run the below command on your composer:

Copycomposer require razorpay/razorpay:2.*

Download the ZIP File#

If you are not using a composer:

  1. Download the latest razorpay-php.zip file from the releases section on GitHub. The razorpay-php.zip is pre-compiled to include all dependencies.

  2. Unzip the file.

  3. Include the Razorpay.php file in your application and you can use the API as usual.

License#

The Razorpay PHP SDK is released under the MIT License. Click here for details.