Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel #180

Closed
pronet79 opened this issue Aug 5, 2020 · 2 comments
Closed

Laravel #180

pronet79 opened this issue Aug 5, 2020 · 2 comments

Comments

@pronet79
Copy link

pronet79 commented Aug 5, 2020

Hello,
I am new in laravel. Could anyone tell me where we will put the followings:

  1. Razorpay.php page
  2. Src and Test folder
    in laravel. Thanks in advance
@CirkaN
Copy link

CirkaN commented Aug 7, 2020

Firstly go to your project root and run composer installation

composer require razorpay/razorpay

Than you import class in your Controller

For example, I think it goes

use Razorpay\Api\Api;

Look at documentation for that if I am wrong, and that's it you can use it in your controller.

Happy Coding!

@pronet79
Copy link
Author

pronet79 commented Aug 9, 2020

Hello @CirkaN, I have few specific question about Razorpay. These are as follows:-

  1. If you see the URL(https://razorpay.com/docs/payment-gateway/server-integration/php/test-app/), there has a link to download Razorpay PHP Sample App. If you use this app , you will see first create an order then take payment on that order automatically and after payment it shows payment status is Captured.
    I also create the appllication using javaScript in laravel. My code is as follows:
    [var options = {
    "key": "rzp_test_XXXXXXXXXXXXXX",
    "amount": (totalAmount*100),
    "name": "AAAAA",
    "description": "BBBBBB",
    "currency": "INR",
    "receipt":"Receipt Fix static late binding #20",
    "id":lead_id,
    "status":"created",
    "image": "logo_sm.png",
    "prefill": {
    name: cfull_name,
    email:cemail,
    contact:cphone
    },
    "theme": {
    color: '#b9a76e'
    },
    "handler": function (response){
    $.ajax({
    url: 'pay',
    type: 'post',
    dataType: 'json',
    data: {
    razorpay_response:response,
    razorpay_payment_id: response.razorpay_payment_id ,
    totalAmount : totalAmount ,cfull_name : cfull_name,cphone:cphone,
    lead_id:lead_id,
    },
    success: function (msg) {
    window.location.href = 'b2';
    }
    });

     	   },
     	  "prefill": {
     		   "contact": cphone,
     		   "email": cemail,
     	   },
     	   "theme": {
     		   "color": "#528FF0"
     	   }
     	 };
     	 var rzp1 = new Razorpay(options);
     	 rzp1.open();
     	 e.preventDefault();](url)
    

It effect the payment in Transaction tab of razorpay but shows payment status not captured. It did not generate order id. I want first generate order id then payment will be occur. After payment it will show payment id and order id also.

  1. Also i want to create a functionality that from my system if i press a button then Razorpay send payment link and if payment done then it effect my application. Please help me.
    Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants