@jimrising/easymerchantsdk-react-native 1.8.6 → 1.8.7

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.6"
10
+ "@jimrising/easymerchantsdk-react-native": "^1.8.7"
11
11
  },
12
12
  ```
13
13
 
@@ -595,6 +595,8 @@ const handleAndroidBilling = async () => {
595
595
  <ScrollView contentContainerStyle={styles.scrollContent}>
596
596
  <Text style={styles.title}>EasyMerchant SDK</Text>
597
597
 
598
+
599
+
598
600
  <Text style={styles.sectionTitle}>Basic Info</Text>
599
601
  <Text style={styles.label}>Amount</Text>
600
602
  <TextInput
@@ -613,603 +615,619 @@ const handleAndroidBilling = async () => {
613
615
  onChangeText={setEmail}
614
616
  />
615
617
 
616
- <Text style={styles.sectionTitle}>Environment</Text>
617
- <View style={styles.pickerContainer}>
618
- <Text style={styles.label}>Select Environment</Text>
619
- <View style={styles.buttonGroup}>
620
- <TouchableOpacity
621
- style={[
622
- styles.environmentButton,
623
- { backgroundColor: environment === 'sandbox' ? '#2563EB' : '#ccc' },
624
- ]}
625
- onPress={() => {
626
- console.log('Sandbox tapped, setting environment to sandbox');
627
- setEnvironment('sandbox');
628
- }}
629
- disabled={isEnvironmentLoading || environment === 'sandbox'}
630
- >
631
- <Text style={styles.buttonText}>Sandbox</Text>
632
- </TouchableOpacity>
633
- <TouchableOpacity
634
- style={[
635
- styles.environmentButton,
636
- { backgroundColor: environment === 'staging' ? '#2563EB' : '#ccc' },
637
- ]}
638
- onPress={() => {
639
- console.log('Staging tapped, setting environment to staging');
640
- setEnvironment('staging');
641
- }}
642
- disabled={isEnvironmentLoading || environment === 'staging'}
643
- >
644
- <Text style={styles.buttonText}>Staging</Text>
645
- </TouchableOpacity>
618
+ <View style={styles.buttonGroup}>
619
+ <Button title="Pay" onPress={handlePayment} disabled={loading} />
620
+ {Platform.OS === 'ios' && (
621
+ <Button title="Payment Ref" onPress={handlePaymentReference} disabled={loading} />
622
+ )}
646
623
  </View>
647
- </View>
648
624
 
649
-
650
- <Text style={styles.sectionTitle}>Payment Options</Text>
651
- <View style={styles.toggleContainer}>
652
- <Text style={styles.label}>Recurring Payment</Text>
653
- <Switch
654
- value={isRecurring}
655
- onValueChange={setIsRecurring}
656
- trackColor={{ false: '#ccc', true: '#2563EB' }}
657
- thumbColor={isRecurring ? '#fff' : '#f4f3f4'}
658
- />
659
- </View>
660
- <View style={styles.toggleContainer}>
661
- <Text style={styles.label}>Authenticated ACH</Text>
662
- <Switch
663
- value={isAuthenticatedACH}
664
- onValueChange={setAuthenticatedACH}
665
- trackColor={{ false: '#ccc', true: '#2563EB' }}
666
- thumbColor={isAuthenticatedACH ? '#fff' : '#f4f3f4'}
667
- />
668
- </View>
669
- <View style={styles.toggleContainer}>
670
- <Text style={styles.label}>3DS</Text>
671
- <Switch
672
- value={isSecureAuthentication}
673
- onValueChange={setSecureAuthentication}
674
- trackColor={{ false: '#ccc', true: '#2563EB' }}
675
- thumbColor={isSecureAuthentication ? '#fff' : '#f4f3f4'}
676
- />
677
- </View>
678
625
  <View style={styles.toggleContainer}>
679
- <Text style={styles.label}>Billing Visible</Text>
626
+ <Text style={styles.label}>Show Configurations</Text>
680
627
  <Switch
681
- value={isBillingVisible}
682
- onValueChange={setBillingVisible}
628
+ value={showConfig}
629
+ onValueChange={setShowConfig}
683
630
  trackColor={{ false: '#ccc', true: '#2563EB' }}
684
- thumbColor={isBillingVisible ? '#fff' : '#f4f3f4'}
631
+ thumbColor={showConfig ? '#fff' : '#f4f3f4'}
685
632
  />
686
633
  </View>
687
- <View style={styles.toggleContainer}>
688
- <Text style={styles.label}>Additional Info Visible</Text>
689
- <Switch
690
- value={isAdditionalVisible}
691
- onValueChange={setAdditionalVisible}
692
- trackColor={{ false: '#ccc', true: '#2563EB' }}
693
- thumbColor={isAdditionalVisible ? '#fff' : '#f4f3f4'}
694
- />
695
- </View>
696
- <Text style={styles.label}>Payment Methods (Shared)</Text>
697
- <View style={styles.buttonGroup}>
698
- <Button
699
- title="Card"
700
- onPress={() => togglePaymentMethod('card')}
701
- color={androidConfig.paymentMethod.includes('card') ? '#2563EB' : '#ccc'}
702
- />
703
- <Button
704
- title="ACH"
705
- onPress={() => togglePaymentMethod('ach')}
706
- color={androidConfig.paymentMethod.includes('ach') ? '#2563EB' : '#ccc'}
707
- />
708
- </View>
709
- {Platform.OS === 'android' && (
710
- <View style={styles.toggleContainer}>
711
- <Text style={styles.label}>Email Editable (Android)</Text>
712
- <Switch
713
- value={emailEditable}
714
- onValueChange={setEmailEditable}
715
- trackColor={{ false: '#ccc', true: '#2563EB' }}
716
- thumbColor={emailEditable ? '#fff' : '#f4f3f4'}
717
- />
718
- </View>
719
- )}
720
- {Platform.OS === 'ios' && (
721
- <View style={styles.toggleContainer}>
722
- <Text style={styles.label}>Allow Email (iOS)</Text>
723
- <Switch
724
- value={isEmail}
725
- onValueChange={setIsEmail}
726
- trackColor={{ false: '#ccc', true: '#2563EB' }}
727
- thumbColor={isEmail ? '#fff' : '#f4f3f4'}
728
- />
729
- </View>
730
- )}
731
-
732
- <Text style={styles.sectionTitle}>Billing Info</Text>
733
- <Text style={styles.label}>Billing Address</Text>
734
- <TextInput
735
- style={styles.input}
736
- value={billingInfo.billing.address}
737
- onChangeText={value => updateBillingInfo('billing', 'address', value)}
738
- />
739
- <Text style={styles.label}>Billing Country</Text>
740
- <TextInput
741
- style={styles.input}
742
- value={billingInfo.billing.country}
743
- onChangeText={value => updateBillingInfo('billing', 'country', value)}
744
- />
745
- <Text style={styles.label}>Billing State</Text>
746
- <TextInput
747
- style={styles.input}
748
- value={billingInfo.billing.state}
749
- onChangeText={value => updateBillingInfo('billing', 'state', value)}
750
- />
751
- <Text style={styles.label}>Billing City</Text>
752
- <TextInput
753
- style={styles.input}
754
- value={billingInfo.billing.city}
755
- onChangeText={value => updateBillingInfo('billing', 'city', value)}
756
- />
757
- <Text style={styles.label}>Billing Postal Code</Text>
758
- <TextInput
759
- style={styles.input}
760
- value={billingInfo.billing.postal_code}
761
- onChangeText={value => updateBillingInfo('billing', 'postal_code', value)}
762
- />
763
- <Text style={styles.label}>Billing Required: Address</Text>
764
- <Switch
765
- value={billingInfo.billingRequired.address}
766
- onValueChange={value => updateBillingInfo('billingRequired', 'address', value)}
767
- trackColor={{ false: '#ccc', true: '#2563EB' }}
768
- thumbColor={billingInfo.billingRequired.address ? '#fff' : '#f4f3f4'}
769
- />
770
- <Text style={styles.label}>Billing Required: Country</Text>
771
- <Switch
772
- value={billingInfo.billingRequired.country}
773
- onValueChange={value => updateBillingInfo('billingRequired', 'country', value)}
774
- trackColor={{ false: '#ccc', true: '#2563EB' }}
775
- thumbColor={billingInfo.billingRequired.country ? '#fff' : '#f4f3f4'}
776
- />
777
- <Text style={styles.label}>Billing Required: State</Text>
778
- <Switch
779
- value={billingInfo.billingRequired.state}
780
- onValueChange={value => updateBillingInfo('billingRequired', 'state', value)}
781
- trackColor={{ false: '#ccc', true: '#2563EB' }}
782
- thumbColor={billingInfo.billingRequired.state ? '#fff' : '#f4f3f4'}
783
- />
784
- <Text style={styles.label}>Billing Required: City</Text>
785
- <Switch
786
- value={billingInfo.billingRequired.city}
787
- onValueChange={value => updateBillingInfo('billingRequired', 'city', value)}
788
- trackColor={{ false: '#ccc', true: '#2563EB' }}
789
- thumbColor={billingInfo.billingRequired.city ? '#fff' : '#f4f3f4'}
790
- />
791
- <Text style={styles.label}>Billing Required: Postal Code</Text>
792
- <Switch
793
- value={billingInfo.billingRequired.postal_code}
794
- onValueChange={value => updateBillingInfo('billingRequired', 'postal_code', value)}
795
- trackColor={{ false: '#ccc', true: '#2563EB' }}
796
- thumbColor={billingInfo.billingRequired.postal_code ? '#fff' : '#f4f3f4'}
797
- />
798
- <Text style={styles.label}>Additional: Name</Text>
799
- <TextInput
800
- style={styles.input}
801
- value={billingInfo.additional.name}
802
- onChangeText={value => updateBillingInfo('additional', 'name', value)}
803
- />
804
- <Text style={styles.label}>Additional: Email Address</Text>
805
- <TextInput
806
- style={styles.input}
807
- value={billingInfo.additional.email_address}
808
- onChangeText={value => updateBillingInfo('additional', 'email_address', value)}
809
- />
810
- <Text style={styles.label}>Additional: Phone Number</Text>
811
- <TextInput
812
- style={styles.input}
813
- value={billingInfo.additional.phone_number}
814
- onChangeText={value => updateBillingInfo('additional', 'phone_number', value)}
815
- />
816
- <Text style={styles.label}>Additional: Description</Text>
817
- <TextInput
818
- style={styles.input}
819
- value={billingInfo.additional.description}
820
- onChangeText={value => updateBillingInfo('additional', 'description', value)}
821
- />
822
- <Text style={styles.label}>Additional Required: Name</Text>
823
- <Switch
824
- value={billingInfo.additionalRequired.name}
825
- onValueChange={value => updateBillingInfo('additionalRequired', 'name', value)}
826
- trackColor={{ false: '#ccc', true: '#2563EB' }}
827
- thumbColor={billingInfo.additionalRequired.name ? '#fff' : '#f4f3f4'}
828
- />
829
- <Text style={styles.label}>Additional Required: Email Address</Text>
830
- <Switch
831
- value={billingInfo.additionalRequired.email_address}
832
- onValueChange={value => updateBillingInfo('additionalRequired', 'email_address', value)}
833
- trackColor={{ false: '#ccc', true: '#2563EB' }}
834
- thumbColor={billingInfo.additionalRequired.email_address ? '#fff' : '#f4f3f4'}
835
- />
836
- <Text style={styles.label}>Additional Required: Phone Number</Text>
837
- <Switch
838
- value={billingInfo.additionalRequired.phone_number}
839
- onValueChange={value => updateBillingInfo('additionalRequired', 'phone_number', value)}
840
- trackColor={{ false: '#ccc', true: '#2563EB' }}
841
- thumbColor={billingInfo.additionalRequired.phone_number ? '#fff' : '#f4f3f4'}
842
- />
843
- <Text style={styles.label}>Additional Required: Description</Text>
844
- <Switch
845
- value={billingInfo.additionalRequired.description}
846
- onValueChange={value => updateBillingInfo('additionalRequired', 'description', value)}
847
- trackColor={{ false: '#ccc', true: '#2563EB' }}
848
- thumbColor={billingInfo.additionalRequired.description ? '#fff' : '#f4f3f4'}
849
- />
850
634
 
851
- {Platform.OS === 'android' && (
635
+ {showConfig && (
852
636
  <>
853
- <Text style={styles.sectionTitle}>Android Configuration</Text>
854
- <Text style={styles.label}>Currency</Text>
855
- <TextInput
856
- style={styles.input}
857
- value={androidConfig.currency}
858
- onChangeText={value => updateAndroidConfig('currency', value)}
859
- />
860
- <Text style={styles.label}>Save Card</Text>
861
- <Switch
862
- value={androidConfig.saveCard}
863
- onValueChange={value => updateAndroidConfig('saveCard', value)}
864
- trackColor={{ false: '#ccc', true: '#2563EB' }}
865
- thumbColor={androidConfig.saveCard ? '#fff' : '#f4f3f4'}
866
- />
867
- <Text style={styles.label}>Save Account</Text>
868
- <Switch
869
- value={androidConfig.saveAccount}
870
- onValueChange={value => updateAndroidConfig('saveAccount', value)}
871
- trackColor={{ false: '#ccc', true: '#2563EB' }}
872
- thumbColor={androidConfig.saveAccount ? '#fff' : '#f4f3f4'}
873
- />
874
- <Text style={styles.label}>Show Receipt</Text>
875
- <Switch
876
- value={androidConfig.showReceipt}
877
- onValueChange={value => updateAndroidConfig('showReceipt', value)}
878
- trackColor={{ false: '#ccc', true: '#2563EB' }}
879
- thumbColor={androidConfig.showReceipt ? '#fff' : '#f4f3f4'}
880
- />
881
- <Text style={styles.label}>Show Donate</Text>
882
- <Switch
883
- value={androidConfig.showDonate}
884
- onValueChange={value => updateAndroidConfig('showDonate', value)}
885
- trackColor={{ false: '#ccc', true: '#2563EB' }}
886
- thumbColor={androidConfig.showDonate ? '#fff' : '#f4f3f4'}
887
- />
888
- <Text style={styles.label}>Show Total</Text>
889
- <Switch
890
- value={androidConfig.showTotal}
891
- onValueChange={value => updateAndroidConfig('showTotal', value)}
892
- trackColor={{ false: '#ccc', true: '#2563EB' }}
893
- thumbColor={androidConfig.showTotal ? '#fff' : '#f4f3f4'}
894
- />
895
- <Text style={styles.label}>Show Submit Button</Text>
896
- <Switch
897
- value={androidConfig.showSubmitButton}
898
- onValueChange={value => updateAndroidConfig('showSubmitButton', value)}
899
- trackColor={{ false: '#ccc', true: '#2563EB' }}
900
- thumbColor={androidConfig.showSubmitButton ? '#fff' : '#f4f3f4'}
901
- />
902
- <Text style={styles.label}>Name</Text>
903
- <TextInput
904
- style={styles.input}
905
- value={androidConfig.name}
906
- onChangeText={value => updateAndroidConfig('name', value)}
907
- />
908
- <Text style={styles.sectionTitle}>Android Fields</Text>
909
- {androidConfig.fields.billing.map((field, index) => (
910
- <View key={`billing-${index}`}>
911
- <Text style={styles.label}>{`Billing ${field.name}`}</Text>
912
- <TextInput
913
- style={styles.input}
914
- value={field.value}
915
- onChangeText={value => updateAndroidConfigFields('billing', index, 'value', value)}
916
- />
917
- <Text style={styles.label}>{`Billing ${field.name} Required`}</Text>
637
+ <Text style={styles.sectionTitle}>Environment</Text>
638
+ <View style={styles.pickerContainer}>
639
+ <Text style={styles.label}>Select Environment</Text>
640
+ <View style={styles.buttonGroup}>
641
+ <TouchableOpacity
642
+ style={[
643
+ styles.environmentButton,
644
+ { backgroundColor: environment === 'sandbox' ? '#2563EB' : '#ccc' },
645
+ ]}
646
+ onPress={() => {
647
+ console.log('Sandbox tapped, setting environment to sandbox');
648
+ setEnvironment('sandbox');
649
+ }}
650
+ disabled={isEnvironmentLoading || environment === 'sandbox'}
651
+ >
652
+ <Text style={styles.buttonText}>Sandbox</Text>
653
+ </TouchableOpacity>
654
+ <TouchableOpacity
655
+ style={[
656
+ styles.environmentButton,
657
+ { backgroundColor: environment === 'staging' ? '#2563EB' : '#ccc' },
658
+ ]}
659
+ onPress={() => {
660
+ console.log('Staging tapped, setting environment to staging');
661
+ setEnvironment('staging');
662
+ }}
663
+ disabled={isEnvironmentLoading || environment === 'staging'}
664
+ >
665
+ <Text style={styles.buttonText}>Staging</Text>
666
+ </TouchableOpacity>
667
+ </View>
668
+ </View>
669
+
670
+ <Text style={styles.sectionTitle}>Payment Options</Text>
671
+ <View style={styles.toggleContainer}>
672
+ <Text style={styles.label}>Recurring Payment</Text>
673
+ <Switch
674
+ value={isRecurring}
675
+ onValueChange={setIsRecurring}
676
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
677
+ thumbColor={isRecurring ? '#fff' : '#f4f3f4'}
678
+ />
679
+ </View>
680
+ <View style={styles.toggleContainer}>
681
+ <Text style={styles.label}>Authenticated ACH</Text>
682
+ <Switch
683
+ value={isAuthenticatedACH}
684
+ onValueChange={setAuthenticatedACH}
685
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
686
+ thumbColor={isAuthenticatedACH ? '#fff' : '#f4f3f4'}
687
+ />
688
+ </View>
689
+ <View style={styles.toggleContainer}>
690
+ <Text style={styles.label}>3DS</Text>
691
+ <Switch
692
+ value={isSecureAuthentication}
693
+ onValueChange={setSecureAuthentication}
694
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
695
+ thumbColor={isSecureAuthentication ? '#fff' : '#f4f3f4'}
696
+ />
697
+ </View>
698
+ <View style={styles.toggleContainer}>
699
+ <Text style={styles.label}>Billing Visible</Text>
700
+ <Switch
701
+ value={isBillingVisible}
702
+ onValueChange={setBillingVisible}
703
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
704
+ thumbColor={isBillingVisible ? '#fff' : '#f4f3f4'}
705
+ />
706
+ </View>
707
+ <View style={styles.toggleContainer}>
708
+ <Text style={styles.label}>Additional Info Visible</Text>
709
+ <Switch
710
+ value={isAdditionalVisible}
711
+ onValueChange={setAdditionalVisible}
712
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
713
+ thumbColor={isAdditionalVisible ? '#fff' : '#f4f3f4'}
714
+ />
715
+ </View>
716
+ <Text style={styles.label}>Payment Methods (Shared)</Text>
717
+ <View style={styles.buttonGroup}>
718
+ <Button
719
+ title="Card"
720
+ onPress={() => togglePaymentMethod('card')}
721
+ color={androidConfig.paymentMethod.includes('card') ? '#2563EB' : '#ccc'}
722
+ />
723
+ <Button
724
+ title="ACH"
725
+ onPress={() => togglePaymentMethod('ach')}
726
+ color={androidConfig.paymentMethod.includes('ach') ? '#2563EB' : '#ccc'}
727
+ />
728
+ </View>
729
+ {Platform.OS === 'android' && (
730
+ <View style={styles.toggleContainer}>
731
+ <Text style={styles.label}>Email Editable (Android)</Text>
918
732
  <Switch
919
- value={field.required}
920
- onValueChange={value => updateAndroidConfigFields('billing', index, 'required', value)}
733
+ value={emailEditable}
734
+ onValueChange={setEmailEditable}
921
735
  trackColor={{ false: '#ccc', true: '#2563EB' }}
922
- thumbColor={field.required ? '#fff' : '#f4f3f4'}
736
+ thumbColor={emailEditable ? '#fff' : '#f4f3f4'}
923
737
  />
924
738
  </View>
925
- ))}
926
- {androidConfig.fields.additional.map((field, index) => (
927
- <View key={`additional-${index}`}>
928
- <Text style={styles.label}>{`Additional ${field.name}`}</Text>
929
- <TextInput
930
- style={styles.input}
931
- value={field.value}
932
- onChangeText={value => updateAndroidConfigFields('additional', index, 'value', value)}
933
- />
934
- <Text style={styles.label}>{`Additional ${field.name} Required`}</Text>
739
+ )}
740
+ {Platform.OS === 'ios' && (
741
+ <View style={styles.toggleContainer}>
742
+ <Text style={styles.label}>Allow Email (iOS)</Text>
935
743
  <Switch
936
- value={field.required}
937
- onValueChange={value => updateAndroidConfigFields('additional', index, 'required', value)}
744
+ value={isEmail}
745
+ onValueChange={setIsEmail}
938
746
  trackColor={{ false: '#ccc', true: '#2563EB' }}
939
- thumbColor={field.required ? '#fff' : '#f4f3f4'}
747
+ thumbColor={isEmail ? '#fff' : '#f4f3f4'}
940
748
  />
941
749
  </View>
942
- ))}
943
- <Text style={styles.sectionTitle}>Android Appearance Settings</Text>
944
- <Text style={styles.label}>Theme</Text>
945
- <TextInput
946
- style={styles.input}
947
- value={androidConfig.appearanceSettings.theme}
948
- onChangeText={value => updateAndroidConfigAppearanceSettings('theme', value)}
949
- />
950
- <Text style={styles.label}>Body Background Color</Text>
951
- <TextInput
952
- style={styles.input}
953
- value={androidConfig.appearanceSettings.bodyBackgroundColor}
954
- onChangeText={value => updateAndroidConfigAppearanceSettings('bodyBackgroundColor', value)}
955
- />
956
- <Text style={styles.label}>Container Background Color</Text>
750
+ )}
751
+
752
+ <Text style={styles.sectionTitle}>Billing Info</Text>
753
+ <Text style={styles.label}>Billing Address</Text>
957
754
  <TextInput
958
755
  style={styles.input}
959
- value={androidConfig.appearanceSettings.containerBackgroundColor}
960
- onChangeText={value => updateAndroidConfigAppearanceSettings('containerBackgroundColor', value)}
756
+ value={billingInfo.billing.address}
757
+ onChangeText={value => updateBillingInfo('billing', 'address', value)}
961
758
  />
962
- <Text style={styles.label}>Primary Font Color</Text>
759
+ <Text style={styles.label}>Billing Country</Text>
963
760
  <TextInput
964
761
  style={styles.input}
965
- value={androidConfig.appearanceSettings.primaryFontColor}
966
- onChangeText={value => updateAndroidConfigAppearanceSettings('primaryFontColor', value)}
762
+ value={billingInfo.billing.country}
763
+ onChangeText={value => updateBillingInfo('billing', 'country', value)}
967
764
  />
968
- <Text style={styles.label}>Secondary Font Color</Text>
765
+ <Text style={styles.label}>Billing State</Text>
969
766
  <TextInput
970
767
  style={styles.input}
971
- value={androidConfig.appearanceSettings.secondaryFontColor}
972
- onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryFontColor', value)}
768
+ value={billingInfo.billing.state}
769
+ onChangeText={value => updateBillingInfo('billing', 'state', value)}
973
770
  />
974
- <Text style={styles.label}>Primary Button Background Color</Text>
771
+ <Text style={styles.label}>Billing City</Text>
975
772
  <TextInput
976
773
  style={styles.input}
977
- value={androidConfig.appearanceSettings.primaryButtonBackgroundColor}
978
- onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonBackgroundColor', value)}
774
+ value={billingInfo.billing.city}
775
+ onChangeText={value => updateBillingInfo('billing', 'city', value)}
979
776
  />
980
- <Text style={styles.label}>Primary Button Hover Color</Text>
777
+ <Text style={styles.label}>Billing Postal Code</Text>
981
778
  <TextInput
982
779
  style={styles.input}
983
- value={androidConfig.appearanceSettings.primaryButtonHoverColor}
984
- onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonHoverColor', value)}
780
+ value={billingInfo.billing.postal_code}
781
+ onChangeText={value => updateBillingInfo('billing', 'postal_code', value)}
985
782
  />
986
- <Text style={styles.label}>Primary Button Font Color</Text>
987
- <TextInput
988
- style={styles.input}
989
- value={androidConfig.appearanceSettings.primaryButtonFontColor}
990
- onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonFontColor', value)}
783
+ <Text style={styles.label}>Billing Required: Address</Text>
784
+ <Switch
785
+ value={billingInfo.billingRequired.address}
786
+ onValueChange={value => updateBillingInfo('billingRequired', 'address', value)}
787
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
788
+ thumbColor={billingInfo.billingRequired.address ? '#fff' : '#f4f3f4'}
991
789
  />
992
- <Text style={styles.label}>Secondary Button Background Color</Text>
993
- <TextInput
994
- style={styles.input}
995
- value={androidConfig.appearanceSettings.secondaryButtonBackgroundColor}
996
- onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonBackgroundColor', value)}
790
+ <Text style={styles.label}>Billing Required: Country</Text>
791
+ <Switch
792
+ value={billingInfo.billingRequired.country}
793
+ onValueChange={value => updateBillingInfo('billingRequired', 'country', value)}
794
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
795
+ thumbColor={billingInfo.billingRequired.country ? '#fff' : '#f4f3f4'}
997
796
  />
998
- <Text style={styles.label}>Secondary Button Hover Color</Text>
999
- <TextInput
1000
- style={styles.input}
1001
- value={androidConfig.appearanceSettings.secondaryButtonHoverColor}
1002
- onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonHoverColor', value)}
797
+ <Text style={styles.label}>Billing Required: State</Text>
798
+ <Switch
799
+ value={billingInfo.billingRequired.state}
800
+ onChangeText={value => updateBillingInfo('billingRequired', 'state', value)}
801
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
802
+ thumbColor={billingInfo.billingRequired.state ? '#fff' : '#f4f3f4'}
1003
803
  />
1004
- <Text style={styles.label}>Secondary Button Font Color</Text>
1005
- <TextInput
1006
- style={styles.input}
1007
- value={androidConfig.appearanceSettings.secondaryButtonFontColor}
1008
- onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonFontColor', value)}
804
+ <Text style={styles.label}>Billing Required: City</Text>
805
+ <Switch
806
+ value={billingInfo.billingRequired.city}
807
+ onValueChange={value => updateBillingInfo('billingRequired', 'city', value)}
808
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
809
+ thumbColor={billingInfo.billingRequired.city ? '#fff' : '#f4f3f4'}
1009
810
  />
1010
- <Text style={styles.label}>Border Radius</Text>
1011
- <TextInput
1012
- style={styles.input}
1013
- value={androidConfig.appearanceSettings.borderRadius}
1014
- onChangeText={value => updateAndroidConfigAppearanceSettings('borderRadius', value)}
811
+ <Text style={styles.label}>Billing Required: Postal Code</Text>
812
+ <Switch
813
+ value={billingInfo.billingRequired.postal_code}
814
+ onValueChange={value => updateBillingInfo('billingRequired', 'postal_code', value)}
815
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
816
+ thumbColor={billingInfo.billingRequired.postal_code ? '#fff' : '#f4f3f4'}
1015
817
  />
1016
- <Text style={styles.label}>Font Size</Text>
818
+ <Text style={styles.label}>Additional: Name</Text>
1017
819
  <TextInput
1018
820
  style={styles.input}
1019
- value={androidConfig.appearanceSettings.fontSize}
1020
- onChangeText={value => updateAndroidConfigAppearanceSettings('fontSize', value)}
821
+ value={billingInfo.additional.name}
822
+ onChangeText={value => updateBillingInfo('additional', 'name', value)}
1021
823
  />
1022
- <Text style={styles.label}>Font Weight</Text>
824
+ <Text style={styles.label}>Additional: Email Address</Text>
1023
825
  <TextInput
1024
826
  style={styles.input}
1025
- value={String(androidConfig.appearanceSettings.fontWeight)}
1026
- onChangeText={value => updateAndroidConfigAppearanceSettings('fontWeight', parseInt(value) || '500')}
827
+ value={billingInfo.additional.email_address}
828
+ onChangeText={value => updateBillingInfo('additional', 'email_address', value)}
1027
829
  />
1028
- <Text style={styles.label}>Font Family</Text>
830
+ <Text style={styles.label}>Additional: Phone Number</Text>
1029
831
  <TextInput
1030
832
  style={styles.input}
1031
- value={androidConfig.appearanceSettings.fontFamily}
1032
- onChangeText={value => updateAndroidConfigAppearanceSettings('fontFamily', value)}
833
+ value={billingInfo.additional.phone_number}
834
+ onChangeText={value => updateBillingInfo('additional', 'phone_number', value)}
1033
835
  />
1034
- </>
1035
- )}
1036
-
1037
- {Platform.OS === 'ios' && (
1038
- <>
1039
- <Text style={styles.sectionTitle}>Theme Configuration (iOS)</Text>
1040
- <Text style={styles.label}>Body Background Color</Text>
836
+ <Text style={styles.label}>Additional: Description</Text>
1041
837
  <TextInput
1042
838
  style={styles.input}
1043
- value={themeConfiguration.bodyBackgroundColor}
1044
- onChangeText={value => updateThemeConfiguration('bodyBackgroundColor', value)}
839
+ value={billingInfo.additional.description}
840
+ onChangeText={value => updateBillingInfo('additional', 'description', value)}
1045
841
  />
1046
- <Text style={styles.label}>Container Background Color</Text>
1047
- <TextInput
1048
- style={styles.input}
1049
- value={themeConfiguration.containerBackgroundColor}
1050
- onChangeText={value => updateThemeConfiguration('containerBackgroundColor', value)}
842
+ <Text style={styles.label}>Additional Required: Name</Text>
843
+ <Switch
844
+ value={billingInfo.additionalRequired.name}
845
+ onValueChange={value => updateBillingInfo('additionalRequired', 'name', value)}
846
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
847
+ thumbColor={billingInfo.additionalRequired.name ? '#fff' : '#f4f3f4'}
1051
848
  />
1052
- <Text style={styles.label}>Primary Font Color</Text>
1053
- <TextInput
1054
- style={styles.input}
1055
- value={themeConfiguration.primaryFontColor}
1056
- onChangeText={value => updateThemeConfiguration('primaryFontColor', value)}
849
+ <Text style={styles.label}>Additional Required: Email Address</Text>
850
+ <Switch
851
+ value={billingInfo.additionalRequired.email_address}
852
+ onValueChange={value => updateBillingInfo('additionalRequired', 'email_address', value)}
853
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
854
+ thumbColor={billingInfo.additionalRequired.email_address ? '#fff' : '#f4f3f4'}
1057
855
  />
1058
- <Text style={styles.label}>Secondary Font Color</Text>
1059
- <TextInput
1060
- style={styles.input}
1061
- value={themeConfiguration.secondaryFontColor}
1062
- onChangeText={value => updateThemeConfiguration('secondaryFontColor', value)}
856
+ <Text style={styles.label}>Additional Required: Phone Number</Text>
857
+ <Switch
858
+ value={billingInfo.additionalRequired.phone_number}
859
+ onValueChange={value => updateBillingInfo('additionalRequired', 'phone_number', value)}
860
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
861
+ thumbColor={billingInfo.additionalRequired.phone_number ? '#fff' : '#f4f3f4'}
1063
862
  />
1064
- <Text style={styles.label}>Primary Button Background Color</Text>
1065
- <TextInput
1066
- style={styles.input}
1067
- value={themeConfiguration.primaryButtonBackgroundColor}
1068
- onChangeText={value => updateThemeConfiguration('primaryButtonBackgroundColor', value)}
863
+ <Text style={styles.label}>Additional Required: Description</Text>
864
+ <Switch
865
+ value={billingInfo.additionalRequired.description}
866
+ onValueChange={value => updateBillingInfo('additionalRequired', 'description', value)}
867
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
868
+ thumbColor={billingInfo.additionalRequired.description ? '#fff' : '#f4f3f4'}
1069
869
  />
1070
- <Text style={styles.label}>Primary Button Hover Color</Text>
870
+
871
+ {/* Android Configuration */}
872
+ {Platform.OS === 'android' && (
873
+ <>
874
+ <Text style={styles.sectionTitle}>Android Configuration</Text>
875
+ <Text style={styles.label}>Currency</Text>
876
+ <TextInput
877
+ style={styles.input}
878
+ value={androidConfig.currency}
879
+ onChangeText={value => updateAndroidConfig('currency', value)}
880
+ />
881
+ <Text style={styles.label}>Save Card</Text>
882
+ <Switch
883
+ value={androidConfig.saveCard}
884
+ onValueChange={value => updateAndroidConfig('saveCard', value)}
885
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
886
+ thumbColor={androidConfig.saveCard ? '#fff' : '#f4f3f4'}
887
+ />
888
+ <Text style={styles.label}>Save Account</Text>
889
+ <Switch
890
+ value={androidConfig.saveAccount}
891
+ onValueChange={value => updateAndroidConfig('saveAccount', value)}
892
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
893
+ thumbColor={androidConfig.saveAccount ? '#fff' : '#f4f3f4'}
894
+ />
895
+ <Text style={styles.label}>Show Receipt</Text>
896
+ <Switch
897
+ value={androidConfig.showReceipt}
898
+ onValueChange={value => updateAndroidConfig('showReceipt', value)}
899
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
900
+ thumbColor={androidConfig.showReceipt ? '#fff' : '#f4f3f4'}
901
+ />
902
+ <Text style={styles.label}>Show Donate</Text>
903
+ <Switch
904
+ value={androidConfig.showDonate}
905
+ onValueChange={value => updateAndroidConfig('showDonate', value)}
906
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
907
+ thumbColor={androidConfig.showDonate ? '#fff' : '#f4f3f4'}
908
+ />
909
+ <Text style={styles.label}>Show Total</Text>
910
+ <Switch
911
+ value={androidConfig.showTotal}
912
+ onValueChange={value => updateAndroidConfig('showTotal', value)}
913
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
914
+ thumbColor={androidConfig.showTotal ? '#fff' : '#f4f3f4'}
915
+ />
916
+ <Text style={styles.label}>Show Submit Button</Text>
917
+ <Switch
918
+ value={androidConfig.showSubmitButton}
919
+ onValueChange={value => updateAndroidConfig('showSubmitButton', value)}
920
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
921
+ thumbColor={androidConfig.showSubmitButton ? '#fff' : '#f4f3f4'}
922
+ />
923
+ <Text style={styles.label}>Name</Text>
924
+ <TextInput
925
+ style={styles.input}
926
+ value={androidConfig.name}
927
+ onChangeText={value => updateAndroidConfig('name', value)}
928
+ />
929
+ <Text style={styles.sectionTitle}>Android Fields</Text>
930
+ {androidConfig.fields.billing.map((field, index) => (
931
+ <View key={`billing-${index}`}>
932
+ <Text style={styles.label}>{`Billing ${field.name}`}</Text>
933
+ <TextInput
934
+ style={styles.input}
935
+ value={field.value}
936
+ onChangeText={value => updateAndroidConfigFields('billing', index, 'value', value)}
937
+ />
938
+ <Text style={styles.label}>{`Billing ${field.name} Required`}</Text>
939
+ <Switch
940
+ value={field.required}
941
+ onValueChange={value => updateAndroidConfigFields('billing', index, 'required', value)}
942
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
943
+ thumbColor={field.required ? '#fff' : '#f4f3f4'}
944
+ />
945
+ </View>
946
+ ))}
947
+ {androidConfig.fields.additional.map((field, index) => (
948
+ <View key={`additional-${index}`}>
949
+ <Text style={styles.label}>{`Additional ${field.name}`}</Text>
950
+ <TextInput
951
+ style={styles.input}
952
+ value={field.value}
953
+ onChangeText={value => updateAndroidConfigFields('additional', index, 'value', value)}
954
+ />
955
+ <Text style={styles.label}>{`Additional ${field.name} Required`}</Text>
956
+ <Switch
957
+ value={field.required}
958
+ onValueChange={value => updateAndroidConfigFields('additional', index, 'required', value)}
959
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
960
+ thumbColor={field.required ? '#fff' : '#f4f3f4'}
961
+ />
962
+ </View>
963
+ ))}
964
+ <Text style={styles.sectionTitle}>Android Appearance Settings</Text>
965
+ <Text style={styles.label}>Theme</Text>
966
+ <TextInput
967
+ style={styles.input}
968
+ value={androidConfig.appearanceSettings.theme}
969
+ onChangeText={value => updateAndroidConfigAppearanceSettings('theme', value)}
970
+ />
971
+ <Text style={styles.label}>Body Background Color</Text>
972
+ <TextInput
973
+ style={styles.input}
974
+ value={androidConfig.appearanceSettings.bodyBackgroundColor}
975
+ onChangeText={value => updateAndroidConfigAppearanceSettings('bodyBackgroundColor', value)}
976
+ />
977
+ <Text style={styles.label}>Container Background Color</Text>
978
+ <TextInput
979
+ style={styles.input}
980
+ value={androidConfig.appearanceSettings.containerBackgroundColor}
981
+ onChangeText={value => updateAndroidConfigAppearanceSettings('containerBackgroundColor', value)}
982
+ />
983
+ <Text style={styles.label}>Primary Font Color</Text>
984
+ <TextInput
985
+ style={styles.input}
986
+ value={androidConfig.appearanceSettings.primaryFontColor}
987
+ onChangeText={value => updateAndroidConfigAppearanceSettings('primaryFontColor', value)}
988
+ />
989
+ <Text style={styles.label}>Secondary Font Color</Text>
990
+ <TextInput
991
+ style={styles.input}
992
+ value={androidConfig.appearanceSettings.secondaryFontColor}
993
+ onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryFontColor', value)}
994
+ />
995
+ <Text style={styles.label}>Primary Button Background Color</Text>
996
+ <TextInput
997
+ style={styles.input}
998
+ value={androidConfig.appearanceSettings.primaryButtonBackgroundColor}
999
+ onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonBackgroundColor', value)}
1000
+ />
1001
+ <Text style={styles.label}>Primary Button Hover Color</Text>
1002
+ <TextInput
1003
+ style={styles.input}
1004
+ value={androidConfig.appearanceSettings.primaryButtonHoverColor}
1005
+ onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonHoverColor', value)}
1006
+ />
1007
+ <Text style={styles.label}>Primary Button Font Color</Text>
1008
+ <TextInput
1009
+ style={styles.input}
1010
+ value={androidConfig.appearanceSettings.primaryButtonFontColor}
1011
+ onChangeText={value => updateAndroidConfigAppearanceSettings('primaryButtonFontColor', value)}
1012
+ />
1013
+ <Text style={styles.label}>Secondary Button Background Color</Text>
1014
+ <TextInput
1015
+ style={styles.input}
1016
+ value={androidConfig.appearanceSettings.secondaryButtonBackgroundColor}
1017
+ onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonBackgroundColor', value)}
1018
+ />
1019
+ <Text style={styles.label}>Secondary Button Hover Color</Text>
1020
+ <TextInput
1021
+ style={styles.input}
1022
+ value={androidConfig.appearanceSettings.secondaryButtonHoverColor}
1023
+ onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonHoverColor', value)}
1024
+ />
1025
+ <Text style={styles.label}>Secondary Button Font Color</Text>
1026
+ <TextInput
1027
+ style={styles.input}
1028
+ value={androidConfig.appearanceSettings.secondaryButtonFontColor}
1029
+ onChangeText={value => updateAndroidConfigAppearanceSettings('secondaryButtonFontColor', value)}
1030
+ />
1031
+ <Text style={styles.label}>Border Radius</Text>
1032
+ <TextInput
1033
+ style={styles.input}
1034
+ value={androidConfig.appearanceSettings.borderRadius}
1035
+ onChangeText={value => updateAndroidConfigAppearanceSettings('borderRadius', value)}
1036
+ />
1037
+ <Text style={styles.label}>Font Size</Text>
1038
+ <TextInput
1039
+ style={styles.input}
1040
+ value={androidConfig.appearanceSettings.fontSize}
1041
+ onChangeText={value => updateAndroidConfigAppearanceSettings('fontSize', value)}
1042
+ />
1043
+ <Text style={styles.label}>Font Weight</Text>
1044
+ <TextInput
1045
+ style={styles.input}
1046
+ value={String(androidConfig.appearanceSettings.fontWeight)}
1047
+ onChangeText={value => updateAndroidConfigAppearanceSettings('fontWeight', parseInt(value) || '500')}
1048
+ />
1049
+ <Text style={styles.label}>Font Family</Text>
1050
+ <TextInput
1051
+ style={styles.input}
1052
+ value={androidConfig.appearanceSettings.fontFamily}
1053
+ onChangeText={value => updateAndroidConfigAppearanceSettings('fontFamily', value)}
1054
+ />
1055
+ </>
1056
+ )}
1057
+
1058
+ {/* iOS Theme Configuration */}
1059
+ {Platform.OS === 'ios' && (
1060
+ <>
1061
+ <Text style={styles.sectionTitle}>Theme Configuration (iOS)</Text>
1062
+ <Text style={styles.label}>Body Background Color</Text>
1063
+ <TextInput
1064
+ style={styles.input}
1065
+ value={themeConfiguration.bodyBackgroundColor}
1066
+ onChangeText={value => updateThemeConfiguration('bodyBackgroundColor', value)}
1067
+ />
1068
+ <Text style={styles.label}>Container Background Color</Text>
1069
+ <TextInput
1070
+ style={styles.input}
1071
+ value={themeConfiguration.containerBackgroundColor}
1072
+ onChangeText={value => updateThemeConfiguration('containerBackgroundColor', value)}
1073
+ />
1074
+ <Text style={styles.label}>Primary Font Color</Text>
1075
+ <TextInput
1076
+ style={styles.input}
1077
+ value={themeConfiguration.primaryFontColor}
1078
+ onChangeText={value => updateThemeConfiguration('primaryFontColor', value)}
1079
+ />
1080
+ <Text style={styles.label}>Secondary Font Color</Text>
1081
+ <TextInput
1082
+ style={styles.input}
1083
+ value={themeConfiguration.secondaryFontColor}
1084
+ onChangeText={value => updateThemeConfiguration('secondaryFontColor', value)}
1085
+ />
1086
+ <Text style={styles.label}>Primary Button Background Color</Text>
1087
+ <TextInput
1088
+ style={styles.input}
1089
+ value={themeConfiguration.primaryButtonBackgroundColor}
1090
+ onChangeText={value => updateThemeConfiguration('primaryButtonBackgroundColor', value)}
1091
+ />
1092
+ <Text style={styles.label}>Primary Button Hover Color</Text>
1093
+ <TextInput
1094
+ style={styles.input}
1095
+ value={themeConfiguration.primaryButtonHoverColor}
1096
+ onChangeText={value => updateThemeConfiguration('primaryButtonHoverColor', value)}
1097
+ />
1098
+ <Text style={styles.label}>Primary Button Font Color</Text>
1099
+ <TextInput
1100
+ style={styles.input}
1101
+ value={themeConfiguration.primaryButtonFontColor}
1102
+ onChangeText={value => updateThemeConfiguration('primaryButtonFontColor', value)}
1103
+ />
1104
+ <Text style={styles.label}>Secondary Button Background Color</Text>
1105
+ <TextInput
1106
+ style={styles.input}
1107
+ value={themeConfiguration.secondaryButtonBackgroundColor}
1108
+ onChangeText={value => updateThemeConfiguration('secondaryButtonBackgroundColor', value)}
1109
+ />
1110
+ <Text style={styles.label}>Secondary Button Hover Color</Text>
1111
+ <TextInput
1112
+ style={styles.input}
1113
+ value={themeConfiguration.secondaryButtonHoverColor}
1114
+ onChangeText={value => updateThemeConfiguration('secondaryButtonHoverColor', value)}
1115
+ />
1116
+ <Text style={styles.label}>Secondary Button Font Color</Text>
1117
+ <TextInput
1118
+ style={styles.input}
1119
+ value={themeConfiguration.secondaryButtonFontColor}
1120
+ onChangeText={value => updateThemeConfiguration('secondaryButtonFontColor', value)}
1121
+ />
1122
+ <Text style={styles.label}>Border Radius</Text>
1123
+ <TextInput
1124
+ style={styles.input}
1125
+ value={themeConfiguration.borderRadius}
1126
+ onChangeText={value => updateThemeConfiguration('borderRadius', value)}
1127
+ />
1128
+ <Text style={styles.label}>Font Size</Text>
1129
+ <TextInput
1130
+ style={styles.input}
1131
+ value={themeConfiguration.fontSize}
1132
+ onChangeText={value => updateThemeConfiguration('fontSize', value)}
1133
+ />
1134
+ <Text style={styles.label}>Font Weight</Text>
1135
+ <TextInput
1136
+ style={styles.input}
1137
+ value={String(themeConfiguration.fontWeight)}
1138
+ onChangeText={value => updateThemeConfiguration('fontWeight', parseInt(value) || 500)}
1139
+ />
1140
+ <Text style={styles.label}>Font Family</Text>
1141
+ <TextInput
1142
+ style={styles.input}
1143
+ value={themeConfiguration.fontFamily}
1144
+ onChangeText={value => updateThemeConfiguration('fontFamily', value)}
1145
+ />
1146
+ </>
1147
+ )}
1148
+
1149
+ {/* GrailPay Parameters */}
1150
+ <Text style={styles.sectionTitle}>GrailPay Parameters</Text>
1151
+ <Text style={styles.label}>Role</Text>
1071
1152
  <TextInput
1072
1153
  style={styles.input}
1073
- value={themeConfiguration.primaryButtonHoverColor}
1074
- onChangeText={value => updateThemeConfiguration('primaryButtonHoverColor', value)}
1154
+ value={grailPayParams.role}
1155
+ onChangeText={value => updateGrailPayParams('role', value)}
1075
1156
  />
1076
- <Text style={styles.label}>Primary Button Font Color</Text>
1157
+ <Text style={styles.label}>Timeout</Text>
1077
1158
  <TextInput
1078
1159
  style={styles.input}
1079
- value={themeConfiguration.primaryButtonFontColor}
1080
- onChangeText={value => updateThemeConfiguration('primaryButtonFontColor', value)}
1160
+ value={String(grailPayParams.timeout)}
1161
+ onChangeText={value => updateGrailPayParams('timeout', parseInt(value) || 10)}
1081
1162
  />
1082
- <Text style={styles.label}>Secondary Button Background Color</Text>
1083
- <TextInput
1084
- style={styles.input}
1085
- value={themeConfiguration.secondaryButtonBackgroundColor}
1086
- onChangeText={value => updateThemeConfiguration('secondaryButtonBackgroundColor', value)}
1163
+ <Text style={styles.label}>Is Sandbox</Text>
1164
+ <Switch
1165
+ value={grailPayParams.isSandbox}
1166
+ onValueChange={value => updateGrailPayParams('isSandbox', value)}
1167
+ trackColor={{ false: '#ccc', true: '#2563EB' }}
1168
+ thumbColor={grailPayParams.isSandbox ? '#fff' : '#f4f3f4'}
1087
1169
  />
1088
- <Text style={styles.label}>Secondary Button Hover Color</Text>
1170
+ <Text style={styles.label}>Branding Name</Text>
1089
1171
  <TextInput
1090
1172
  style={styles.input}
1091
- value={themeConfiguration.secondaryButtonHoverColor}
1092
- onChangeText={value => updateThemeConfiguration('secondaryButtonHoverColor', value)}
1173
+ value={grailPayParams.brandingName}
1174
+ onChangeText={value => updateGrailPayParams('brandingName', value)}
1093
1175
  />
1094
- <Text style={styles.label}>Secondary Button Font Color</Text>
1176
+ <Text style={styles.label}>Finder Subtitle</Text>
1095
1177
  <TextInput
1096
1178
  style={styles.input}
1097
- value={themeConfiguration.secondaryButtonFontColor}
1098
- onChangeText={value => updateThemeConfiguration('secondaryButtonFontColor', value)}
1179
+ value={grailPayParams.finderSubtitle}
1180
+ onChangeText={value => updateGrailPayParams('finderSubtitle', value)}
1099
1181
  />
1100
- <Text style={styles.label}>Border Radius</Text>
1182
+ <Text style={styles.label}>Search Placeholder</Text>
1101
1183
  <TextInput
1102
1184
  style={styles.input}
1103
- value={themeConfiguration.borderRadius}
1104
- onChangeText={value => updateThemeConfiguration('borderRadius', value)}
1185
+ value={grailPayParams.searchPlaceholder}
1186
+ onChangeText={value => updateGrailPayParams('searchPlaceholder', value)}
1105
1187
  />
1106
- <Text style={styles.label}>Font Size</Text>
1188
+
1189
+ {/* Recurring Data */}
1190
+ <Text style={styles.sectionTitle}>Recurring Data</Text>
1191
+ <Text style={styles.label}>Allow Cycles</Text>
1107
1192
  <TextInput
1108
1193
  style={styles.input}
1109
- value={themeConfiguration.fontSize}
1110
- onChangeText={value => updateThemeConfiguration('fontSize', value)}
1194
+ value={String(recurringData.allowCycles)}
1195
+ onChangeText={value => updateRecurringData('allowCycles', parseInt(value) || 2)}
1111
1196
  />
1112
- <Text style={styles.label}>Font Weight</Text>
1197
+ <Text style={styles.label}>Intervals</Text>
1198
+ <View style={styles.buttonGroup}>
1199
+ <Button
1200
+ title="Weekly"
1201
+ onPress={() => toggleInterval('weekly')}
1202
+ color={recurringData.intervals.includes('weekly') ? '#2563EB' : '#ccc'}
1203
+ />
1204
+ <Button
1205
+ title="Monthly"
1206
+ onPress={() => toggleInterval('monthly')}
1207
+ color={recurringData.intervals.includes('monthly') ? '#2563EB' : '#ccc'}
1208
+ />
1209
+ </View>
1210
+ <Text style={styles.label}>Recurring Start Type</Text>
1113
1211
  <TextInput
1114
1212
  style={styles.input}
1115
- value={String(themeConfiguration.fontWeight)}
1116
- onChangeText={value => updateThemeConfiguration('fontWeight', parseInt(value) || 500)}
1213
+ value={recurringData.recurringStartType}
1214
+ onChangeText={value => updateRecurringData('recurringStartType', value)}
1117
1215
  />
1118
- <Text style={styles.label}>Font Family</Text>
1216
+ <Text style={styles.label}>Recurring Start Date</Text>
1119
1217
  <TextInput
1120
1218
  style={styles.input}
1121
- value={themeConfiguration.fontFamily}
1122
- onChangeText={value => updateThemeConfiguration('fontFamily', value)}
1219
+ value={recurringData.recurringStartDate}
1220
+ onChangeText={value => updateRecurringData('recurringStartDate', value)}
1123
1221
  />
1124
1222
  </>
1125
1223
  )}
1126
1224
 
1127
- <Text style={styles.sectionTitle}>GrailPay Parameters</Text>
1128
- <Text style={styles.label}>Role</Text>
1129
- <TextInput
1130
- style={styles.input}
1131
- value={grailPayParams.role}
1132
- onChangeText={value => updateGrailPayParams('role', value)}
1133
- />
1134
- <Text style={styles.label}>Timeout</Text>
1135
- <TextInput
1136
- style={styles.input}
1137
- value={String(grailPayParams.timeout)}
1138
- onChangeText={value => updateGrailPayParams('timeout', parseInt(value) || 10)}
1139
- />
1140
- <Text style={styles.label}>Is Sandbox</Text>
1141
- <Switch
1142
- value={grailPayParams.isSandbox}
1143
- onValueChange={value => updateGrailPayParams('isSandbox', value)}
1144
- trackColor={{ false: '#ccc', true: '#2563EB' }}
1145
- thumbColor={grailPayParams.isSandbox ? '#fff' : '#f4f3f4'}
1146
- />
1147
- <Text style={styles.label}>Branding Name</Text>
1148
- <TextInput
1149
- style={styles.input}
1150
- value={grailPayParams.brandingName}
1151
- onChangeText={value => updateGrailPayParams('brandingName', value)}
1152
- />
1153
- <Text style={styles.label}>Finder Subtitle</Text>
1154
- <TextInput
1155
- style={styles.input}
1156
- value={grailPayParams.finderSubtitle}
1157
- onChangeText={value => updateGrailPayParams('finderSubtitle', value)}
1158
- />
1159
- <Text style={styles.label}>Search Placeholder</Text>
1160
- <TextInput
1161
- style={styles.input}
1162
- value={grailPayParams.searchPlaceholder}
1163
- onChangeText={value => updateGrailPayParams('searchPlaceholder', value)}
1164
- />
1165
-
1166
- <Text style={styles.sectionTitle}>Recurring Data</Text>
1167
- <Text style={styles.label}>Allow Cycles</Text>
1168
- <TextInput
1169
- style={styles.input}
1170
- value={String(recurringData.allowCycles)}
1171
- onChangeText={value => updateRecurringData('allowCycles', parseInt(value) || 2)}
1172
- />
1173
- <Text style={styles.label}>Intervals</Text>
1174
- <View style={styles.buttonGroup}>
1175
- <Button
1176
- title="Weekly"
1177
- onPress={() => toggleInterval('weekly')}
1178
- color={recurringData.intervals.includes('weekly') ? '#2563EB' : '#ccc'}
1179
- />
1180
- <Button
1181
- title="Monthly"
1182
- onPress={() => toggleInterval('monthly')}
1183
- color={recurringData.intervals.includes('monthly') ? '#2563EB' : '#ccc'}
1184
- />
1185
- </View>
1186
- <Text style={styles.label}>Recurring Start Type</Text>
1187
- <TextInput
1188
- style={styles.input}
1189
- value={recurringData.recurringStartType}
1190
- onChangeText={value => updateRecurringData('recurringStartType', value)}
1191
- />
1192
- <Text style={styles.label}>Recurring Start Date</Text>
1193
- <TextInput
1194
- style={styles.input}
1195
- value={recurringData.recurringStartDate}
1196
- onChangeText={value => updateRecurringData('recurringStartDate', value)}
1197
- />
1198
-
1199
- <View style={styles.buttonGroup}>
1200
- <Button title="Pay" onPress={handlePayment} />
1201
- {Platform.OS === 'ios' ? (
1202
- <Button title="Payment Ref" onPress={handlePaymentReference} disabled={loading} />
1203
- ) : (
1204
- <></>
1205
- )
1206
- }
1207
- </View>
1208
-
1209
- <Text selectable style={styles.result}>{result}</Text>
1225
+ <Text style={styles.sectionTitle}>SDK Response</Text>
1226
+ <Text selectable style={styles.result}>{result || 'No response yet'}</Text>
1210
1227
  </ScrollView>
1211
1228
  </View>
1212
1229
  );
1230
+
1213
1231
  };
1214
1232
 
1215
1233
  export default App;
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.8.6'
3
+ s.version = '1.8.7'
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.6",
3
+ "version": "1.8.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {