· 5 years ago · Sep 03, 2020, 12:46 PM
1import { WebView } from 'react-native-webview';
2
3...
4<WebView
5 // injectJavaScript={runFirst}
6 originWhitelist={['*']}
7 source={{
8 html: `
9 <h1>HELLOO WORLD</h1>
10 <script src="https://live.paytabs.net/theme/express_checkout/js/jquery-1.11.1.min.js"></script>
11 <script src="https://live.paytabs.net/express/express_checkout_v3.js"></script>
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13 <!-- Button Code for PayTabs Express Checkout -->
14 <div className="PT_express_checkout" />
15 <script type="text/javascript">
16 window.Paytabs("#express_checkout").expresscheckout({
17 settings: {
18 merchant_id: ${config('paytabs_merchant_id_uae')},
19 secret_key: ${config('paytabs_secret_key_uae')},
20 url_redirect: ${config('paytabs_callback_url')},
21 is_preauth: 0,
22 is_self: 0,
23 redirect_on_reject: 0,
24 order_id: ${`${userId}|${email}|/account/settings/payment-methods`},
25 tokenization: {
26 is_tokenization: 1,
27 },
28 currency: AED,
29 title: 'Attaching Card',
30 product_names: 'Attach Card',
31 style: {
32 css: 'custom',
33 linktocss:
34 'https://drive.google.com/u/0/uc?id=1fIEHxFnwFxR0wlz8fpqk96nIhR99oXjV&export=download',
35 },
36 is_iframe: {
37 load: 'onbodyload',
38 show: 1,
39 },
40 display_customer_info: 1,
41 display_billing_fields: 1,
42 display_shipping_fields: 0,
43 language: "en",
44 },
45 customer_info: {
46 first_name: '',
47 last_name: '',
48 phone_number: '111111',
49 email_address: email,
50 country_code: countryCode,
51 },
52 });
53 </script>
54 `,
55 }}
56 style={{ marginTop: 20 }}
57 onMessage={onMessage}
58 renderError={renderError}
59 />