@paypal/checkout-components 5.0.284-alpha.0 → 5.0.285
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/__sdk__.js +0 -4
- package/package.json +1 -1
- package/src/zoid/checkout/component.jsx +43 -14
- package/src/zoid/content.js +167 -151
- package/src/zoid/venmo/component.jsx +4 -7
package/__sdk__.js
CHANGED
package/package.json
CHANGED
|
@@ -27,7 +27,11 @@ import {
|
|
|
27
27
|
inlineMemoize,
|
|
28
28
|
} from "@krakenjs/belter/src";
|
|
29
29
|
import { FUNDING } from "@paypal/sdk-constants/src";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
SpinnerPage,
|
|
32
|
+
Overlay,
|
|
33
|
+
VenmoOverlay,
|
|
34
|
+
} from "@paypal/common-components/src";
|
|
31
35
|
|
|
32
36
|
import { getSessionID } from "../../lib";
|
|
33
37
|
import { containerContent } from "../content";
|
|
@@ -81,20 +85,38 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
81
85
|
const {
|
|
82
86
|
nonce,
|
|
83
87
|
locale: { lang },
|
|
88
|
+
fundingSource,
|
|
84
89
|
} = props;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
const isVenmo = fundingSource === FUNDING.VENMO;
|
|
91
|
+
const browserLanguage = isVenmo ? "en" : lang;
|
|
92
|
+
const content = containerContent(fundingSource)[browserLanguage];
|
|
93
|
+
if (isVenmo) {
|
|
94
|
+
return (
|
|
95
|
+
<VenmoOverlay
|
|
96
|
+
context={context}
|
|
97
|
+
close={close}
|
|
98
|
+
focus={focus}
|
|
99
|
+
event={event}
|
|
100
|
+
frame={frame}
|
|
101
|
+
prerenderFrame={prerenderFrame}
|
|
102
|
+
content={content}
|
|
103
|
+
nonce={nonce}
|
|
104
|
+
/>
|
|
105
|
+
).render(dom({ doc }));
|
|
106
|
+
} else {
|
|
107
|
+
return (
|
|
108
|
+
<Overlay
|
|
109
|
+
context={context}
|
|
110
|
+
close={close}
|
|
111
|
+
focus={focus}
|
|
112
|
+
event={event}
|
|
113
|
+
frame={frame}
|
|
114
|
+
prerenderFrame={prerenderFrame}
|
|
115
|
+
content={content}
|
|
116
|
+
nonce={nonce}
|
|
117
|
+
/>
|
|
118
|
+
).render(dom({ doc }));
|
|
119
|
+
}
|
|
98
120
|
},
|
|
99
121
|
|
|
100
122
|
props: {
|
|
@@ -197,6 +219,7 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
197
219
|
type: "string",
|
|
198
220
|
queryParam: true,
|
|
199
221
|
default: () => FUNDING.PAYPAL,
|
|
222
|
+
allowDelegate: true,
|
|
200
223
|
},
|
|
201
224
|
|
|
202
225
|
standaloneFundingSource: {
|
|
@@ -288,6 +311,12 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
288
311
|
required: false,
|
|
289
312
|
queryParam: true,
|
|
290
313
|
},
|
|
314
|
+
|
|
315
|
+
sign_out_user: {
|
|
316
|
+
type: "boolean",
|
|
317
|
+
queryParam: true,
|
|
318
|
+
required: false,
|
|
319
|
+
},
|
|
291
320
|
},
|
|
292
321
|
|
|
293
322
|
dimensions: ({ props }) => {
|
package/src/zoid/content.js
CHANGED
|
@@ -1,162 +1,178 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/* eslint max-lines: 0 */
|
|
3
3
|
|
|
4
|
-
import { LANG } from "@paypal/sdk-constants/src";
|
|
4
|
+
import { LANG, FUNDING } from "@paypal/sdk-constants/src";
|
|
5
5
|
|
|
6
6
|
type ContentMap = {
|
|
7
7
|
[$Values<typeof LANG>]: {|
|
|
8
8
|
windowMessage?: string,
|
|
9
9
|
continueMessage?: string,
|
|
10
|
+
cancelMessage?: string,
|
|
11
|
+
interrogativeMessage?: string,
|
|
10
12
|
|},
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
export const containerContent: (string) => ContentMap = (fundingSource) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
15
|
+
export const containerContent: (string) => ContentMap = (fundingSource) => {
|
|
16
|
+
if (fundingSource === FUNDING.VENMO) {
|
|
17
|
+
return {
|
|
18
|
+
en: {
|
|
19
|
+
windowMessage:
|
|
20
|
+
"Tap cancel payment to cancel and return to the business. Continue payment will relaunch the payment window.",
|
|
21
|
+
continueMessage: "Continue payment",
|
|
22
|
+
cancelMessage: "Cancel payment",
|
|
23
|
+
interrogativeMessage: "What would you like to do?",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
} else {
|
|
27
|
+
return {
|
|
28
|
+
ar: {
|
|
29
|
+
windowMessage: `لا ترى متصفح ${fundingSource} الآمن؟ سنساعدك في إعادة فتح النافذة لاستكمال مشترياتك`,
|
|
30
|
+
continueMessage: `متابعة`,
|
|
31
|
+
},
|
|
32
|
+
bg: {
|
|
33
|
+
windowMessage: `Не виждате защитения браузър на ${fundingSource}? Ще ви помогнем да отворите отново прозореца, за да завършите покупката си`,
|
|
34
|
+
continueMessage: `Щракнете, за да продължите`,
|
|
35
|
+
},
|
|
36
|
+
cs: {
|
|
37
|
+
windowMessage: `Nezobrazuje se vám bezpečný prohlížeč ${fundingSource}? Pomůžeme vám okno znovu otevřít, abyste mohli nákup dokončit`,
|
|
38
|
+
continueMessage: `Pokračovat`,
|
|
39
|
+
},
|
|
40
|
+
da: {
|
|
41
|
+
windowMessage: `Kan du ikke se ${fundingSource}s sikre browser? Vi hjælper dig med at genstarte vinduet, så du kan betale`,
|
|
42
|
+
continueMessage: `Fortsæt`,
|
|
43
|
+
},
|
|
44
|
+
de: {
|
|
45
|
+
windowMessage: `Sie sehen das sichere Browserfenster von ${fundingSource} nicht? Hier können Sie es wieder öffnen und Ihren Einkauf abschließen`,
|
|
46
|
+
continueMessage: `Weiter`,
|
|
47
|
+
},
|
|
48
|
+
el: {
|
|
49
|
+
windowMessage: `Δεν βλέπετε το ασφαλές πρόγραμμα περιήγησης ${fundingSource}; Θα σας βοηθήσουμε να επανεκκινήσετε το παράθυρο για να ολοκληρώσετε την αγορά σας`,
|
|
50
|
+
continueMessage: `Συνέχεια`,
|
|
51
|
+
},
|
|
52
|
+
en: {
|
|
53
|
+
windowMessage: `Don’t see the secure ${fundingSource} browser? We’ll help you re-launch the window to complete your purchase`,
|
|
54
|
+
continueMessage: `Click to Continue`,
|
|
55
|
+
},
|
|
56
|
+
es: {
|
|
57
|
+
windowMessage: `¿No ve el navegador seguro de ${fundingSource}? Abriremos la ventana nuevamente para que pueda completar su compra`,
|
|
58
|
+
continueMessage: `Continuar`,
|
|
59
|
+
},
|
|
60
|
+
et: {
|
|
61
|
+
windowMessage: `Kas te ei näe turvalist ${fundingSource}i lehitsejat? Aitame teil ostu lõpuleviimiseks akna uuesti avada.`,
|
|
62
|
+
continueMessage: `Jätkamiseks klõpsake`,
|
|
63
|
+
},
|
|
64
|
+
fi: {
|
|
65
|
+
windowMessage: `Eikö suojattua ${fundingSource}-selainta näy? Autamme avaamaan ikkunan uudelleen oston viimeistelyä varten`,
|
|
66
|
+
continueMessage: `Jatka`,
|
|
67
|
+
},
|
|
68
|
+
fr: {
|
|
69
|
+
windowMessage: `Le navigateur sécurisé de ${fundingSource} n’apparaît pas ? Nous allons vous aider à rouvrir la fenêtre pour finaliser votre achat`,
|
|
70
|
+
continueMessage: `Continuer`,
|
|
71
|
+
},
|
|
72
|
+
he: {
|
|
73
|
+
windowMessage: `לא רואה את דפדפן ${fundingSource} המאובטח? נעזור לך לפתוח מחדש את החלון כדי להשלים את הקנייה שלך`,
|
|
74
|
+
continueMessage: `המשך`,
|
|
75
|
+
},
|
|
76
|
+
hu: {
|
|
77
|
+
windowMessage: `Nem látja a biztonságos ${fundingSource}-böngészőt? Segítünk újra betölteni az ablakot, hogy befejezhesse a vásárlást`,
|
|
78
|
+
continueMessage: `Folytatás`,
|
|
79
|
+
},
|
|
80
|
+
id: {
|
|
81
|
+
windowMessage: `Browser ${fundingSource} yang aman tidak terlihat? Kami akan membantu menampilkan ulang jendela untuk menyelesaikan pembayaran Anda`,
|
|
82
|
+
continueMessage: `Lanjutkan`,
|
|
83
|
+
},
|
|
84
|
+
it: {
|
|
85
|
+
windowMessage: `Non vedi la pagina sicura di ${fundingSource}? Ti aiuteremo a riaprire la finestra per completare l’acquisto`,
|
|
86
|
+
continueMessage: `Continua`,
|
|
87
|
+
},
|
|
88
|
+
ja: {
|
|
89
|
+
windowMessage: `セキュアなブラウザが表示されない場合は、ウィンドウを再起動して、支払いを完了できるようお手伝いいたします`,
|
|
90
|
+
continueMessage: `続行`,
|
|
91
|
+
},
|
|
92
|
+
ko: {
|
|
93
|
+
windowMessage: `보안 ${fundingSource} 브라우저가 보이지 않으신가요? 창을 다시 실행하여 결제를 완료할 수 있도록 도와드리겠습니다`,
|
|
94
|
+
continueMessage: `계속`,
|
|
95
|
+
},
|
|
96
|
+
lt: {
|
|
97
|
+
windowMessage: `Nematote saugios „${fundingSource}“ naršyklės? Padėsime iš naujo paleisti langą, kad užbaigtumėte pirkimą`,
|
|
98
|
+
continueMessage: `Paspauskite, jei norite tęsti`,
|
|
99
|
+
},
|
|
100
|
+
lv: {
|
|
101
|
+
windowMessage: `Vai neredzat drošo ${fundingSource} pārlūkprogrammu? Mēs palīdzēsim jums atkārtoti palaist logu, lai pabeigtu pirkumu.`,
|
|
102
|
+
continueMessage: `Noklikšķiniet, lai turpinātu`,
|
|
103
|
+
},
|
|
104
|
+
ms: {
|
|
105
|
+
windowMessage: `Tidak melihat pelayar ${fundingSource} yang selamat? Kami akan membantu anda melancarkan semula tetingkap untuk melengkapkan pembelian anda`,
|
|
106
|
+
continueMessage: `Klik untuk Meneruskan`,
|
|
107
|
+
},
|
|
108
|
+
no: {
|
|
109
|
+
windowMessage: `Ser du ikke den sikre ${fundingSource}-nettleseren? Vi hjelper deg med å starte vinduet på nytt så du kan fullføre kjøpet`,
|
|
110
|
+
continueMessage: `Fortsett`,
|
|
111
|
+
},
|
|
112
|
+
nl: {
|
|
113
|
+
windowMessage: `Ziet u de beveiligde ${fundingSource}-browser niet? We helpen u het venster opnieuw te openen om uw aankoop te voltooien`,
|
|
114
|
+
continueMessage: `Doorgaan`,
|
|
115
|
+
},
|
|
116
|
+
pl: {
|
|
117
|
+
windowMessage: `Nie widzisz bezpiecznej przeglądarki ${fundingSource}? Pomożemy Ci ponownie uruchomić to okno w celu dokonania zakupu`,
|
|
118
|
+
continueMessage: `Kontynuuj`,
|
|
119
|
+
},
|
|
120
|
+
pt: {
|
|
121
|
+
windowMessage: `Não está vendo o navegador seguro do ${fundingSource}? Ajudaremos você a reabrir a janela para concluir a compra`,
|
|
122
|
+
continueMessage: `Continuar`,
|
|
123
|
+
},
|
|
124
|
+
ro: {
|
|
125
|
+
windowMessage: `Nu vezi browser-ul securizat ${fundingSource}? Te vom ajuta să lansezi din nou fereastra pentru a finaliza achiziția`,
|
|
126
|
+
continueMessage: `Dă clic pentru a continua`,
|
|
127
|
+
},
|
|
128
|
+
ru: {
|
|
129
|
+
windowMessage: `Не отображается безопасная страница ${fundingSource} в браузере? Мы поможем вам повторно загрузить окно, чтобы завершить покупку`,
|
|
130
|
+
continueMessage: `Продолжить`,
|
|
131
|
+
},
|
|
132
|
+
si: {
|
|
133
|
+
windowMessage: `ආරක්ෂිත ${fundingSource} බ්රව්සරය නොපෙනේ ද? ඔබේ මිල දී ගැනීම සම්පූර්ණ කිරීම සඳහා අපි ඔබට කවුළුව නැවත දියත් කිරීමට උපකාර කරන්නෙමු`,
|
|
134
|
+
continueMessage: `ඉදිරියට යාමට ක්ලික් කරන්න`,
|
|
135
|
+
},
|
|
136
|
+
sk: {
|
|
137
|
+
windowMessage: `Nezobrazuje sa vám zabezpečený prehliadač ${fundingSource}? Pomôžeme vám znova otvoriť okno, aby ste mohli nákup dokončiť`,
|
|
138
|
+
continueMessage: `Pokračovať`,
|
|
139
|
+
},
|
|
140
|
+
sl: {
|
|
141
|
+
windowMessage: `Ne vidite ${fundingSource}ovega varnega brskalnika? Pomagali vam bomo ponovno zagnati okno za dokončanje nakupa`,
|
|
142
|
+
continueMessage: `Kliknite za nadaljevanje`,
|
|
143
|
+
},
|
|
144
|
+
sq: {
|
|
145
|
+
windowMessage: `Nuk e shikon shfletuesin e sigurt të ${fundingSource}? Do të të ndihmojmë të rihapësh dritaren për të përfunduar blerjen`,
|
|
146
|
+
continueMessage: `Kliko për të vazhduar`,
|
|
147
|
+
},
|
|
148
|
+
sv: {
|
|
149
|
+
windowMessage: `Ser du inte den säkra ${fundingSource}-webbläsaren? Vi hjälper dig att starta om fönstret för att slutföra ditt köp`,
|
|
150
|
+
continueMessage: `Fortsätt`,
|
|
151
|
+
},
|
|
152
|
+
th: {
|
|
153
|
+
windowMessage: `ถ้าคุณไม่เห็นเบราว์เซอร์ที่มีระบบความปลอดภัยของ ${fundingSource} เราจะช่วยคุณเปิดหน้าต่างอีกครั้งเพื่อชำระเงินให้เรียบร้อย`,
|
|
154
|
+
continueMessage: `ดำเนินการต่อ`,
|
|
155
|
+
},
|
|
156
|
+
tl: {
|
|
157
|
+
windowMessage: `Hindi nakikita ang secure na ${fundingSource} browser? Tutulungan ka naming i-launch ulit ang window para makumpleto ang pagbili mo.`,
|
|
158
|
+
continueMessage: `I-click para Magpatuloy`,
|
|
159
|
+
},
|
|
160
|
+
tr: {
|
|
161
|
+
windowMessage: `Güvenli ${fundingSource} tarayıcısını görmüyor musunuz? Alışverişinizi tamamlamak için pencereyi yeniden başlatmanıza yardımcı olacağız`,
|
|
162
|
+
continueMessage: `Devam`,
|
|
163
|
+
},
|
|
164
|
+
vi: {
|
|
165
|
+
windowMessage: `Bạn không thấy trình duyệt ${fundingSource} bảo mật? Chúng tôi sẽ giúp bạn mở lại cửa sổ để hoàn tất giao dịch mua hàng`,
|
|
166
|
+
continueMessage: `Nhấp để tiếp tục`,
|
|
167
|
+
},
|
|
168
|
+
zh: {
|
|
169
|
+
windowMessage: `没有找到安全的${fundingSource}浏览器?我们将帮助您重启窗口以完成付款`,
|
|
170
|
+
continueMessage: `继续`,
|
|
171
|
+
},
|
|
172
|
+
zh_Hant: {
|
|
173
|
+
windowMessage: `看不到安全 ${fundingSource} 瀏覽器?我們會協助你重新啟動視窗,以完成購物程序`,
|
|
174
|
+
continueMessage: `按一下並繼續`,
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
inlineMemoize,
|
|
28
28
|
} from "@krakenjs/belter/src";
|
|
29
29
|
import { FUNDING } from "@paypal/sdk-constants/src";
|
|
30
|
-
import { SpinnerPage,
|
|
30
|
+
import { SpinnerPage, VenmoOverlay } from "@paypal/common-components/src";
|
|
31
31
|
|
|
32
32
|
import { getSessionID } from "../../lib";
|
|
33
33
|
import { containerContent } from "../content";
|
|
@@ -74,13 +74,10 @@ export function getVenmoCheckoutComponent(): VenmoCheckoutComponent {
|
|
|
74
74
|
prerenderFrame,
|
|
75
75
|
props,
|
|
76
76
|
}) => {
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
locale: { lang },
|
|
80
|
-
} = props;
|
|
81
|
-
const content = containerContent("Venmo")[lang];
|
|
77
|
+
const { nonce } = props;
|
|
78
|
+
const content = containerContent("venmo").en;
|
|
82
79
|
return (
|
|
83
|
-
<
|
|
80
|
+
<VenmoOverlay
|
|
84
81
|
context={context}
|
|
85
82
|
close={close}
|
|
86
83
|
focus={focus}
|