@jimrising/easymerchantsdk-react-native 2.0.6 → 2.0.9
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 +134 -1783
- package/android/build/.transforms/15b6a8a60a6b32d0dcaf609723cf365b/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/8508f1428f740032c45a43f48b1bbe1e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1$1.dex +0 -0
- package/android/build/.transforms/8508f1428f740032c45a43f48b1bbe1e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/8508f1428f740032c45a43f48b1bbe1e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
- package/android/build/.transforms/8508f1428f740032c45a43f48b1bbe1e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/eef2d06269ef2e204b4f065513034fca/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/ffabb40f9809b32eb9546ce76fc51764/transformed/bundleLibRuntimeToDirRelease/bundleLibRuntimeToDirRelease_dex/com/reactlibrary/RNEasymerchantsdkModule$1$1.dex +0 -0
- package/android/build/.transforms/ffabb40f9809b32eb9546ce76fc51764/transformed/bundleLibRuntimeToDirRelease/bundleLibRuntimeToDirRelease_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/ffabb40f9809b32eb9546ce76fc51764/transformed/bundleLibRuntimeToDirRelease/bundleLibRuntimeToDirRelease_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
- package/android/build/.transforms/ffabb40f9809b32eb9546ce76fc51764/transformed/bundleLibRuntimeToDirRelease/bundleLibRuntimeToDirRelease_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/intermediates/aar_main_jar/release/syncReleaseLibJars/classes.jar +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_library_classes_jar/release/bundleLibCompileToJarRelease/classes.jar +0 -0
- package/android/build/intermediates/full_jar/release/createFullJarRelease/full.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +1 -1
- package/android/build/intermediates/incremental/lintVitalAnalyzeRelease/release-artifact-dependencies.xml +4 -4
- package/android/build/intermediates/incremental/lintVitalAnalyzeRelease/release-artifact-libraries.xml +4 -4
- package/android/build/intermediates/incremental/release/mergeReleaseResources/compile-file-map.properties +526 -525
- package/android/build/intermediates/incremental/release/mergeReleaseResources/merged.dir/values/values.xml +1 -1
- package/android/build/intermediates/incremental/release/mergeReleaseResources/merger.xml +3 -3
- package/android/build/intermediates/incremental/release/packageReleaseResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
- package/android/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/lint-cache/lintVitalAnalyzeRelease/maven.google/androidx/core/group-index.xml +4 -3
- package/android/build/intermediates/lint-cache/lintVitalAnalyzeRelease/maven.google/androidx/lifecycle/group-index.xml +165 -165
- package/android/build/intermediates/lint-cache/lintVitalAnalyzeRelease/maven.google/com/android/tools/build/group-index.xml +15 -15
- package/android/build/intermediates/lint-cache/lintVitalAnalyzeRelease/maven.google/master-index.xml +1 -0
- package/android/build/intermediates/lint-cache/lintVitalAnalyzeRelease/sdk_index/snapshot.gz +0 -0
- package/android/build/intermediates/lint_model/release/generateReleaseLintModel/release-artifact-dependencies.xml +4 -4
- package/android/build/intermediates/lint_model/release/generateReleaseLintModel/release-artifact-libraries.xml +4 -4
- package/android/build/intermediates/lint_vital_lint_model/release/generateReleaseLintVitalModel/release-artifact-dependencies.xml +4 -4
- package/android/build/intermediates/lint_vital_lint_model/release/generateReleaseLintVitalModel/release-artifact-libraries.xml +4 -4
- package/android/build/intermediates/local_aar_for_lint/release/out.aar +0 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/drawable/close_icon_main.xml +16 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_card_addition_ifo.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_card_billing_info.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_card_scan.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_payment_done.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_payment_done_url.xml +3 -3
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_payment_error.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_select_payment_method.xml +25 -6
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/layout/activity_verify_email.xml +1 -0
- package/android/build/intermediates/merged_res/release/mergeReleaseResources/values/values.xml +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/multi-v2/values-night-v8.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/multi-v2/values.json +102 -102
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/anim-v21.json +8 -8
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/anim.json +23 -23
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/animator-v21.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/animator.json +26 -26
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/color-night-v8.json +3 -3
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/color-v31.json +10 -10
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/color.json +153 -153
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-hdpi-v4.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-mdpi-v4.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-v21.json +3 -3
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-v23.json +7 -7
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-xhdpi-v4.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-xxhdpi-v4.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable-xxxhdpi-v4.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/drawable.json +141 -137
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/font.json +9 -9
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/interpolator-v21.json +10 -10
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/interpolator.json +11 -11
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/layout-land.json +3 -3
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/layout-sw600dp-v13.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/layout-v26.json +1 -1
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/layout.json +93 -93
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-anydpi-v26.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-hdpi-v4.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-mdpi-v4.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-xhdpi-v4.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-xxhdpi-v4.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/mipmap-xxxhdpi-v4.json +2 -2
- package/android/build/intermediates/merged_res_blame_folder/release/mergeReleaseResources/out/single/xml.json +3 -3
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/release/bundleLibRuntimeToDirRelease/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/release/bundleLibRuntimeToDirRelease/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/release/bundleLibRuntimeToDirRelease/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/release/bundleLibRuntimeToDirRelease/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/release/bundleLibRuntimeToJarRelease/classes.jar +0 -0
- package/android/build/intermediates/source_set_path_map/release/mapReleaseSourceSetPaths/file-map.txt +8 -8
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/drawable_close_icon_main.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_card_addition_ifo.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_card_billing_info.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_card_scan.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_payment_done.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_payment_done_url.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_payment_error.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_select_payment_method.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/layout_activity_verify_email.xml.flat +0 -0
- package/android/build/intermediates/verified_library_resources/release/verifyReleaseResources/compiled/values_values.arsc.flat +0 -0
- package/android/build/outputs/aar/jimrising_easymerchantsdk-react-native-release.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +10 -10
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1$1.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkPackage.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/compileReleaseJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +93 -26
- package/ios/Classes/EasyMerchantSdk.m +4 -4
- package/ios/Classes/EasyMerchantSdk.swift +116 -60
- package/ios/Classes/EasyPayViewController.swift +3 -5
- package/ios/CustomComponents/CheckboxButton.swift +66 -0
- package/ios/Helper/GrailPayHelper.swift +1 -0
- package/ios/Models/Request.swift +8 -8
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +233 -97
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +376 -104
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +28 -27
- package/ios/Pods/ViewControllers/PaymentErrorVC.swift +22 -25
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +575 -190
- package/ios/easymerchantsdk.podspec +1 -1
- package/ios/easymerchantsdk.storyboard +15 -15
- package/package.json +1 -1
|
@@ -318,80 +318,130 @@ class AdditionalInfoVC: BaseVC {
|
|
|
318
318
|
return
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
// MARK: - Flow Based on Conditions
|
|
322
|
+
// if isSavedForFuture {
|
|
323
|
+
// if selectedPaymentMethod == "NewGrailPayAccount" {
|
|
324
|
+
// // Only call API, do NOT navigate
|
|
325
|
+
// grailPayAccountChargeApi(customerId: UserStoreSingleton.shared.customerId)
|
|
326
|
+
// } else {
|
|
327
|
+
// // Navigate to EmailVerificationVC for all other payment methods
|
|
328
|
+
// if let emailVerificationVC = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
329
|
+
//
|
|
330
|
+
// emailVerificationVC.billingInfoData = billingInfoData
|
|
331
|
+
// emailVerificationVC.selectedPaymentMethod = selectedPaymentMethod
|
|
332
|
+
// emailVerificationVC.easyPayDelegate = easyPayDelegate
|
|
333
|
+
// emailVerificationVC.request = request
|
|
334
|
+
// emailVerificationVC.chosenPlan = chosenPlan
|
|
335
|
+
// emailVerificationVC.startDate = startDate
|
|
336
|
+
// emailVerificationVC.userEmail = userEmail
|
|
337
|
+
// emailVerificationVC.billingInfo = fieldSection?.billing
|
|
338
|
+
// emailVerificationVC.additionalInfo = fieldSection?.additional
|
|
339
|
+
// emailVerificationVC.visibility = fieldSection?.visibility
|
|
340
|
+
// emailVerificationVC.amount = amount
|
|
341
|
+
// emailVerificationVC.email = userEmail
|
|
342
|
+
//
|
|
343
|
+
// // Payment method-specific data
|
|
344
|
+
// switch selectedPaymentMethod {
|
|
345
|
+
// case "Card":
|
|
346
|
+
// emailVerificationVC.cardNumber = cardNumber
|
|
347
|
+
// emailVerificationVC.expiryDate = expiryDate
|
|
348
|
+
// emailVerificationVC.cvv = cvv
|
|
349
|
+
// emailVerificationVC.nameOnCard = nameOnCard
|
|
350
|
+
//
|
|
351
|
+
// case "Bank":
|
|
352
|
+
// emailVerificationVC.accountName = accountName
|
|
353
|
+
// emailVerificationVC.routingNumber = routingNumber
|
|
354
|
+
// emailVerificationVC.accountType = accountType
|
|
355
|
+
// emailVerificationVC.accountNumber = accountNumber
|
|
356
|
+
//
|
|
357
|
+
// case "GrailPay":
|
|
358
|
+
// emailVerificationVC.grailPayAccountID = grailPayAccountID
|
|
359
|
+
// emailVerificationVC.selectedGrailPayAccountType = selectedGrailPayAccountType
|
|
360
|
+
// emailVerificationVC.selectedGrailPayAccountName = selectedGrailPayAccountName
|
|
361
|
+
// emailVerificationVC.isSavedForFuture = true
|
|
362
|
+
//
|
|
363
|
+
// default:
|
|
364
|
+
// break
|
|
365
|
+
// }
|
|
366
|
+
//
|
|
367
|
+
// navigationController?.pushViewController(emailVerificationVC, animated: true)
|
|
368
|
+
// }
|
|
369
|
+
// }
|
|
370
|
+
// }
|
|
371
|
+
|
|
321
372
|
// MARK: - Flow Based on Conditions
|
|
322
373
|
if isSavedForFuture {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
374
|
+
// ✅ If logged in → Call API directly, no navigation
|
|
375
|
+
if UserStoreSingleton.shared.isLoggedIn == true {
|
|
376
|
+
switch selectedPaymentMethod {
|
|
377
|
+
case "Card":
|
|
378
|
+
if request.secureAuthentication == true {
|
|
379
|
+
threeDSecurePaymentApi()
|
|
380
|
+
} else {
|
|
381
|
+
paymentIntentApi()
|
|
382
|
+
}
|
|
330
383
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
emailVerificationVC.easyPayDelegate = easyPayDelegate
|
|
334
|
-
emailVerificationVC.request = request
|
|
335
|
-
emailVerificationVC.chosenPlan = chosenPlan
|
|
336
|
-
emailVerificationVC.startDate = startDate
|
|
337
|
-
emailVerificationVC.userEmail = userEmail
|
|
338
|
-
emailVerificationVC.billingInfo = fieldSection?.billing
|
|
339
|
-
emailVerificationVC.additionalInfo = fieldSection?.additional
|
|
340
|
-
emailVerificationVC.visibility = fieldSection?.visibility
|
|
341
|
-
emailVerificationVC.amount = amount
|
|
342
|
-
emailVerificationVC.email = userEmail
|
|
384
|
+
case "Bank":
|
|
385
|
+
accountChargeApi()
|
|
343
386
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
387
|
+
case "GrailPay":
|
|
388
|
+
grailPayAccountChargeApi()
|
|
389
|
+
|
|
390
|
+
case "NewGrailPayAccount":
|
|
391
|
+
grailPayAccountChargeApi(customerId: UserStoreSingleton.shared.customerId)
|
|
392
|
+
|
|
393
|
+
default:
|
|
394
|
+
print("Unknown payment method for logged-in user")
|
|
395
|
+
}
|
|
396
|
+
return
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// ❌ Not logged in → Always navigate to OTPVerificationVC
|
|
400
|
+
if let emailVerificationVC = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
401
|
+
|
|
402
|
+
emailVerificationVC.billingInfoData = billingInfoData
|
|
403
|
+
emailVerificationVC.selectedPaymentMethod = selectedPaymentMethod
|
|
404
|
+
emailVerificationVC.easyPayDelegate = easyPayDelegate
|
|
405
|
+
emailVerificationVC.request = request
|
|
406
|
+
emailVerificationVC.chosenPlan = chosenPlan
|
|
407
|
+
emailVerificationVC.startDate = startDate
|
|
408
|
+
emailVerificationVC.userEmail = userEmail
|
|
409
|
+
emailVerificationVC.billingInfo = fieldSection?.billing
|
|
410
|
+
emailVerificationVC.additionalInfo = fieldSection?.additional
|
|
411
|
+
emailVerificationVC.visibility = fieldSection?.visibility
|
|
412
|
+
emailVerificationVC.amount = amount
|
|
413
|
+
emailVerificationVC.email = userEmail
|
|
414
|
+
|
|
415
|
+
// Payment method-specific data
|
|
416
|
+
switch selectedPaymentMethod {
|
|
417
|
+
case "Card":
|
|
418
|
+
emailVerificationVC.cardNumber = cardNumber
|
|
419
|
+
emailVerificationVC.expiryDate = expiryDate
|
|
420
|
+
emailVerificationVC.cvv = cvv
|
|
421
|
+
emailVerificationVC.nameOnCard = nameOnCard
|
|
422
|
+
|
|
423
|
+
case "Bank":
|
|
424
|
+
emailVerificationVC.accountName = accountName
|
|
425
|
+
emailVerificationVC.routingNumber = routingNumber
|
|
426
|
+
emailVerificationVC.accountType = accountType
|
|
427
|
+
emailVerificationVC.accountNumber = accountNumber
|
|
428
|
+
|
|
429
|
+
case "GrailPay":
|
|
430
|
+
emailVerificationVC.grailPayAccountID = grailPayAccountID
|
|
431
|
+
emailVerificationVC.selectedGrailPayAccountType = selectedGrailPayAccountType
|
|
432
|
+
emailVerificationVC.selectedGrailPayAccountName = selectedGrailPayAccountName
|
|
433
|
+
emailVerificationVC.isSavedForFuture = true
|
|
367
434
|
|
|
368
|
-
|
|
435
|
+
default:
|
|
436
|
+
break
|
|
369
437
|
}
|
|
438
|
+
|
|
439
|
+
navigationController?.pushViewController(emailVerificationVC, animated: true)
|
|
370
440
|
}
|
|
371
441
|
}
|
|
442
|
+
|
|
372
443
|
else {
|
|
373
444
|
// Direct Payment Flow
|
|
374
|
-
// if selectedPaymentMethod == "Card" {
|
|
375
|
-
// if isFrom == "SavedCards" {
|
|
376
|
-
// paymentIntentFromShowCardApi()
|
|
377
|
-
// }
|
|
378
|
-
// if isSavedNewCard {
|
|
379
|
-
// if isFrom == "AddNewCard" {
|
|
380
|
-
// if request.secureAuthentication == true {
|
|
381
|
-
// threeDSecurePaymentAddNewCardApi(customerId: UserStoreSingleton.shared.customerId)
|
|
382
|
-
// } else {
|
|
383
|
-
// paymentIntentAddNewCardApi(customerId: UserStoreSingleton.shared.customerId)
|
|
384
|
-
// }
|
|
385
|
-
// }
|
|
386
|
-
// }
|
|
387
|
-
// else {
|
|
388
|
-
// if request.secureAuthentication == true {
|
|
389
|
-
// threeDSecurePaymentApi()
|
|
390
|
-
// } else {
|
|
391
|
-
// paymentIntentApi()
|
|
392
|
-
// }
|
|
393
|
-
// }
|
|
394
|
-
// }
|
|
395
445
|
if selectedPaymentMethod == "Card" {
|
|
396
446
|
if isFrom == "SavedCards" {
|
|
397
447
|
paymentIntentFromShowCardApi()
|
|
@@ -480,6 +530,28 @@ class AdditionalInfoVC: BaseVC {
|
|
|
480
530
|
"currency": "usd"
|
|
481
531
|
]
|
|
482
532
|
|
|
533
|
+
// ✅ Only for logged-in users
|
|
534
|
+
if UserStoreSingleton.shared.isLoggedIn == true {
|
|
535
|
+
let emailText = userEmail
|
|
536
|
+
let emailPrefix = emailText?.components(separatedBy: "@").first ?? ""
|
|
537
|
+
|
|
538
|
+
params["save_card"] = 1
|
|
539
|
+
params["is_default"] = "1"
|
|
540
|
+
params["tokenize"] = request.tokenOnly ?? ""
|
|
541
|
+
params["username"] = emailPrefix
|
|
542
|
+
|
|
543
|
+
if let customerId = UserStoreSingleton.shared.customerId {
|
|
544
|
+
params["customer"] = customerId
|
|
545
|
+
params["customer_id"] = customerId
|
|
546
|
+
} else {
|
|
547
|
+
params["create_customer"] = "1"
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
if UserStoreSingleton.shared.customerId == nil {
|
|
551
|
+
params["create_customer"] = "1"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
483
555
|
// Conditionally add billing info
|
|
484
556
|
if let visibility = visibility, visibility.billing == true,
|
|
485
557
|
let billing = billingInfo, !billing.isEmpty {
|
|
@@ -526,17 +598,10 @@ class AdditionalInfoVC: BaseVC {
|
|
|
526
598
|
params["interval"] = chosenPlan?.lowercased()
|
|
527
599
|
}
|
|
528
600
|
|
|
529
|
-
//
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
// ✅ Flatten metadata into requestBody
|
|
535
|
-
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
536
|
-
for (key, value) in metadata {
|
|
537
|
-
params[key] = value
|
|
538
|
-
}
|
|
539
|
-
}
|
|
601
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
602
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
603
|
+
params["metadata"] = metadata
|
|
604
|
+
}
|
|
540
605
|
|
|
541
606
|
print(params)
|
|
542
607
|
|
|
@@ -753,17 +818,10 @@ class AdditionalInfoVC: BaseVC {
|
|
|
753
818
|
params["interval"] = chosenPlan?.lowercased()
|
|
754
819
|
}
|
|
755
820
|
|
|
756
|
-
//
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
// ✅ Flatten metadata into requestBody
|
|
762
|
-
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
763
|
-
for (key, value) in metadata {
|
|
764
|
-
params[key] = value
|
|
765
|
-
}
|
|
766
|
-
}
|
|
821
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
822
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
823
|
+
params["metadata"] = metadata
|
|
824
|
+
}
|
|
767
825
|
|
|
768
826
|
print(params)
|
|
769
827
|
|
|
@@ -962,17 +1020,10 @@ class AdditionalInfoVC: BaseVC {
|
|
|
962
1020
|
params["email"] = UserStoreSingleton.shared.verificationEmail
|
|
963
1021
|
}
|
|
964
1022
|
|
|
965
|
-
//
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
// ✅ Flatten metadata into requestBody
|
|
971
|
-
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
972
|
-
for (key, value) in metadata {
|
|
973
|
-
params[key] = value
|
|
974
|
-
}
|
|
975
|
-
}
|
|
1023
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
1024
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
1025
|
+
params["metadata"] = metadata
|
|
1026
|
+
}
|
|
976
1027
|
|
|
977
1028
|
print(params)
|
|
978
1029
|
|
|
@@ -1115,6 +1166,24 @@ class AdditionalInfoVC: BaseVC {
|
|
|
1115
1166
|
"levelIndicator": 1,
|
|
1116
1167
|
]
|
|
1117
1168
|
|
|
1169
|
+
// ✅ Only for logged-in users
|
|
1170
|
+
if UserStoreSingleton.shared.isLoggedIn == true {
|
|
1171
|
+
let emailText = userEmail
|
|
1172
|
+
let emailPrefix = emailText?.components(separatedBy: "@").first ?? ""
|
|
1173
|
+
|
|
1174
|
+
params["save_account"] = 1
|
|
1175
|
+
|
|
1176
|
+
if let customerId = UserStoreSingleton.shared.customerId, !customerId.isEmpty {
|
|
1177
|
+
params["customer"] = customerId
|
|
1178
|
+
} else {
|
|
1179
|
+
params["username"] = emailPrefix
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
if UserStoreSingleton.shared.customerId == nil {
|
|
1183
|
+
params["create_customer"] = "1"
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1118
1187
|
// Conditionally add billing info
|
|
1119
1188
|
if let visibility = visibility, visibility.billing == true,
|
|
1120
1189
|
let billing = billingInfo, !billing.isEmpty {
|
|
@@ -1161,6 +1230,11 @@ class AdditionalInfoVC: BaseVC {
|
|
|
1161
1230
|
params["interval"] = chosenPlan?.lowercased()
|
|
1162
1231
|
}
|
|
1163
1232
|
|
|
1233
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
1234
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
1235
|
+
params["metadata"] = metadata
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1164
1238
|
print(params)
|
|
1165
1239
|
|
|
1166
1240
|
do {
|
|
@@ -1342,6 +1416,11 @@ class AdditionalInfoVC: BaseVC {
|
|
|
1342
1416
|
params["interval"] = chosenPlan?.lowercased()
|
|
1343
1417
|
}
|
|
1344
1418
|
|
|
1419
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
1420
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
1421
|
+
params["metadata"] = metadata
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1345
1424
|
print(params)
|
|
1346
1425
|
|
|
1347
1426
|
do {
|
|
@@ -1542,6 +1621,11 @@ class AdditionalInfoVC: BaseVC {
|
|
|
1542
1621
|
params["interval"] = chosenPlan?.lowercased()
|
|
1543
1622
|
}
|
|
1544
1623
|
|
|
1624
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
1625
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
1626
|
+
params["metadata"] = metadata
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1545
1629
|
print(params)
|
|
1546
1630
|
|
|
1547
1631
|
do {
|
|
@@ -1687,6 +1771,28 @@ class AdditionalInfoVC: BaseVC {
|
|
|
1687
1771
|
"tokenize": request.tokenOnly ?? false
|
|
1688
1772
|
]
|
|
1689
1773
|
|
|
1774
|
+
// ✅ Only for logged-in users
|
|
1775
|
+
if UserStoreSingleton.shared.isLoggedIn == true {
|
|
1776
|
+
let emailText = userEmail
|
|
1777
|
+
let emailPrefix = emailText?.components(separatedBy: "@").first ?? ""
|
|
1778
|
+
|
|
1779
|
+
params["save_card"] = 1
|
|
1780
|
+
params["is_default"] = "1"
|
|
1781
|
+
params["tokenize"] = request.tokenOnly ?? ""
|
|
1782
|
+
params["username"] = emailPrefix
|
|
1783
|
+
|
|
1784
|
+
if let customerId = UserStoreSingleton.shared.customerId {
|
|
1785
|
+
params["customer"] = customerId
|
|
1786
|
+
params["customer_id"] = customerId
|
|
1787
|
+
} else {
|
|
1788
|
+
params["create_customer"] = "1"
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
if UserStoreSingleton.shared.customerId == nil {
|
|
1792
|
+
params["create_customer"] = "1"
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1690
1796
|
// Conditionally add billing info
|
|
1691
1797
|
if let visibility = visibility, visibility.billing == true,
|
|
1692
1798
|
let billing = billingInfo, !billing.isEmpty {
|
|
@@ -2074,6 +2180,26 @@ class AdditionalInfoVC: BaseVC {
|
|
|
2074
2180
|
"email": userEmail ?? ""
|
|
2075
2181
|
]
|
|
2076
2182
|
|
|
2183
|
+
// ✅ Only add these params for logged-in users
|
|
2184
|
+
if UserStoreSingleton.shared.isLoggedIn == true {
|
|
2185
|
+
let emailText = userEmail
|
|
2186
|
+
let emailPrefix = emailText?.components(separatedBy: "@").first ?? ""
|
|
2187
|
+
|
|
2188
|
+
params["save_account"] = 1
|
|
2189
|
+
params["is_default"] = 1
|
|
2190
|
+
params["customer_id"] = UserStoreSingleton.shared.customerId ?? ""
|
|
2191
|
+
|
|
2192
|
+
if let customerId = UserStoreSingleton.shared.customerId, !customerId.isEmpty {
|
|
2193
|
+
params["customer"] = customerId
|
|
2194
|
+
} else {
|
|
2195
|
+
params["username"] = emailPrefix
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
if UserStoreSingleton.shared.customerId == nil {
|
|
2199
|
+
params["create_customer"] = "1"
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2077
2203
|
// Conditionally add billing info
|
|
2078
2204
|
if let visibility = visibility, visibility.billing == true,
|
|
2079
2205
|
let billing = billingInfo, !billing.isEmpty {
|
|
@@ -2131,6 +2257,11 @@ class AdditionalInfoVC: BaseVC {
|
|
|
2131
2257
|
params["interval"] = chosenPlan?.lowercased()
|
|
2132
2258
|
}
|
|
2133
2259
|
|
|
2260
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
2261
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
2262
|
+
params["metadata"] = metadata
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2134
2265
|
print(params)
|
|
2135
2266
|
|
|
2136
2267
|
do {
|
|
@@ -2360,6 +2491,11 @@ class AdditionalInfoVC: BaseVC {
|
|
|
2360
2491
|
params["interval"] = chosenPlan?.lowercased()
|
|
2361
2492
|
}
|
|
2362
2493
|
|
|
2494
|
+
// ✅ Include metadata only if it has at least 1 key-value pair
|
|
2495
|
+
if let metadata = request?.metadata, !metadata.isEmpty {
|
|
2496
|
+
params["metadata"] = metadata
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2363
2499
|
print(params)
|
|
2364
2500
|
|
|
2365
2501
|
do {
|