@thepayulink/checkout-react-native 2.0.0 → 2.0.1
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/src/html.js +1 -1
- package/src/index.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thepayulink/checkout-react-native",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "PayuLink UPI checkout for React Native — opens a server-created order and returns the signed payment result.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
package/src/html.js
CHANGED
|
@@ -45,7 +45,7 @@ export function buildCheckoutHtml(o) {
|
|
|
45
45
|
const src = o.scriptUrl || CHECKOUT_SCRIPT_URL;
|
|
46
46
|
return `<!doctype html>
|
|
47
47
|
<html><head><meta charset="utf-8">
|
|
48
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1
|
|
48
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
49
49
|
<style>html,body{margin:0;min-height:100%;background:#0b1f33;}</style>
|
|
50
50
|
<script src="${attr(src)}"></script>
|
|
51
51
|
</head><body>
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// running the published PayuLink web checkout (the same script websites use), so the UPI QR,
|
|
4
4
|
// app hand-off, test mode and the signed result all behave exactly as on the web.
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { Modal, View, ActivityIndicator, StyleSheet, BackHandler, Platform, Linking } from 'react-native';
|
|
6
|
+
import { Modal, View, SafeAreaView, ActivityIndicator, StyleSheet, BackHandler, Platform, Linking } from 'react-native';
|
|
7
7
|
import { WebView } from 'react-native-webview';
|
|
8
8
|
import { buildCheckoutHtml, DEFAULT_API_BASE, CHECKOUT_SCRIPT_URL, APP_LINK } from './html';
|
|
9
9
|
|
|
@@ -133,7 +133,8 @@ export default function PayuLinkCheckout(props) {
|
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
135
|
<Modal visible={visible} animationType="slide" transparent={false} onRequestClose={() => onDismiss && onDismiss()}>
|
|
136
|
-
|
|
136
|
+
{/* SafeAreaView keeps the checkout's header (merchant, amount) clear of the notch / Dynamic Island. */}
|
|
137
|
+
<SafeAreaView style={[styles.fill, style]}>
|
|
137
138
|
<WebView
|
|
138
139
|
source={{ html, baseUrl: 'https://payulink.io' }}
|
|
139
140
|
originWhitelist={['*']}
|
|
@@ -155,7 +156,7 @@ export default function PayuLinkCheckout(props) {
|
|
|
155
156
|
onError={(e) => onError && onError(checkoutError(
|
|
156
157
|
(e && e.nativeEvent && e.nativeEvent.description) || 'Could not load the checkout.', 'WEBVIEW_ERROR', true))}
|
|
157
158
|
/>
|
|
158
|
-
</
|
|
159
|
+
</SafeAreaView>
|
|
159
160
|
</Modal>
|
|
160
161
|
);
|
|
161
162
|
}
|