Razorpay
Razorpay
-!
STEP:2
Cregte a Batken d for Pay ment Integration.
Set up your Backend using 'Node ja
Imbort Package and Conflqure Razorag i File
ThiA File
in (oot wll
b
const Razc þay = (equtre " azor pay" ) direc tory
.ehv
conAt exþres iequire (Cexbress;
exþress (); RAZDRPAY. KEYLO:
-RA20RPAY.KEY SECR
ConAt dot env = (eguire (" dot eny ; ETE
STEP:4
Veify Backend API
9 create verify Payment API. bayment
Onte the bayment is done , Razot hay sends
debails lilke: Cazor kayo derid , azor paq-ayment-id ,
(azorbag-signature
data
) to he Bhckend
to the fontent. send HiA
for verifiation.
tonst crypto require (" crypto);
abp. þost (C lveify-þayment", (reg, (eA )=>
tonat (tazerpag-oYde.td , (azol bay-paynent-id, fazorpy- signatue
eq. bodys
Const generated.signature =crypto
. Create Hmac sha256, þioceAA. env. RAZORPAY_KEX
SECRE T)
- update (razo(hay.ordes_id + T't (02ochay
digeat ("hex ");
ifC generate d-signatue J=== R (azot bas signature) 1
(eh.statuA (2.00).g Soh (
Sutegs true,
mesage: "Payment verified"
3)
felse£
fes. Status(4.06). (son (l
SUCCeSA: falße,
hessag: " Pament uerification failed
3);
3);
STEP:5
Webhok for auto na tie yeification (0pbional)
Ínst ead of elgigg on the froet end to verf fy the jayner
you can UNE Razorþay:s webhook S. Raz2D (hay will notif
Hou backend wheneyer
gour a þoyment
bayr bten.
Webhook '
3)',
STEP:6
Save the poyrmen Detals.
A6ier sÚceEM Ful vtift cation (from verify- baymerit or
webhaok
save the paymen details fo Hour Dat ban e
-ifinal Workflow '
1 FRONTEND: Usec click "PAY NÒW’sends amoun to hackend
fontend
2 BACKEND: Create a ordel’ Return odecid to
3 FRONT END: Show Razoray poboh ’ Uner makes þay ment.
+ FRaNTTEND: SErd foyment de tails foy mentid ,orderid,siqnatue
to backend.
5 8ACKEND: Veftfy Pay ment detal s and confiim sucteal fluM
6 coþtibnat) Une wes nooks fot auto-vefificaton by Rrzntk
FE BE
create ocder Backend have
Aayment Ven haion
IPAY NO
Suce0A Failure veifehon Razprhayteid,
Ragorpauj-kereite
Order_id Razoipay-we bheok
h o o k
e na
to n e ,
n e nmentordercd
re
tun
web order
id reate Order
ecret
bU
yh e r
JoPfoco +
after
broo
POyMENT keg-d, keg-secret of
Creditcard razcf pay
Debidt catd
Dther ethod
SRazor bag
Pogment
Dialog Box