Giter Site home page Giter Site logo

razorpay-php-testapp's Introduction

Razorpay Test App for PHP

Sample App for Razorpay PHP Integration

This app uses a non composer integration, ideally you should use composer to integrate the Razorpay API.

Demo

You can see a demo of the php-testapp by opening up the index.html file on your browser. Follow the steps below:

  1. Copy the contents of config.php.sample to config.php.
  2. Enter your key id / key secret in the config.php file.
  3. If you'd like a currency other than INR, change the displayCurrency to whatever currency you'd like.
  4. Watch the demo to test out automatic or manual checkout.

An easy way to test this is to run php -S localhost:8000 in the root directory and opening http://localhost:8000 in your browser.

Contents:

  1. Automatic checkout test app
  2. Manual checkout test app

Steps for Integration:

Automatic Checkout

  1. Make a checkout form using our Checkout Integration
  2. Accept the razorpay_payment_id parameter in the form submission
  3. Run the capture code to capture the payment

If you are re-using this as your final code, please make sure you do the following:

  • Edit the keyId inside automatic-checkout/index.html
  • Edit the keyId/keySecret in automatic-checkout/charge.php

Manual Checkout

  1. Create an order using razorpay orders api
  2. Accept the razorpay_payment_id parameter and razorpay_signature in the form submission
  3. Store the razorpay_order_id as a sessions variable
  4. Verify the signature emitted from our server based on the algorithm given at https://docs.razorpay.com/docs/orders

If you are re-using this as your final code, please make sure you do the following:

  • Edit the keyId/keySecret inside orders-api/order.php
  • Edit the keySecret in orders-api/verify-signature.php

Razorpay PHP SDK

Make sure that you download the latest version of razorpay-php.zip file from the releases section here. You can extract that to the razorpay-php directory as well.

This release currently uses the 1.2.8 version of the SDK. Please ensure that you are using the latest as the test app might lag behind.

razorpay-php-testapp's People

Contributors

captn3m0 avatar harshilmathur avatar mayankamencherla avatar

Watchers

James Cloos avatar Kishore Chandra Sahoo 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.