1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Pricing - InstaNode</ title >
7+ < script src ="https://checkout.razorpay.com/v1/checkout.js "> </ script >
8+ < style >
9+ * { box-sizing : border-box; margin : 0 ; padding : 0 ; }
10+ body {
11+ font-family : -apple-system, BlinkMacSystemFont, "Segoe UI" , sans-serif;
12+ background : # 0a0a0a ;
13+ color : # e0e0e0 ;
14+ line-height : 1.6 ;
15+ min-height : 100vh ;
16+ padding : 20px ;
17+ }
18+ .container { max-width : 600px ; margin : 0 auto; text-align : center; }
19+ h1 { margin-bottom : 40px ; }
20+ .plan {
21+ background : # 111 ;
22+ border : 1px solid # 222 ;
23+ border-radius : 8px ;
24+ padding : 20px ;
25+ margin-bottom : 20px ;
26+ }
27+ .plan h2 { margin-bottom : 10px ; }
28+ .btn {
29+ background : # 4af ;
30+ color : # 060a14 ;
31+ border : none;
32+ padding : 12px 24px ;
33+ border-radius : 8px ;
34+ font-size : 1rem ;
35+ cursor : pointer;
36+ margin-top : 10px ;
37+ }
38+ .btn : hover { background : # 66bfff ; }
39+ </ style >
40+ </ head >
41+ < body >
42+ < div class ="container ">
43+ < h1 > Choose Your Plan</ h1 >
44+ < div class ="plan ">
45+ < h2 > Monthly Plan</ h2 >
46+ < p > ₹500/month</ p >
47+ < button class ="btn " onclick ="pay('monthly') "> Subscribe Monthly</ button >
48+ </ div >
49+ < div class ="plan ">
50+ < h2 > Annual Plan</ h2 >
51+ < p > ₹5000/year</ p >
52+ < button class ="btn " onclick ="pay('annual') "> Subscribe Annual</ button >
53+ </ div >
54+ </ div >
55+ < script >
56+ async function pay ( planId ) {
57+ try {
58+ const res = await fetch ( '/billing/create-order' , {
59+ method : 'POST' ,
60+ headers : { 'Content-Type' : 'application/json' } ,
61+ body : JSON . stringify ( { plan_id : planId } )
62+ } ) ;
63+ const order = await res . json ( ) ;
64+
65+ const options = {
66+ key : order . key_id ,
67+ amount : order . amount ,
68+ currency : order . currency ,
69+ order_id : order . order_id ,
70+ name : order . name ,
71+ description : 'InstaNode Subscription' ,
72+ handler : function ( response ) {
73+ // After payment, migrate the resource
74+ const token = localStorage . getItem ( 'instanode_token' ) ;
75+ if ( token ) {
76+ fetch ( '/billing/migrate?token=' + token , { method : 'POST' } ) ;
77+ }
78+ window . location . href = '/dashboard' ;
79+ }
80+ } ;
81+ const rzp = new Razorpay ( options ) ;
82+ rzp . open ( ) ;
83+ } catch ( e ) {
84+ alert ( 'Error: ' + e . message ) ;
85+ }
86+ }
87+ </ script >
88+ </ body >
89+ </ html >
0 commit comments