elpaypg 2.1.0 → 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 +75 -0
- package/public/elpay-checkout.js +11 -2
- package/public/elpay.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
|
@@ -2532,9 +2532,12 @@
|
|
|
2532
2532
|
display: flex !important;
|
|
2533
2533
|
flex-direction: row !important;
|
|
2534
2534
|
flex: 1 !important;
|
|
2535
|
+
width: 100% !important;
|
|
2536
|
+
max-width: 100% !important;
|
|
2535
2537
|
height: 100% !important;
|
|
2536
2538
|
max-height: 100% !important;
|
|
2537
2539
|
min-height: 0 !important;
|
|
2540
|
+
min-width: 0 !important;
|
|
2538
2541
|
overflow: hidden !important;
|
|
2539
2542
|
}
|
|
2540
2543
|
|
|
@@ -2691,6 +2694,78 @@
|
|
|
2691
2694
|
}
|
|
2692
2695
|
}
|
|
2693
2696
|
|
|
2697
|
+
/* NARROW DESKTOP (iframe width 768-1099px)
|
|
2698
|
+
The branding sidebar (310px) + methods rail (220px) together eat 530px of a
|
|
2699
|
+
~900px modal, leaving too little for the QR workspace, which then gets clipped
|
|
2700
|
+
by the wrapper's overflow:hidden. Reclaim the branding panel and slim the rail
|
|
2701
|
+
so the right-hand column always fits. */
|
|
2702
|
+
@media (min-width: 768px) and (max-width: 1099px) {
|
|
2703
|
+
.ypg-pc-sidebar {
|
|
2704
|
+
display: none !important;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
.ypg-pc-methods-list {
|
|
2708
|
+
width: 190px !important;
|
|
2709
|
+
min-width: 190px !important;
|
|
2710
|
+
max-width: 190px !important;
|
|
2711
|
+
flex-shrink: 0 !important;
|
|
2712
|
+
padding: 12px 10px !important;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
.ypg-pc-active-view {
|
|
2716
|
+
padding: 14px 18px !important;
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
/* Very narrow desktop: let the QR card wrap instead of overflowing. */
|
|
2721
|
+
@media (min-width: 768px) and (max-width: 880px) {
|
|
2722
|
+
.ypg-pc-active-view {
|
|
2723
|
+
padding: 12px 14px !important;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
.ypg-qr-card-container {
|
|
2727
|
+
flex-wrap: wrap !important;
|
|
2728
|
+
justify-content: center !important;
|
|
2729
|
+
gap: 12px !important;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
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
|
+
|
|
2694
2769
|
/* MOBILE SPECIFIC RULES - PINNED HEADER WITH CONTENT SCROLLING BEHIND IT */
|
|
2695
2770
|
@media (max-width: 767px) {
|
|
2696
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 {
|
package/public/elpay.js
CHANGED
|
@@ -710,9 +710,9 @@
|
|
|
710
710
|
/* DESKTOP / PC MODAL STYLES (Razorpay 2-Column Exact Layout) */
|
|
711
711
|
@media (min-width: 768px) {
|
|
712
712
|
.elpay-checkout-container {
|
|
713
|
-
width:
|
|
713
|
+
width: 960px;
|
|
714
714
|
max-width: 95vw;
|
|
715
|
-
height:
|
|
715
|
+
height: 620px;
|
|
716
716
|
max-height: 92vh;
|
|
717
717
|
border-radius: 16px;
|
|
718
718
|
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
|
|
@@ -722,6 +722,15 @@
|
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
+
/* Large desktop: give the branding sidebar room so the QR workspace keeps
|
|
726
|
+
full width. Below this breakpoint the checkout hides the sidebar instead. */
|
|
727
|
+
@media (min-width: 1200px) {
|
|
728
|
+
.elpay-checkout-container {
|
|
729
|
+
width: 1100px;
|
|
730
|
+
height: 660px;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
725
734
|
/* MOBILE BOTTOM DRAWER / BOTTOM SHEET STYLES */
|
|
726
735
|
@media (max-width: 767px) {
|
|
727
736
|
.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);
|