@binopartner/pay-sdk 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -263,7 +263,7 @@ Every component accepts `className`, `style` and `unstyled`, forwards its ref an
263
263
  | `Quote` | Fees, amount received, ETA, slippage. |
264
264
  | `CryptoAddress` | Address, copy button, QR code (rendered locally, no image host), network warning, high-fee warning. |
265
265
  | `Requisites` | Fiat payment details: raw rows with copy buttons, or the requisites frame (see Security). `data-delivery="raw" \| "frame"`. |
266
- | `RequisitesFrame`, `ReceiptUpload`, `Countdown`, `RedirectButton`, `Onramp` | Frame, receipt upload (RU deposits in raw mode; in frame mode the receipt is uploaded inside the frame), server-clock countdown, hosted page link, onramp (`display="embed" \| "tab"`). |
266
+ | `RequisitesFrame`, `ReceiptUpload`, `Countdown`, `RedirectButton`, `Onramp` | Frame, receipt upload (RU deposits in raw mode; in frame mode the receipt is uploaded inside the frame), server-clock countdown, hosted page link, onramp link (opens Coindisco in a new tab: Coindisco frames only on the origins listed in its dashboard, so `display` and `height` are ignored). |
267
267
  | `SlippageWarning`, `SubmitButton`, `Status`, `BackButton`, `Qr` | |
268
268
  | `RestartButton`, `MethodNotice` | Cancel / new payment for card deposits (and a new withdrawal after a final status); the receipt notice under the amount for rails that may need a receipt. |
269
269
  | `DepositForm`, `WithdrawForm` | Full screens composed from the parts above, laid out like the binodex payment modal: a card with the title, the balance and a close button, the Crypto / Card tabs, the payment country and the bank tiles. Replace any piece: `<Pay.DepositForm components={{ MethodPicker: MyPicker }} />`. |
@@ -309,7 +309,7 @@ The pay API and the requisites frame are served by two regional host pairs (glob
309
309
 
310
310
  ```
311
311
  connect-src 'self' https://api.binodex.app https://api.binodex.pro;
312
- frame-src https://binodex.app https://binodex.pro https://*.onramper.com;
312
+ frame-src https://binodex.app https://binodex.pro;
313
313
  font-src https://binodex.app https://binodex.pro;
314
314
  img-src 'self' data: https:;
315
315
  ```
@@ -62,7 +62,7 @@ export const ar = {
62
62
  "qr.label": "رمز QR للدفع",
63
63
  "onramp.title": "شراء عملات رقمية",
64
64
  "onramp.open": "فتح في علامة تبويب جديدة",
65
- "onramp.disclosure": "تتم معالجة الدفع بالبطاقة عبر Onramper وشركائها من مزوّدي الخدمة. تُضاف الأموال إلى رصيد التداول الخاص بك بعد التأكيد على السلسلة.",
65
+ "onramp.disclosure": "تتم معالجة الدفع بالبطاقة بواسطة Coindisco ومزوّديه الشركاء. تُضاف الأموال إلى رصيد التداول الخاص بك بعد التأكيد على البلوكشين.",
66
66
  "address.label": "عنوان المحفظة",
67
67
  "address.placeholder": "الصق العنوان",
68
68
  "address.invalid.evm": "عنوان غير صالح: المتوقع 0x متبوعًا بـ 40 حرفًا سداسيًا عشريًا",
@@ -62,7 +62,7 @@ export const cs = {
62
62
  "qr.label": "QR kód pro platbu",
63
63
  "onramp.title": "Koupit krypto",
64
64
  "onramp.open": "Otevřít na nové kartě",
65
- "onramp.disclosure": "Platbu kartou zpracovává Onramper a jeho partnerští poskytovatelé. Prostředky budou připsány na váš obchodní zůstatek po potvrzení v blockchainu.",
65
+ "onramp.disclosure": "Platbu kartou zpracovává Coindisco a jeho partnerští poskytovatelé. Prostředky budou připsány na váš obchodní zůstatek po potvrzení v blockchainu.",
66
66
  "address.label": "Adresa peněženky",
67
67
  "address.placeholder": "Vložte adresu",
68
68
  "address.invalid.evm": "Neplatná adresa: očekává se 0x a 40 hexadecimálních znaků",
@@ -62,7 +62,7 @@ export const de = {
62
62
  "qr.label": "QR-Code für die Zahlung",
63
63
  "onramp.title": "Krypto kaufen",
64
64
  "onramp.open": "In neuem Tab öffnen",
65
- "onramp.disclosure": "Die Kartenzahlung wird von Onramper und seinen Partnern abgewickelt. Guthaben wird nach On-Chain-Bestätigung gutgeschrieben.",
65
+ "onramp.disclosure": "Die Kartenzahlung wird von Coindisco und seinen Partneranbietern abgewickelt. Das Guthaben wird Ihrem Handelskonto nach der Bestätigung in der Blockchain gutgeschrieben.",
66
66
  "address.label": "Wallet-Adresse",
67
67
  "address.placeholder": "Adresse einfügen",
68
68
  "address.invalid.evm": "Ungültige Adresse: erwartet wird 0x gefolgt von 40 Hex-Zeichen",
@@ -58,7 +58,7 @@ export const en = {
58
58
  "redirect.hint": "The payment page opens in a new tab.",
59
59
  "onramp.title": "Buy crypto",
60
60
  "onramp.open": "Open in a new tab",
61
- "onramp.disclosure": "Card payment is processed by Onramper and its provider partners. Funds are credited to your trading balance after on-chain confirmation.",
61
+ "onramp.disclosure": "Card payment is processed by Coindisco and its provider partners. Funds are credited to your trading balance after on-chain confirmation.",
62
62
  "address.label": "Wallet address",
63
63
  "address.placeholder": "Paste the address",
64
64
  "address.invalid.evm": "Invalid address: expected 0x followed by 40 hex characters",
@@ -62,7 +62,7 @@ export const es = {
62
62
  "qr.label": "Código QR para el pago",
63
63
  "onramp.title": "Comprar cripto",
64
64
  "onramp.open": "Abrir en una pestaña nueva",
65
- "onramp.disclosure": "El pago con tarjeta es procesado por Onramper y sus socios. Los fondos se acreditan tras la confirmación en la cadena.",
65
+ "onramp.disclosure": "El pago con tarjeta lo procesan Coindisco y sus proveedores asociados. Los fondos se acreditan en tu saldo de trading tras la confirmación en la blockchain.",
66
66
  "address.label": "Dirección de la billetera",
67
67
  "address.placeholder": "Pega la dirección",
68
68
  "address.invalid.evm": "Dirección no válida: se espera 0x seguido de 40 caracteres hexadecimales",
@@ -62,7 +62,7 @@ export const fr = {
62
62
  "qr.label": "Code QR du paiement",
63
63
  "onramp.title": "Acheter des cryptos",
64
64
  "onramp.open": "Ouvrir dans un nouvel onglet",
65
- "onramp.disclosure": "Le paiement par carte est traité par Onramper et ses partenaires. Les fonds sont crédités après confirmation on-chain.",
65
+ "onramp.disclosure": "Le paiement par carte est traité par Coindisco et ses prestataires partenaires. Les fonds sont crédités sur votre solde de trading après confirmation sur la blockchain.",
66
66
  "address.label": "Adresse du portefeuille",
67
67
  "address.placeholder": "Collez l'adresse",
68
68
  "address.invalid.evm": "Adresse invalide : 0x suivi de 40 caractères hexadécimaux attendu",
@@ -62,7 +62,7 @@ export const hi = {
62
62
  "qr.label": "भुगतान के लिए QR कोड",
63
63
  "onramp.title": "क्रिप्टो खरीदें",
64
64
  "onramp.open": "नए टैब में खोलें",
65
- "onramp.disclosure": "कार्ड भुगतान Onramper और उसके साझेदारों द्वारा संसाधित किया जाता है। ऑन-चेन पुष्टि के बाद राशि जमा की जाती है।",
65
+ "onramp.disclosure": "कार्ड भुगतान Coindisco और उसके पार्टनर प्रदाताओं द्वारा प्रोसेस किया जाता है। ब्लॉकचेन पर पुष्टि के बाद राशि आपके ट्रेडिंग बैलेंस में जमा कर दी जाती है।",
66
66
  "address.label": "वॉलेट पता",
67
67
  "address.placeholder": "पता पेस्ट करें",
68
68
  "address.invalid.evm": "अमान्य पता: 0x के बाद 40 हेक्स अक्षर अपेक्षित हैं",
@@ -62,7 +62,7 @@ export const it = {
62
62
  "qr.label": "Codice QR per il pagamento",
63
63
  "onramp.title": "Compra cripto",
64
64
  "onramp.open": "Apri in una nuova scheda",
65
- "onramp.disclosure": "Il pagamento con carta è elaborato da Onramper e dai suoi partner. I fondi vengono accreditati sul tuo saldo di trading dopo la conferma on-chain.",
65
+ "onramp.disclosure": "Il pagamento con carta è elaborato da Coindisco e dai suoi provider partner. I fondi vengono accreditati sul tuo saldo di trading dopo la conferma sulla blockchain.",
66
66
  "address.label": "Indirizzo del wallet",
67
67
  "address.placeholder": "Incolla l'indirizzo",
68
68
  "address.invalid.evm": "Indirizzo non valido: atteso 0x seguito da 40 caratteri esadecimali",
@@ -62,7 +62,7 @@ export const ru = {
62
62
  "qr.label": "QR-код для оплаты",
63
63
  "onramp.title": "Покупка криптовалюты",
64
64
  "onramp.open": "Открыть в новой вкладке",
65
- "onramp.disclosure": "Платёж по карте обрабатывается Onramper и его провайдер-партнёрами. Средства зачисляются на ваш торговый баланс после подтверждения в блокчейне.",
65
+ "onramp.disclosure": "Платёж по карте обрабатывается Coindisco и его провайдер-партнёрами. Средства зачисляются на ваш торговый баланс после подтверждения в блокчейне.",
66
66
  "address.label": "Адрес кошелька",
67
67
  "address.placeholder": "Вставьте адрес",
68
68
  "address.invalid.evm": "Некорректный адрес: ожидается 0x и 40 шестнадцатеричных символов",
@@ -62,7 +62,7 @@ export const tr = {
62
62
  "qr.label": "Ödeme için QR kodu",
63
63
  "onramp.title": "Kripto satın al",
64
64
  "onramp.open": "Yeni sekmede aç",
65
- "onramp.disclosure": "Kart ödemesi Onramper ve ortakları tarafından işlenir. Fonlar zincir üstü onay sonrasında hesaba yansır.",
65
+ "onramp.disclosure": "Kartla ödeme Coindisco ve iş ortağı sağlayıcıları tarafından işlenir. Fonlar, blokzincirde onaylandıktan sonra işlem bakiyenize yatırılır.",
66
66
  "address.label": "Cüzdan adresi",
67
67
  "address.placeholder": "Adresi yapıştırın",
68
68
  "address.invalid.evm": "Geçersiz adres: 0x ve ardından 40 onaltılık karakter bekleniyor",
@@ -62,7 +62,7 @@ export const ua = {
62
62
  "qr.label": "QR-код для оплати",
63
63
  "onramp.title": "Купівля криптовалюти",
64
64
  "onramp.open": "Відкрити в новій вкладці",
65
- "onramp.disclosure": "Оплата картою обробляється Onramper та його партнерами. Кошти зараховуються після підтвердження в мережі.",
65
+ "onramp.disclosure": "Платіж карткою обробляє Coindisco та його провайдери-партнери. Кошти зараховуються на ваш торговий баланс після підтвердження в блокчейні.",
66
66
  "address.label": "Адреса гаманця",
67
67
  "address.placeholder": "Вставте адресу",
68
68
  "address.invalid.evm": "Некоректна адреса: очікується 0x і 40 шістнадцяткових символів",
@@ -15,6 +15,14 @@ const RECEIPT_RULES = {
15
15
  card: { pdfOnly: true },
16
16
  phone: { pdfOnly: true },
17
17
  },
18
+ // Sakura takes a receipt only in its BT PDF account (`bt`): picker cards `c2c` and `sbp`, deposit rails
19
+ // `card@bt` and `phone@bt`. Its other rails (`card@psb`, `phone@tj`, ...) take no receipt.
20
+ sakura: {
21
+ c2c: { pdfOnly: true },
22
+ sbp: { pdfOnly: true },
23
+ "card@bt": { pdfOnly: true },
24
+ "phone@bt": { pdfOnly: true },
25
+ },
18
26
  };
19
27
  // Paylee stores the rail as `any-qr` while the picker card id is `any_qr`; both must hit the same rule.
20
28
  const normalizeMethodKey = (methodId) => methodId.replace(/-/g, "_");
@@ -1,4 +1,4 @@
1
- import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type IframeHTMLAttributes, type ReactNode } from "react";
1
+ import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
2
2
  import * as ui from "../../ui/index.js";
3
3
  import { type PartStyleProps } from "../part.js";
4
4
  type DivProps = Omit<HTMLAttributes<HTMLDivElement>, "className" | "style" | "children"> & PartStyleProps & {
@@ -50,12 +50,21 @@ export declare const RestartButton: import("react").ForwardRefExoticComponent<Om
50
50
  export declare const MethodNotice: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "style" | "children" | "className"> & ui.PartStyleProps & {
51
51
  children?: ReactNode;
52
52
  } & import("react").RefAttributes<HTMLDivElement>>;
53
- export type OnrampProps = Omit<IframeHTMLAttributes<HTMLIFrameElement>, "className" | "style" | "src"> & PartStyleProps & {
53
+ /**
54
+ * The card on-ramp is Coindisco, which lets itself be framed only on the origins
55
+ * listed in its dashboard, never on a broker's site: the session URL always
56
+ * opens in a new tab.
57
+ */
58
+ export type OnrampProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "style" | "href"> & PartStyleProps & {
59
+ /** @deprecated Ignored: the on-ramp always opens in a new tab. */
54
60
  display?: "embed" | "tab";
61
+ /** @deprecated Ignored: the on-ramp always opens in a new tab. */
55
62
  height?: number;
56
63
  };
57
- export declare const Onramp: import("react").ForwardRefExoticComponent<Omit<IframeHTMLAttributes<HTMLIFrameElement>, "style" | "src" | "className"> & ui.PartStyleProps & {
64
+ export declare const Onramp: import("react").ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "style" | "className" | "href"> & ui.PartStyleProps & {
65
+ /** @deprecated Ignored: the on-ramp always opens in a new tab. */
58
66
  display?: "embed" | "tab";
67
+ /** @deprecated Ignored: the on-ramp always opens in a new tab. */
59
68
  height?: number;
60
- } & import("react").RefAttributes<HTMLIFrameElement>>;
69
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
61
70
  export {};
@@ -249,7 +249,7 @@ export const MethodNotice = forwardRef(function MethodNotice({ className, style,
249
249
  return null;
250
250
  return (_jsx(ui.Notice, { ...rest, ref: ref, part: "method-notice", variant: "receipt", className: className, style: style, unstyled: unstyled, children: children ?? root.t("fiat.receiptMayBeNeeded") }));
251
251
  });
252
- export const Onramp = forwardRef(function Onramp({ display = "embed", height = 560, className, style, unstyled, title, ...rest }, ref) {
252
+ export const Onramp = forwardRef(function Onramp({ display: _display, height: _height, className, style, unstyled, ...rest }, ref) {
253
253
  const { root, actions, state } = useDeposit("<Pay.Onramp>");
254
254
  const active = state?.step === "onramp";
255
255
  useEffect(() => {
@@ -265,8 +265,5 @@ export const Onramp = forwardRef(function Onramp({ display = "embed", height = 5
265
265
  if (!url || !/^https:\/\//i.test(url)) {
266
266
  return state.onrampLoading ? _jsx(ui.Loader, { unstyled: unstyled }) : null;
267
267
  }
268
- if (display === "tab") {
269
- return (_jsx(ui.SubmitLink, { part: "onramp", href: url, className: className, style: style, unstyled: unstyled, "data-display": "tab", children: root.t("onramp.open") }));
270
- }
271
- return (_jsx("iframe", { title: title ?? root.t("onramp.title"), allow: "accelerometer; autoplay; camera; gyroscope; payment; clipboard-write", referrerPolicy: "no-referrer", height: height, ...rest, ref: ref, src: url, ...partProps("onramp", { className, style: { width: "100%", border: 0, ...style }, unstyled }, root.unstyled), "data-display": "embed" }));
268
+ return (_jsx(ui.SubmitLink, { ...rest, ref: ref, part: "onramp", href: url, className: className, style: style, unstyled: unstyled, "data-display": "tab", children: root.t("onramp.open") }));
272
269
  });
@@ -81,7 +81,7 @@ export const DepositForm = forwardRef(function DepositForm({ components, classNa
81
81
  body = (_jsx(ui.PayBody, { unstyled: isUnstyled, children: _jsx(c.ErrorMessage, {}) }));
82
82
  break;
83
83
  case "entry":
84
- body = (_jsxs(ui.PayBody, { unstyled: isUnstyled, children: [_jsx(c.MethodPicker, {}), fiatSelected ? (_jsxs("div", { className: isUnstyled ? undefined : "bp-rail-form", children: [_jsx(c.AmountInput, {}), _jsx(c.PhoneInput, {}), _jsx(c.MethodNotice, {}), _jsx(c.Quote, {}), _jsx(c.ErrorMessage, {}), _jsx(c.SubmitButton, {})] })) : onrampSelected ? (_jsxs("div", { className: isUnstyled ? undefined : "bp-onramp-tab", children: [_jsx(c.Onramp, {}), _jsx("p", { className: isUnstyled ? undefined : "bp-onramp-note", "data-binodex-pay": "onramp-note", children: root.t("onramp.disclosure") })] })) : (_jsx(c.ErrorMessage, {}))] }));
84
+ body = (_jsxs(ui.PayBody, { unstyled: isUnstyled, children: [_jsx(c.MethodPicker, {}), fiatSelected ? (_jsxs("div", { className: isUnstyled ? undefined : "bp-rail-form", children: [_jsx(c.AmountInput, {}), _jsx(c.PhoneInput, {}), _jsx(c.MethodNotice, {}), _jsx(c.Quote, {}), _jsx(c.ErrorMessage, {}), _jsx(c.SubmitButton, {})] })) : onrampSelected ? (_jsxs("div", { className: isUnstyled ? undefined : "bp-onramp-tab", children: [_jsx(c.Onramp, {}), state?.onrampUrl ? (_jsx("p", { className: isUnstyled ? undefined : "bp-onramp-note", "data-binodex-pay": "onramp-note", children: root.t("onramp.disclosure") })) : null] })) : (_jsx(c.ErrorMessage, {}))] }));
85
85
  break;
86
86
  case "crypto":
87
87
  body = (_jsxs(ui.PayBody, { variant: "address", unstyled: isUnstyled, children: [_jsx(ui.Divider, { unstyled: isUnstyled }), _jsxs(ui.RouteGrid, { unstyled: isUnstyled, children: [_jsx(c.CurrencyPicker, {}), _jsx(c.NetworkPicker, {})] }), _jsx(c.ErrorMessage, {}), _jsx(c.CryptoAddress, {})] }));
package/dist/elements.css CHANGED
@@ -2745,12 +2745,6 @@
2745
2745
  opacity: 0;
2746
2746
  }
2747
2747
 
2748
- .bp-onramp {
2749
- display: block;
2750
- border-radius: var(--bp-radius-sm);
2751
- background: var(--bp-color-surface);
2752
- }
2753
-
2754
2748
  .bp-onramp-tab {
2755
2749
  display: flex;
2756
2750
  flex-direction: column;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@binopartner/pay-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",