Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vandan's avatar
Level 13

How to integrate razorpay Payment gateway in laravel 5.5 ?

i am working on laravel 5.5 project

i cant understand how to integrate razorpay packages

i study some reference link but can't find solution so please give some suggestion how to integrate razorpay step by step

thank you

0 likes
9 replies
vandan's avatar
Level 13

yes i try this thanks but

when i try to get dynamic value for example

my field value 18000 but every time display 180

so how can i overcome issue

here is my javascript code

<script>
        var options = {
            key: "{{ env('RAZORPAY_KEY') }}",
            amount: '{!! ($trainingapply->fees) !!}',
            name: 'CodesCompanion',
            description: 'Fees',
            handler: demoSuccessHandler
        }
</script>

please suggest how to solved

martinbean's avatar

please give some suggestion how to integrate razorpay step by step

@van1310 No one is going to write you a step-by-step guide on how to integrate a payment gateway.

1 like
vandan's avatar
Level 13

thanks you sir

when my database value in fees 12000 but display everytime 120 so how to overcome ?

<script>
        var options = {
            key: "{{ env('RAZORPAY_KEY') }}",
            amount: '{!! ($trainingapply->fees) !!}',
            name: 'CodesCompanion',
            description: 'Fees',
            handler: demoSuccessHandler
        }
</script>

please help me out i need your help

1 like
vandan's avatar
Level 13

i Solved myself amount variable multiply by my field

here is my controller

$trainingapply = Trainingapply::where('user_id','=',$user->id)->first();
    $total = ($trainingapply->fees * 100);

here is my javascript file

<script>
        var options = {
            key: "{{ env('RAZORPAY_KEY') }}",
            amount: '{!! ($total !!}',
            name: 'CodesCompanion',
            description: 'Fees',
            handler: demoSuccessHandler
        }
</script>
yug-soni's avatar

Try to multiply the amount with 100. It will definitely work

yug-soni's avatar
var totalAmount = $total; var options = { key: "{{ env('RAZORPAY_KEY') }}", "amount": (totalAmount*100), name: 'CodesCompanion', description: 'Fees', handler: demoSuccessHandler }
Aarej's avatar

You have multiply total amount to 100 bcz razor pay use smallest value.

Please or to participate in this conversation.