Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default function TestComponent() {
amount: 100,
key: '3425dc6035d711eca8f5b92f2997955b',
sandbox: true,
reason: "A reason"
reason: "A reason",
verbose: false,
});
};

Expand Down Expand Up @@ -91,6 +92,8 @@ interface IData {
split?: string;
partnerId?: string;
reason: string;
verbose?: boolean;

}
interface ListenerData {
transactionId: string;
Expand Down
27 changes: 26 additions & 1 deletion example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const path = require('path');
const escape = require('escape-string-regexp');
const { getDefaultConfig } = require('@expo/metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const pak = require('../package.json');

const root = path.resolve(__dirname, '..');
Expand All @@ -12,6 +11,32 @@ const modules = Object.keys({

const defaultConfig = getDefaultConfig(__dirname);

// Helper function to get blacklist/exclusionList function safely
const getExclusionList = () => {
try {
// Try new metro-config v0.76+ approach
const { exclusionList } = require('metro-config');
if (typeof exclusionList === 'function') {
return exclusionList;
}
} catch (e) {
// Fall through to old approach
}

try {
// Try old metro-config approach
return require('metro-config/src/defaults/exclusionList');
} catch (e) {
// Last resort: create our own exclusionList function
return (patterns) => {
const regex = new RegExp(patterns.map((p) => p.source).join('|'));
return regex;
};
}
};

const exclusionList = getExclusionList();

module.exports = {
...defaultConfig,

Expand Down
8,048 changes: 4,049 additions & 3,999 deletions example/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"web": "expo start --web"
},
"dependencies": {
"expo": "^53.0.9",
"expo": "^54.0.0",
"expo-status-bar": "~2.2.3",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "0.79.2",
"react-native": "0.79.6",
"react-native-web": "^0.20.0"
},
"devDependencies": {
"@babel/core": "^7.27.1",
"@expo/webpack-config": "^19.0.1",
"@expo/webpack-config": "^18.0.0",
"babel-loader": "^10.0.0",
"babel-plugin-module-resolver": "^5.0.2"
},
Expand Down
18 changes: 14 additions & 4 deletions example/src/TestComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Button, View } from 'react-native';
import { Button } from 'react-native';
import { useKkiapay } from 'src/kkiapay';
import React from 'react';
import { SafeAreaView } from 'react-native-safe-area-context';

export default function TestComponent() {
const { openKkiapayWidget } = useKkiapay();
Expand All @@ -9,14 +10,23 @@ export default function TestComponent() {
openKkiapayWidget({
amount: 100,
key: 'your_api_key',
sandbox: false,
sandbox: true,
reason: 'Payment',
verbose: true,
});
};

return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<SafeAreaView style={styles.webview}>
<Button title="Pay now" onPress={openWidget} />
</View>
</SafeAreaView>
);
}

const styles = StyleSheet.create({
webview: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
Loading
Loading