@mopay/node-sdk 0.1.3 → 0.1.5

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/dist/base.js CHANGED
@@ -2,7 +2,7 @@ import { MoPayAPIError } from "./errors.js";
2
2
  const DEFAULT_BASE_URL = "https://mopay.co.ls";
3
3
  const DEFAULT_TIMEOUT_MS = 30000;
4
4
  const SDK_NAME = "@mopay/node-sdk";
5
- const SDK_VERSION = "0.1.3";
5
+ const SDK_VERSION = "0.1.5";
6
6
  export class Base {
7
7
  apiKey;
8
8
  baseUrl;
package/dist/checkout.js CHANGED
@@ -108,6 +108,10 @@ function openDialog(paymentUrl, options, controller) {
108
108
  const closeLineA = document.createElement("span");
109
109
  const closeLineB = document.createElement("span");
110
110
  const loader = document.createElement("div");
111
+ const footer = document.createElement("div");
112
+ const shield = document.createElementNS("http://www.w3.org/2000/svg", "svg");
113
+ const shieldPath = document.createElementNS("http://www.w3.org/2000/svg", "path");
114
+ const footerText = document.createElement("span");
111
115
  dialog.setAttribute("aria-label", "MoPay checkout");
112
116
  dialog.className = `mopay-checkout-dialog${options.resizable ? " is-resizable" : ""}`;
113
117
  dialog.style.setProperty("--mopay-checkout-width", toPixels(options.width || DEFAULT_DIALOG_WIDTH));
@@ -134,8 +138,20 @@ function openDialog(paymentUrl, options, controller) {
134
138
  closeButton.addEventListener("click", () => dialog.close());
135
139
  loader.className = "mopay-checkout-loader";
136
140
  loader.setAttribute("aria-hidden", "true");
141
+ shield.setAttribute("viewBox", "0 0 24 24");
142
+ shield.setAttribute("fill", "none");
143
+ shield.setAttribute("stroke", "currentColor");
144
+ shield.setAttribute("stroke-width", "2");
145
+ shield.setAttribute("stroke-linecap", "round");
146
+ shield.setAttribute("stroke-linejoin", "round");
147
+ shield.setAttribute("aria-hidden", "true");
148
+ shieldPath.setAttribute("d", "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z");
149
+ shield.append(shieldPath);
150
+ footer.className = "mopay-checkout-footer";
151
+ footerText.textContent = "powered by MoPay";
152
+ footer.append(shield, footerText);
137
153
  shell.append(loader, closeButton, frame);
138
- dialog.append(shell);
154
+ dialog.append(shell, footer);
139
155
  document.body.append(dialog);
140
156
  controller.setSource(frame.contentWindow);
141
157
  dialog.addEventListener("close", () => {
@@ -163,6 +179,8 @@ function injectDialogStyles() {
163
179
  style.id = CHECKOUT_STYLE_ID;
164
180
  style.textContent = `
165
181
  .mopay-checkout-dialog {
182
+ display: grid;
183
+ grid-template-rows: minmax(0, 1fr) 30px;
166
184
  width: min(var(--mopay-checkout-width), var(--mopay-checkout-max-width));
167
185
  height: min(var(--mopay-checkout-height), var(--mopay-checkout-max-height));
168
186
  min-width: min(var(--mopay-checkout-min-width), calc(100vw - 32px));
@@ -211,6 +229,24 @@ function injectDialogStyles() {
211
229
  opacity: 1;
212
230
  }
213
231
 
232
+ .mopay-checkout-footer {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ gap: 6px;
237
+ min-height: 30px;
238
+ background: transparent;
239
+ color: #667085;
240
+ font: 600 12px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
241
+ }
242
+
243
+ .mopay-checkout-footer svg {
244
+ width: 14px;
245
+ height: 14px;
246
+ color: #10b981;
247
+ flex: 0 0 auto;
248
+ }
249
+
214
250
  .mopay-checkout-close {
215
251
  position: absolute;
216
252
  top: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mopay/node-sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Official TypeScript SDK for the MoPay payment API.",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",