elpaypg 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/css/checkout.css +36 -0
- package/public/elpay-checkout.js +11 -2
- package/public/views/checkout.html +1 -1
- package/src/router.js +17 -0
package/package.json
CHANGED
package/public/css/checkout.css
CHANGED
|
@@ -2730,6 +2730,42 @@
|
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
2732
|
|
|
2733
|
+
/* NARROW DESKTOP (iframe width 768-1099px)
|
|
2734
|
+
The branding sidebar (310px) + methods rail (220px) together eat 530px of a
|
|
2735
|
+
~900px modal, leaving too little for the QR workspace, which then gets clipped
|
|
2736
|
+
by the wrapper's overflow:hidden. Reclaim the branding panel and slim the rail
|
|
2737
|
+
so the right-hand column always fits. */
|
|
2738
|
+
@media (min-width: 768px) and (max-width: 1099px) {
|
|
2739
|
+
.ypg-pc-sidebar {
|
|
2740
|
+
display: none !important;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
.ypg-pc-methods-list {
|
|
2744
|
+
width: 190px !important;
|
|
2745
|
+
min-width: 190px !important;
|
|
2746
|
+
max-width: 190px !important;
|
|
2747
|
+
flex-shrink: 0 !important;
|
|
2748
|
+
padding: 12px 10px !important;
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
.ypg-pc-active-view {
|
|
2752
|
+
padding: 14px 18px !important;
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/* Very narrow desktop: let the QR card wrap instead of overflowing. */
|
|
2757
|
+
@media (min-width: 768px) and (max-width: 880px) {
|
|
2758
|
+
.ypg-pc-active-view {
|
|
2759
|
+
padding: 12px 14px !important;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
.ypg-qr-card-container {
|
|
2763
|
+
flex-wrap: wrap !important;
|
|
2764
|
+
justify-content: center !important;
|
|
2765
|
+
gap: 12px !important;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2733
2769
|
/* MOBILE SPECIFIC RULES - PINNED HEADER WITH CONTENT SCROLLING BEHIND IT */
|
|
2734
2770
|
@media (max-width: 767px) {
|
|
2735
2771
|
.ypg-pc-sidebar {
|
package/public/elpay-checkout.js
CHANGED
|
@@ -704,9 +704,9 @@
|
|
|
704
704
|
/* DESKTOP / PC MODAL STYLES (Razorpay 2-Column Exact Layout) */
|
|
705
705
|
@media (min-width: 768px) {
|
|
706
706
|
.elpay-checkout-container {
|
|
707
|
-
width:
|
|
707
|
+
width: 960px;
|
|
708
708
|
max-width: 95vw;
|
|
709
|
-
height:
|
|
709
|
+
height: 620px;
|
|
710
710
|
max-height: 92vh;
|
|
711
711
|
border-radius: 16px;
|
|
712
712
|
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
|
|
@@ -716,6 +716,15 @@
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
+
/* Large desktop: give the branding sidebar room so the QR workspace keeps
|
|
720
|
+
full width. Below this breakpoint the checkout hides the sidebar instead. */
|
|
721
|
+
@media (min-width: 1200px) {
|
|
722
|
+
.elpay-checkout-container {
|
|
723
|
+
width: 1100px;
|
|
724
|
+
height: 660px;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
719
728
|
/* MOBILE BOTTOM DRAWER / BOTTOM SHEET STYLES */
|
|
720
729
|
@media (max-width: 767px) {
|
|
721
730
|
.elpay-checkout-backdrop {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
7
7
|
<title>{{MERCHANT_NAME}} · {{APP_NAME}} Checkout</title>
|
|
8
|
-
<link rel="stylesheet" href="/css/checkout.css">
|
|
8
|
+
<link rel="stylesheet" href="/css/checkout.css?v={{CSS_VERSION}}">
|
|
9
9
|
</head>
|
|
10
10
|
|
|
11
11
|
<body>
|
package/src/router.js
CHANGED
|
@@ -97,6 +97,22 @@ export function createRouter(ctx = {}) {
|
|
|
97
97
|
return router;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Reads the installed package version so static assets can be cache-busted.
|
|
102
|
+
* Without this a merchant browser can keep serving a stale checkout stylesheet
|
|
103
|
+
* after the package is upgraded, which silently re-introduces old layout bugs.
|
|
104
|
+
*/
|
|
105
|
+
function readPackageVersion() {
|
|
106
|
+
try {
|
|
107
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
108
|
+
return String(pkg.version || '0.0.0');
|
|
109
|
+
} catch {
|
|
110
|
+
return '0.0.0';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const ASSET_VERSION = readPackageVersion();
|
|
115
|
+
|
|
100
116
|
function renderCheckoutPage(ctx, paymentId, state) {
|
|
101
117
|
const template = loadTemplateWithPartials();
|
|
102
118
|
const values = {
|
|
@@ -105,6 +121,7 @@ function renderCheckoutPage(ctx, paymentId, state) {
|
|
|
105
121
|
APP_NAME: state?.branding?.appName || 'ELPAY PG',
|
|
106
122
|
MERCHANT_NAME: state?.merchantName || 'Merchant Checkout',
|
|
107
123
|
AMOUNT: state?.amount || '0.00',
|
|
124
|
+
CSS_VERSION: ASSET_VERSION,
|
|
108
125
|
INITIAL_STATE_JSON: serializeForScript(state || {})
|
|
109
126
|
};
|
|
110
127
|
return renderTemplate(template, values);
|