omnipay-reactnative-sdk 1.2.7 → 1.2.8
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 +1 -0
- package/lib/commonjs/components/views/PaymentLinking.js +3 -2
- package/lib/commonjs/components/views/PaymentLinking.js.map +1 -1
- package/lib/module/components/views/PaymentLinking.js +3 -2
- package/lib/module/components/views/PaymentLinking.js.map +1 -1
- package/lib/typescript/components/OmnipayView.d.ts +2 -1
- package/lib/typescript/components/OmnipayView.d.ts.map +1 -1
- package/lib/typescript/components/views/PaymentLinking.d.ts +2 -1
- package/lib/typescript/components/views/PaymentLinking.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/views/PaymentLinking.tsx +4 -2
package/README.md
CHANGED
|
@@ -225,6 +225,7 @@ import { Omnipay } from 'omnipay-reactnative-sdk';
|
|
|
225
225
|
| publicKey | String | public key of the company on omnipay |
|
|
226
226
|
| phoneNumber | String | phone number of the customer (required if customerRef not provided) |
|
|
227
227
|
| customerRef | String | customer reference of the customer (required if phoneNumber not provided) |
|
|
228
|
+
| userRef | String | user reference of the customer (if phoneNumber/customer ref not provided) |
|
|
228
229
|
| amount | Number | amount to be linked for payment in kobo |
|
|
229
230
|
| sessionId | String | unique session identifier |
|
|
230
231
|
| orderId | String | order identifier |
|
|
@@ -15,6 +15,7 @@ const PaymentLinking = ({
|
|
|
15
15
|
publicKey,
|
|
16
16
|
phoneNumber,
|
|
17
17
|
customerRef,
|
|
18
|
+
userRef,
|
|
18
19
|
amount,
|
|
19
20
|
sessionId,
|
|
20
21
|
orderId,
|
|
@@ -34,7 +35,7 @@ const PaymentLinking = ({
|
|
|
34
35
|
}
|
|
35
36
|
function getWebUrl() {
|
|
36
37
|
const themeColor = color.includes('#') ? color.split('#')[1] : color;
|
|
37
|
-
return `${webHost}order/create?theme=${themeColor}&publicKey=${publicKey}&phoneNumber=${phoneNumber || ''}&customerRef=${customerRef || ''}&amountPending=${amount}&sessionId=${sessionId || ''}&orderId=${orderId || ''}`;
|
|
38
|
+
return `${webHost}order/create?theme=${themeColor}&publicKey=${publicKey}&phoneNumber=${phoneNumber || ''}&customerRef=${customerRef || ''}&amountPending=${amount}&sessionId=${sessionId || ''}&orderId=${orderId || ''}&userRef=${userRef || ''}`;
|
|
38
39
|
}
|
|
39
40
|
async function onWebviewMessage(e) {
|
|
40
41
|
try {
|
|
@@ -67,7 +68,7 @@ const PaymentLinking = ({
|
|
|
67
68
|
if (!['dev', 'prod'].includes(env)) {
|
|
68
69
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Invalid environment");
|
|
69
70
|
}
|
|
70
|
-
if (!customerRef) {
|
|
71
|
+
if (!customerRef && !userRef) {
|
|
71
72
|
if (!phoneNumber) {
|
|
72
73
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Phone number is required");
|
|
73
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_config","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PaymentLinking","color","env","publicKey","phoneNumber","customerRef","amount","sessionId","orderId","onClose","onPaymentLinkingSuccessful","webviewRef","useRef","webviewStatus","setWebviewStatus","useState","webHost","getWebHost","webUrl","getWebUrl","onWebviewMount","Platform","OS","serverSdkBaseUrl","themeColor","includes","split","onWebviewMessage","nativeEvent","data","eventData","JSON","parse","dataKey","error","createElement","Text","length","isNaN","Number","Fragment","View","style","styles","full","WebView","source","uri","webview","injectedJavaScriptBeforeContentLoaded","onMessage","ref","onLoadEnd","webviewLoader","ActivityIndicator","size","exports","StyleSheet","create","hide","display","flex","width","height","zIndex","backgroundColor","alignItems","justifyContent","position","top","left"],"sourceRoot":"../../../../src","sources":["components/views/PaymentLinking.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAoD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_config","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PaymentLinking","color","env","publicKey","phoneNumber","customerRef","userRef","amount","sessionId","orderId","onClose","onPaymentLinkingSuccessful","webviewRef","useRef","webviewStatus","setWebviewStatus","useState","webHost","getWebHost","webUrl","getWebUrl","onWebviewMount","Platform","OS","serverSdkBaseUrl","themeColor","includes","split","onWebviewMessage","nativeEvent","data","eventData","JSON","parse","dataKey","error","createElement","Text","length","isNaN","Number","Fragment","View","style","styles","full","WebView","source","uri","webview","injectedJavaScriptBeforeContentLoaded","onMessage","ref","onLoadEnd","webviewLoader","ActivityIndicator","size","exports","StyleSheet","create","hide","display","flex","width","height","zIndex","backgroundColor","alignItems","justifyContent","position","top","left"],"sourceRoot":"../../../../src","sources":["components/views/PaymentLinking.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAoD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,C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ACvD,KAAK,EAAEA;EAAM,CAAE,CAC3C,CAEJ,CACE,CAAC;AAEf,CAAC;AAACwD,OAAA,CAAAzD,cAAA,GAAAA,cAAA;AAEF,MAAM4C,MAAM,GAAGc,uBAAU,CAACC,MAAM,CAAC;EAC/BC,IAAI,EAAE;IACJC,OAAO,EAAE;EACX,CAAC;EACDhB,IAAI,EAAE;IACJiB,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDf,OAAO,EAAE;IACPa,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDV,aAAa,EAAE;IACbW,MAAM,EAAE,CAAC;IACTC,eAAe,EAAE,OAAO;IACxBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBN,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdK,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ export const PaymentLinking = ({
|
|
|
8
8
|
publicKey,
|
|
9
9
|
phoneNumber,
|
|
10
10
|
customerRef,
|
|
11
|
+
userRef,
|
|
11
12
|
amount,
|
|
12
13
|
sessionId,
|
|
13
14
|
orderId,
|
|
@@ -27,7 +28,7 @@ export const PaymentLinking = ({
|
|
|
27
28
|
}
|
|
28
29
|
function getWebUrl() {
|
|
29
30
|
const themeColor = color.includes('#') ? color.split('#')[1] : color;
|
|
30
|
-
return `${webHost}order/create?theme=${themeColor}&publicKey=${publicKey}&phoneNumber=${phoneNumber || ''}&customerRef=${customerRef || ''}&amountPending=${amount}&sessionId=${sessionId || ''}&orderId=${orderId || ''}`;
|
|
31
|
+
return `${webHost}order/create?theme=${themeColor}&publicKey=${publicKey}&phoneNumber=${phoneNumber || ''}&customerRef=${customerRef || ''}&amountPending=${amount}&sessionId=${sessionId || ''}&orderId=${orderId || ''}&userRef=${userRef || ''}`;
|
|
31
32
|
}
|
|
32
33
|
async function onWebviewMessage(e) {
|
|
33
34
|
try {
|
|
@@ -60,7 +61,7 @@ export const PaymentLinking = ({
|
|
|
60
61
|
if (!['dev', 'prod'].includes(env)) {
|
|
61
62
|
return /*#__PURE__*/React.createElement(Text, null, "Invalid environment");
|
|
62
63
|
}
|
|
63
|
-
if (!customerRef) {
|
|
64
|
+
if (!customerRef && !userRef) {
|
|
64
65
|
if (!phoneNumber) {
|
|
65
66
|
return /*#__PURE__*/React.createElement(Text, null, "Phone number is required");
|
|
66
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Fragment","useRef","useState","ActivityIndicator","Platform","StyleSheet","Text","View","WebView","serverSdkBaseUrl","PaymentLinking","color","env","publicKey","phoneNumber","customerRef","amount","sessionId","orderId","onClose","onPaymentLinkingSuccessful","webviewRef","webviewStatus","setWebviewStatus","webHost","getWebHost","webUrl","getWebUrl","onWebviewMount","OS","themeColor","includes","split","onWebviewMessage","e","nativeEvent","data","eventData","JSON","parse","dataKey","error","createElement","length","isNaN","Number","style","styles","full","source","uri","webview","injectedJavaScriptBeforeContentLoaded","onMessage","ref","onLoadEnd","webviewLoader","size","create","hide","display","flex","width","height","zIndex","backgroundColor","alignItems","justifyContent","position","top","left"],"sourceRoot":"../../../../src","sources":["components/views/PaymentLinking.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzD,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,OAAO,QAAkC,sBAAsB;AACxE,SAASC,gBAAgB,QAAQ,kBAAkB;
|
|
1
|
+
{"version":3,"names":["React","Fragment","useRef","useState","ActivityIndicator","Platform","StyleSheet","Text","View","WebView","serverSdkBaseUrl","PaymentLinking","color","env","publicKey","phoneNumber","customerRef","userRef","amount","sessionId","orderId","onClose","onPaymentLinkingSuccessful","webviewRef","webviewStatus","setWebviewStatus","webHost","getWebHost","webUrl","getWebUrl","onWebviewMount","OS","themeColor","includes","split","onWebviewMessage","e","nativeEvent","data","eventData","JSON","parse","dataKey","error","createElement","length","isNaN","Number","style","styles","full","source","uri","webview","injectedJavaScriptBeforeContentLoaded","onMessage","ref","onLoadEnd","webviewLoader","size","create","hide","display","flex","width","height","zIndex","backgroundColor","alignItems","justifyContent","position","top","left"],"sourceRoot":"../../../../src","sources":["components/views/PaymentLinking.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzD,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,OAAO,QAAkC,sBAAsB;AACxE,SAASC,gBAAgB,QAAQ,kBAAkB;AAkBnD,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC7BC,KAAK;EACLC,GAAG;EACHC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,OAAO;EACPC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,OAAO;EACPC;AACY,CAAC,KAAwB;EACrC,MAAMC,UAAU,GAAGrB,MAAM,CAAU,IAAI,CAAC;EACxC,MAAM,CAACsB,aAAa,EAAEC,gBAAgB,CAAC,GAAGtB,QAAQ,CAAS,SAAS,CAAC;EACrE,MAAMuB,OAAO,GAAGC,UAAU,CAAC,CAAC;EAC5B,MAAMC,MAAM,GAAGC,SAAS,CAAC,CAAC;EAE1B,MAAMC,cAAc,GAAG;AACzB,4BAA4BzB,QAAQ,CAAC0B,EAAE;AACvC;AACA,OAAO;EAEL,SAASJ,UAAUA,CAAA,EAAG;IACpB,OAAOjB,gBAAgB,CAACG,GAAG,CAAC;EAC9B;EAEA,SAASgB,SAASA,CAAA,EAAG;IACnB,MAA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AAM,CAAE,CAC3C,CAEJ,CACE,CAAC;AAEf,CAAC;AAED,MAAMqC,MAAM,GAAG3C,UAAU,CAACsD,MAAM,CAAC;EAC/BC,IAAI,EAAE;IACJC,OAAO,EAAE;EACX,CAAC;EACDZ,IAAI,EAAE;IACJa,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDZ,OAAO,EAAE;IACPU,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDP,aAAa,EAAE;IACbQ,MAAM,EAAE,CAAC;IACTC,eAAe,EAAE,OAAO;IACxBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBN,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdK,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -45,12 +45,13 @@ declare const Omnipay: {
|
|
|
45
45
|
}) => void;
|
|
46
46
|
onClose?: () => void;
|
|
47
47
|
}) => React.JSX.Element;
|
|
48
|
-
PaymentLinking: ({ color, env, publicKey, phoneNumber, customerRef, amount, sessionId, orderId, onClose, onPaymentLinkingSuccessful, }: {
|
|
48
|
+
PaymentLinking: ({ color, env, publicKey, phoneNumber, customerRef, userRef, amount, sessionId, orderId, onClose, onPaymentLinkingSuccessful, }: {
|
|
49
49
|
color: string;
|
|
50
50
|
env: "dev" | "prod";
|
|
51
51
|
publicKey: string;
|
|
52
52
|
phoneNumber?: string;
|
|
53
53
|
customerRef?: string;
|
|
54
|
+
userRef?: string;
|
|
54
55
|
amount: number;
|
|
55
56
|
sessionId: string;
|
|
56
57
|
orderId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmnipayView.d.ts","sourceRoot":"","sources":["../../../src/components/OmnipayView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAiB1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAQF,QAAA,MAAM,OAAO;yFAQV,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO
|
|
1
|
+
{"version":3,"file":"OmnipayView.d.ts","sourceRoot":"","sources":["../../../src/components/OmnipayView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAiB1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAQF,QAAA,MAAM,OAAO;yFAQV,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GlC,CAAC;AAkCF,eAAe,OAAO,CAAC"}
|
|
@@ -5,12 +5,13 @@ type OmnipayProps = {
|
|
|
5
5
|
publicKey: string;
|
|
6
6
|
phoneNumber?: string;
|
|
7
7
|
customerRef?: string;
|
|
8
|
+
userRef?: string;
|
|
8
9
|
amount: number;
|
|
9
10
|
sessionId: string;
|
|
10
11
|
orderId: string;
|
|
11
12
|
onClose?: () => void;
|
|
12
13
|
onPaymentLinkingSuccessful?: () => void;
|
|
13
14
|
};
|
|
14
|
-
export declare const PaymentLinking: ({ color, env, publicKey, phoneNumber, customerRef, amount, sessionId, orderId, onClose, onPaymentLinkingSuccessful, }: OmnipayProps) => React.JSX.Element;
|
|
15
|
+
export declare const PaymentLinking: ({ color, env, publicKey, phoneNumber, customerRef, userRef, amount, sessionId, orderId, onClose, onPaymentLinkingSuccessful, }: OmnipayProps) => React.JSX.Element;
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=PaymentLinking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentLinking.d.ts","sourceRoot":"","sources":["../../../../src/components/views/PaymentLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAW1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;CACzC,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,
|
|
1
|
+
{"version":3,"file":"PaymentLinking.d.ts","sourceRoot":"","sources":["../../../../src/components/views/PaymentLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAW1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;CACzC,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,gIAY5B,YAAY,KAAG,KAAK,CAAC,GAAG,CAAC,OA6F3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ type OmnipayProps = {
|
|
|
15
15
|
publicKey: string;
|
|
16
16
|
phoneNumber?: string;
|
|
17
17
|
customerRef?: string;
|
|
18
|
+
userRef?: string;
|
|
18
19
|
amount: number;
|
|
19
20
|
sessionId: string;
|
|
20
21
|
orderId: string;
|
|
@@ -30,6 +31,7 @@ export const PaymentLinking = ({
|
|
|
30
31
|
publicKey,
|
|
31
32
|
phoneNumber,
|
|
32
33
|
customerRef,
|
|
34
|
+
userRef,
|
|
33
35
|
amount,
|
|
34
36
|
sessionId,
|
|
35
37
|
orderId,
|
|
@@ -56,7 +58,7 @@ export const PaymentLinking = ({
|
|
|
56
58
|
phoneNumber || ''
|
|
57
59
|
}&customerRef=${customerRef || ''}&amountPending=${amount}&sessionId=${
|
|
58
60
|
sessionId || ''
|
|
59
|
-
}&orderId=${orderId || ''}`;
|
|
61
|
+
}&orderId=${orderId || ''}&userRef=${userRef || ''}`;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
async function onWebviewMessage(e: WebViewMessageEvent) {
|
|
@@ -94,7 +96,7 @@ export const PaymentLinking = ({
|
|
|
94
96
|
return <Text>Invalid environment</Text>;
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
if (!customerRef) {
|
|
99
|
+
if (!customerRef && !userRef) {
|
|
98
100
|
if (!phoneNumber) {
|
|
99
101
|
return <Text>Phone number is required</Text>;
|
|
100
102
|
}
|