@jimrising/easymerchantsdk-react-native 1.8.0 → 1.8.2
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 +26 -17
- package/ios/Classes/EasyMerchantSdk.m +2 -2
- package/ios/easymerchantsdk.podspec +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ To add the path of sdk in your project. Open your `package.json` file and inside
|
|
|
7
7
|
|
|
8
8
|
```json
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@jimrising/easymerchantsdk-react-native": "^1.8.
|
|
10
|
+
"@jimrising/easymerchantsdk-react-native": "^1.8.2"
|
|
11
11
|
},
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -144,22 +144,31 @@ const App = () => {
|
|
|
144
144
|
const [loading, setLoading] = useState(false);
|
|
145
145
|
|
|
146
146
|
useEffect(() => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
147
|
+
const setupIOS = async () => {
|
|
148
|
+
if (Platform.OS === 'ios') {
|
|
149
|
+
try {
|
|
150
|
+
await EasyMerchantSdk.setViewController();
|
|
151
|
+
|
|
152
|
+
const iosKey = environment === 'staging'
|
|
153
|
+
? 'stagingApiKey'
|
|
154
|
+
: 'sandboxApiKey';
|
|
155
|
+
|
|
156
|
+
const iosSecret = environment === 'staging'
|
|
157
|
+
? 'stagingSecretKey'
|
|
158
|
+
: 'sandboxSecretKey';
|
|
159
|
+
|
|
160
|
+
await EasyMerchantSdk.configureEnvironment(
|
|
161
|
+
environment,
|
|
162
|
+
iosKey,
|
|
163
|
+
iosSecret
|
|
164
|
+
);
|
|
165
|
+
} catch (err) {
|
|
166
|
+
console.error('iOS Initialization Error:', err);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
setupIOS();
|
|
171
|
+
}, [environment]);
|
|
163
172
|
|
|
164
173
|
const handlePayment = async () => {
|
|
165
174
|
if (!amount || isNaN(parseFloat(amount)) || parseFloat(amount) <= 0) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
#import <React/RCTLog.h>
|
|
3
3
|
#import <React/RCTBridgeModule.h>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
//#import <easymerchantsdk-Swift.h>
|
|
6
|
+
#import <easymerchantsdk/easymerchantsdk-Swift.h>
|
|
7
7
|
|
|
8
8
|
@interface EasyMerchantSdk ()
|
|
9
9
|
@property (nonatomic, strong) EasyMerchantSdkPlugin *sdkPluginInstance;
|