forked from vasilich6107/react-native-liqpay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
59 lines (49 loc) · 1.69 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
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
import React from 'react';
import PropTypes from 'prop-types';
import { requireNativeComponent } from 'react-native';
const RNLiqpay = requireNativeComponent('RNLiqpay', null);
const style = {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0
};
const LiqpayCheckout = props => <RNLiqpay type="checkout" style={style} {...props} />;
LiqpayCheckout.propTypes = {
// eslint-disable-next-line react/forbid-prop-types
params: PropTypes.object.isRequired,
privateKey: PropTypes.string.isRequired,
onLiqpaySuccess: PropTypes.func.isRequired,
onLiqpayError: PropTypes.func.isRequired,
};
const LiqpayCheckoutBase64 = props => <RNLiqpay type="checkoutBase64" style={style} {...props} />;
LiqpayCheckoutBase64.propTypes = {
paramsBase64: PropTypes.string.isRequired,
signature: PropTypes.string.isRequired,
onLiqpaySuccess: PropTypes.func.isRequired,
onLiqpayError: PropTypes.func.isRequired,
};
const LiqpayApi = props => <RNLiqpay type="api" style={style} {...props} />;
LiqpayApi.propTypes = {
// eslint-disable-next-line react/forbid-prop-types
params: PropTypes.object.isRequired,
path: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired,
onLiqpaySuccess: PropTypes.func.isRequired,
onLiqpayError: PropTypes.func.isRequired,
};
const LiqpayApiBase64 = props => <RNLiqpay type="apiBase64" style={style} {...props} />;
LiqpayApiBase64.propTypes = {
path: PropTypes.string.isRequired,
paramsBase64: PropTypes.string.isRequired,
signature: PropTypes.string.isRequired,
onLiqpaySuccess: PropTypes.func.isRequired,
onLiqpayError: PropTypes.func.isRequired,
};
module.exports = {
LiqpayCheckout,
LiqpayCheckoutBase64,
LiqpayApi,
LiqpayApiBase64,
};