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 javeeth avatar mayankamencherla avatar naveen-s-rzp avatar prem-razorpay avatar priyaj28 avatar swati31196 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

razorpay-php-testapp's Issues

idk what happen just read it

Compile Error: require_once(): Failed opening required 'includes/libs/Requests-1.7.0/library/Requests.php' (include_path='C:\xampp\php\PEAR') (line 5 of C:\xampp\htdocs\pc_portal\site\assets\cache\FileCompiler\includes\Razorpay.php)

This error message was shown because: you are logged in as a Superuser. Error has been logged.

Outdated example application

This application uses the deprecated API endpoint. This ruins the UX, the first time user wants to have an application that works out of the box.
API endpoint: https://api.fixer.io/latest?symbols=USD&base=INR

{
  "0": "#################################################################################################################################",
  "1": "#                                                                                                                               #",
  "2": "# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT                                                                                   #",
  "3": "#                                                                                                                               #",
  "4": "# This API endpoint is deprecated and has now been shut down. To keep using the Fixer API, please update your integration       #",
  "5": "# to use the new Fixer API endpoint, designed as a simple drop-in replacement.                                                  #",
  "6": "# You will be required to create an account at https://fixer.io and obtain an API access key.                                   #",
  "7": "#                                                                                                                               #",
  "8": "# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/fixerAPI/fixer#readme          #",
  "9": "#                                                                                                                               #",
  "a": "#################################################################################################################################"
}

Fatal error: Uncaught exception 'Requests_Exception' with message 'cURL error 28

When i press paynow button and validate a payment this error is appearing

Fatal error: Uncaught exception 'Requests_Exception' with message 'cURL error 28: Operation timed out after 10003 milliseconds with 0 out of -1 bytes received' in /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/vendor/rmccue/requests/library/Requests/Transport/cURL.php:280 Stack trace: #0 /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/vendor/rmccue/requests/library/Requests/Transport/cURL.php(123): Requests_Transport_cURL->process_response(false, Array) #1 /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/vendor/rmccue/requests/library/Requests.php(317): Requests_Transport_cURL->request('https://api.raz...', Array, Array, Array) #2 /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/src/Request.php(25): Requests::request('https://api.raz...', Array, Array, 'POST', Array) #3 /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/src/Entity.php(45): Razorpay\Api\Request->request('POST', 'payments/pay_30...', Array) #4 /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/src/Payment.php(37): Razorpay\Api\Entity->reque in /opt/lampp/htdocs/rpay_app/libs/razorpay-php-master/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 280

BAD_REQUEST_ERROR

@captn3m0 I don't have spaces i am testing the api in postman. In test mode api is working.

{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The api secret provided is invalid"
}
}

Change Text of Button in pay.php

This may look like a very basic question, but I am unable to change the text of button in pay.php
There is no code for that button in the page and it appears due to the script, I believe.

I was able to change the CSS via changing the .razorpay-payment-button class.
Please help me to change the button name from "Pay Now" to something else.

--
Regards
SAurabha J

Fatal error: Uncaught Requests_Exception: cURL error 7:

Why this error:
Fatal error: Uncaught Requests_Exception: cURL error 7: Failed to connect to api.razorpay.com port 443: Connection refused in /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/libs/Requests-1.7.0/library/Requests/Transport/cURL.php:422 Stack trace: #0 /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/libs/Requests-1.7.0/library/Requests/Transport/cURL.php(177): Requests_Transport_cURL->process_response('', Array) #1 /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/libs/Requests-1.7.0/library/Requests.php(379): Requests_Transport_cURL->request('https://api.raz...', Array, Array, Array) #2 /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/src/Request.php(56): Requests::request('https://api.raz...', Array, Array, 'POST', Array) #3 /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/src/Entity.php(86): Razorpay\Api\Request->request('POST', 'https://api.raz...', Array) #4 /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/r in /srv/disk2/3536898/www/hijabs.onlinewebshop.net/razorpay/razorpay-php/libs/Requests-1.7.0/library/Requests/Transport/cURL.php on line 422

shows as The api key provided is invalid - But its valid test key

Fatal error: Uncaught exception 'Razorpay\Api\Errors\BadRequestError' with message 'The api key provided is invalid' in /var/www/REPO/rtest/razorpay-php/src/Request.php:123 Stack trace: #0 /var/www/REPO/rtest/razorpay-php/src/Request.php(90): Razorpay\Api\Request->processError(Array, 401, Object(Requests_Response)) #1 /var/www/REPO/rtest/razorpay-php/src/Request.php(44): Razorpay\Api\Request->checkErrors(Object(Requests_Response)) #2 /var/www/REPO/rtest/razorpay-php/src/Entity.php(59): Razorpay\Api\Request->request('POST', 'orders/', Array) #3 /var/www/REPO/rtest/razorpay-php/src/Entity.php(15): Razorpay\Api\Entity->request('POST', 'orders/', Array) #4 /var/www/REPO/rtest/razorpay-php/src/Order.php(12): Razorpay\Api\Entity->create(Array) #5 /var/www/REPO/rtest/pay.php(24): Razorpay\Api\Order->create(Array) #6 {main} thrown in /var/www/REPO/rtest/razorpay-php/src/Request.php on line 123

why i m getting this error?

Fatal error: Uncaught exception 'Requests_Exception' with message 'stream_socket_client(): SSL: The operation completed successfully.' in C:\wamp\www\Food-order\razorpay-php-testapp-master\razorpay-php\libs\Requests-1.6.1\library\Requests\Transport\fsockopen.php on line 364

Issue in verify.php file

The default value $success = true;. It should be false.
This happened to us, The block, if (empty($_POST['razorpay_payment_id']) === false) was skipped because $_POST['razorpay_payment_id']) was not generated and the final block, if ($success === true) was executed.

api.razorpay.com: temporary failure in name resolution

Hello All,
I am able to get payment id from razorpay front end, bu when I trying to capture the payment with java api I am getting this error:
api.razorpay.com: temporary failure in name resolution.
I am testing it from test mode and key. Do I need to test with Live credentials?
I googled but didn't find any help.
Please help.

Thanks in advance.

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.