@jimrising/easymerchantsdk-react-native 1.8.1 → 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 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.1"
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
- const setupIOS = async () => {
148
- if (Platform.OS === 'ios') {
149
- try {
150
- await EasyMerchantSdk.setViewController();
151
- await EasyMerchantSdk.configureEnvironment(
152
- environment,
153
- 'apiKey',
154
- 'secretKey'
155
- );
156
- } catch (err) {
157
- console.error('iOS Initialization Error:', err);
158
- }
159
- }
160
- };
161
- setupIOS();
162
- }, [environment]);
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) {
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.8.1'
3
+ s.version = '1.8.2'
4
4
  s.summary = 'A React Native SDK for Easy Merchant.'
5
5
  s.description = <<-DESC
6
6
  A React Native SDK to enable Easy Merchant functionality in mobile applications.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimrising/easymerchantsdk-react-native",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {