judokit-react-native 4.1.3 → 4.2.0

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.
Files changed (101) hide show
  1. package/JudoKit-ReactNative.podspec +42 -0
  2. package/LICENSE +1 -2
  3. package/README.md +106 -119
  4. package/android/build.gradle +65 -202
  5. package/android/gradle.properties +6 -1
  6. package/android/src/main/AndroidManifest.xml +2 -2
  7. package/android/src/main/AndroidManifestNew.xml +2 -0
  8. package/android/src/main/java/com/judopay/judokit/reactnative/Extensions.kt +382 -0
  9. package/android/src/main/java/com/judopay/judokit/reactnative/Helpers.kt +653 -0
  10. package/android/src/main/java/com/judopay/judokit/reactnative/JudoActivityEventListener.kt +49 -0
  11. package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativeModule.kt +238 -0
  12. package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativePackage.kt +16 -0
  13. package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.h +1 -1
  14. package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.m +2 -2
  15. package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.h +1 -1
  16. package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.m +1 -1
  17. package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.h +1 -1
  18. package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.m +3 -3
  19. package/ios/{Classes/RNJudo.h → JudoKitReactNative.h} +12 -6
  20. package/ios/{Classes/RNJudo.m → JudoKitReactNative.mm} +83 -81
  21. package/ios/{Classes/RNTypes.h → RNTypes.h} +8 -2
  22. package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.h +1 -1
  23. package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.m +105 -4
  24. package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.h +14 -14
  25. package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.m +46 -25
  26. package/lib/commonjs/index.js +268 -0
  27. package/lib/commonjs/index.js.map +1 -0
  28. package/lib/commonjs/judo-kit/index.js +212 -0
  29. package/lib/commonjs/judo-kit/index.js.map +1 -0
  30. package/lib/commonjs/types/index.js +267 -0
  31. package/lib/commonjs/types/index.js.map +1 -0
  32. package/lib/commonjs/types/judo-apple-pay-configuration.js +49 -0
  33. package/lib/commonjs/types/judo-apple-pay-configuration.js.map +1 -0
  34. package/lib/commonjs/types/judo-configuration.js +71 -0
  35. package/lib/commonjs/types/judo-configuration.js.map +1 -0
  36. package/lib/commonjs/types/judo-google-pay-configuration.js +28 -0
  37. package/lib/commonjs/types/judo-google-pay-configuration.js.map +1 -0
  38. package/lib/module/index.js +6 -0
  39. package/lib/module/index.js.map +1 -0
  40. package/lib/module/judo-kit/index.js +205 -0
  41. package/lib/module/judo-kit/index.js.map +1 -0
  42. package/lib/module/types/index.js +8 -0
  43. package/lib/module/types/index.js.map +1 -0
  44. package/lib/module/types/judo-apple-pay-configuration.js +43 -0
  45. package/lib/module/types/judo-apple-pay-configuration.js.map +1 -0
  46. package/lib/module/types/judo-configuration.js +65 -0
  47. package/lib/module/types/judo-configuration.js.map +1 -0
  48. package/lib/module/types/judo-google-pay-configuration.js +22 -0
  49. package/lib/module/types/judo-google-pay-configuration.js.map +1 -0
  50. package/lib/typescript/src/index.d.ts +4 -0
  51. package/lib/typescript/src/index.d.ts.map +1 -0
  52. package/lib/typescript/src/judo-kit/index.d.ts +86 -0
  53. package/lib/typescript/src/judo-kit/index.d.ts.map +1 -0
  54. package/lib/typescript/src/types/index.d.ts +4 -0
  55. package/lib/typescript/src/types/index.d.ts.map +1 -0
  56. package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts +75 -0
  57. package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts.map +1 -0
  58. package/lib/typescript/src/types/judo-configuration.d.ts +236 -0
  59. package/lib/typescript/src/types/judo-configuration.d.ts.map +1 -0
  60. package/lib/typescript/src/types/judo-google-pay-configuration.d.ts +42 -0
  61. package/lib/typescript/src/types/judo-google-pay-configuration.d.ts.map +1 -0
  62. package/package.json +158 -79
  63. package/src/index.tsx +50 -0
  64. package/src/judo-kit/index.ts +262 -0
  65. package/src/types/index.ts +53 -0
  66. package/src/types/judo-apple-pay-configuration.ts +85 -0
  67. package/src/types/judo-configuration.ts +263 -0
  68. package/src/types/judo-google-pay-configuration.ts +47 -0
  69. package/JudoPay.tsx +0 -334
  70. package/RNJudopay.podspec +0 -24
  71. package/android/src/main/java/com/reactlibrary/Extensions.kt +0 -372
  72. package/android/src/main/java/com/reactlibrary/Helpers.kt +0 -606
  73. package/android/src/main/java/com/reactlibrary/JudoReactNativeActivityEventListener.kt +0 -48
  74. package/android/src/main/java/com/reactlibrary/JudoReactNativeModule.kt +0 -257
  75. package/android/src/main/java/com/reactlibrary/JudoReactNativePBBAManager.kt +0 -52
  76. package/android/src/main/java/com/reactlibrary/JudoReactNativePackage.kt +0 -14
  77. package/components/JudoPBBAButton.ts +0 -2
  78. package/ios/.xcode.env +0 -11
  79. package/ios/Classes/Views/RNPBBAButtonManager.m +0 -42
  80. package/ios/Classes/Wrappers/RNPBBAWrappers.h +0 -40
  81. package/ios/Classes/Wrappers/RNPBBAWrappers.m +0 -57
  82. package/ios/Podfile +0 -44
  83. package/ios/Podfile.lock +0 -572
  84. package/ios/RNJudo.xcodeproj/project.pbxproj +0 -703
  85. package/ios/RNJudo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  86. package/ios/RNJudo.xcodeproj/xcshareddata/xcschemes/RNJudo.xcscheme +0 -97
  87. package/ios/RNJudo.xcworkspace/contents.xcworkspacedata +0 -10
  88. package/ios/RNJudoTests/Info.plist +0 -22
  89. package/ios/RNJudoTests/MockConfiguration.json +0 -114
  90. package/ios/RNJudoTests/NSDictionaryConvertTests.m +0 -475
  91. package/ios/RNJudoTests/RNApplePayWrappersTests.m +0 -770
  92. package/ios/RNJudoTests/RNJudoTests.m +0 -37
  93. package/ios/RNJudoTests/RNMocks.h +0 -54
  94. package/ios/RNJudoTests/RNMocks.m +0 -55
  95. package/ios/RNJudoTests/RNPBBAWrappersTests.m +0 -121
  96. package/ios/RNJudoTests/RNThemeTests.m +0 -576
  97. package/ios/RNJudoTests/RNWrappersTests.m +0 -947
  98. package/types/JudoApplePayTypes.tsx +0 -59
  99. package/types/JudoGooglePayTypes.tsx +0 -47
  100. package/types/JudoPBBATypes.tsx +0 -7
  101. package/types/JudoTypes.tsx +0 -251
@@ -1,59 +0,0 @@
1
- export interface JudoApplePayConfiguration {
2
- merchantId: string
3
- countryCode: string
4
- paymentSummaryItems: JudoPaymentSummaryItem[]
5
- merchantCapabilities?: JudoMerchantCapability
6
- requiredBillingContactFields?: JudoContactField
7
- requiredShippingContactFields?: JudoContactField
8
- shippingMethods?: JudoShippingMethod[]
9
- shippingType?: JudoShippingType
10
- returnedInfo?: JudoReturnedInfo
11
- }
12
-
13
- export enum JudoPaymentSummaryItemType {
14
- Final,
15
- Pending
16
- }
17
-
18
- export interface JudoPaymentSummaryItem {
19
- label: string
20
- amount: string
21
- type?: JudoPaymentSummaryItemType
22
- }
23
-
24
- export enum JudoMerchantCapability {
25
- ThreeDS = 1 << 0,
26
- EMV = 1 << 1,
27
- Credit = 1 << 2,
28
- Debit = 1 << 3,
29
- All = 1 << 4
30
- }
31
-
32
- export enum JudoContactField {
33
- PostalAddress = 1 << 0,
34
- Phone = 1 << 1,
35
- Email = 1 << 2,
36
- Name = 1 << 3,
37
- All = 1 << 4
38
- }
39
-
40
- export interface JudoShippingMethod {
41
- identifier: string
42
- detail: string
43
- label: string
44
- amount: string
45
- type: JudoPaymentSummaryItemType
46
- }
47
-
48
- export enum JudoShippingType {
49
- Shipping,
50
- Delivery,
51
- StorePickup,
52
- ServicePickup
53
- }
54
-
55
- export enum JudoReturnedInfo {
56
- BillingDetails = 1 << 0,
57
- ShippingDetails = 1 << 1,
58
- All = 1 << 2
59
- }
@@ -1,47 +0,0 @@
1
- export enum JudoGooglePayEnvironment {
2
- TEST,
3
- PRODUCTION
4
- }
5
-
6
- export enum JudoAddressFormat {
7
- MIN,
8
- FULL
9
- }
10
-
11
- export interface JudoBillingAddressParameters {
12
- addressFormat: JudoAddressFormat
13
- isPhoneNumberRequired: boolean
14
- }
15
-
16
- export interface JudoShippingAddressParameters {
17
- allowedCountryCodes?: string[]
18
- isPhoneNumberRequired: boolean
19
- }
20
-
21
- export enum JudoGooglePayPriceStatus {
22
- FINAL,
23
- ESTIMATED,
24
- NOT_CURRENTLY_KNOWN
25
- }
26
-
27
- export enum JudoCheckoutOption {
28
- DEFAULT,
29
- COMPLETE_IMMEDIATE_PURCHASE
30
- }
31
-
32
- export interface JudoGooglePayConfiguration {
33
- environment: JudoGooglePayEnvironment
34
- merchantName?: string
35
- countryCode: string
36
- transactionId?: string
37
- totalPriceStatus: JudoGooglePayPriceStatus
38
- totalPriceLabel?: string
39
- checkoutOption?: JudoCheckoutOption
40
- isEmailRequired?: boolean
41
- isBillingAddressRequired: boolean
42
- billingAddressParameters?: JudoBillingAddressParameters
43
- isShippingAddressRequired: boolean
44
- shippingAddressParameters?: JudoShippingAddressParameters
45
- allowPrepaidCards?: boolean
46
- allowCreditCards?: boolean
47
- }
@@ -1,7 +0,0 @@
1
- export interface JudoPBBAConfiguration {
2
- mobileNumber?: string
3
- emailAddress?: string
4
- appearsOnStatement?: string
5
- deeplinkScheme?: string
6
- deeplinkURL?: string
7
- }
@@ -1,251 +0,0 @@
1
- import { JudoApplePayConfiguration } from './JudoApplePayTypes'
2
- import { JudoGooglePayConfiguration } from './JudoGooglePayTypes'
3
- import { JudoPBBAConfiguration } from './JudoPBBATypes'
4
-
5
- export interface JudoConfiguration {
6
- judoId: string
7
- amount: JudoAmount
8
- reference: JudoReference
9
- cardAddress?: JudoAddress
10
- uiConfiguration?: JudoUIConfiguration
11
- paymentMethods?: JudoPaymentMethod
12
- supportedCardNetworks?: JudoCardNetwork
13
- primaryAccountDetails?: JudoAccountDetails
14
- applePayConfiguration?: JudoApplePayConfiguration
15
- googlePayConfiguration?: JudoGooglePayConfiguration
16
- pbbaConfiguration?: JudoPBBAConfiguration
17
- isInitialRecurringPayment?: boolean
18
- networkTimeout?: NetworkTimeout
19
- challengeRequestIndicator?: ChallengeRequestIndicator
20
- scaExemption?: ScaExemption
21
- mobileNumber?: string
22
- phoneCountryCode?: string
23
- emailAddress?: string
24
- threeDSTwoMaxTimeout?: number
25
- threeDSTwoMessageVersion?: string
26
- isDelayedAuthorisation?: boolean
27
- }
28
-
29
- export enum ChallengeRequestIndicator {
30
- NoPreference = 'noPreference',
31
- NoChallenge = 'noChallenge',
32
- ChallengePreferred = 'challengePreferred',
33
- ChallengeAsMandate = 'challengeAsMandate'
34
- }
35
-
36
- export enum ScaExemption {
37
- LowValue = 'lowValue',
38
- SecureCorporate = 'secureCorporate',
39
- TrustedBeneficiary = 'trustedBeneficiary',
40
- TransactionRiskAnalysis = 'transactionRiskAnalysis'
41
- }
42
-
43
- export interface NetworkTimeout {
44
- connectTimeout?: number
45
- readTimeout?: number
46
- writeTimeout?: number
47
- }
48
-
49
- export enum JudoTransactionType {
50
- Payment = 1,
51
- PreAuth = 2,
52
- RegisterCard = 3,
53
- CheckCard = 4,
54
- SaveCard = 5,
55
- Unknown = -1
56
- }
57
-
58
- export enum JudoTransactionMode {
59
- Payment,
60
- PreAuth,
61
- ServerToServer
62
- }
63
-
64
- export enum JudoTransactionResult {
65
- Error,
66
- Success,
67
- Declined,
68
- Unknown = -1
69
- }
70
-
71
- export interface JudoAmount {
72
- value: string
73
- currency: string
74
- }
75
-
76
- export interface JudoReference {
77
- consumerReference: string
78
- paymentReference?: string
79
- metadata?: Record<string, string>
80
- }
81
-
82
- export interface JudoAddress {
83
- line1?: string
84
- line2?: string
85
- line3?: string
86
- postCode?: string
87
- town?: string
88
- countryCode?: number
89
- state?: string
90
- }
91
-
92
- export interface JudoThreeDSToolbarCustomization {
93
- backgroundColor?: string
94
- headerText?: string
95
- buttonText?: string
96
- textFontName?: string
97
- textColor?: string
98
- textFontSize?: number
99
- }
100
-
101
- export interface JudoThreeDSLabelCustomization {
102
- headingTextFontName?: string
103
- headingTextColor?: string
104
- headingTextFontSize?: number
105
- textFontName?: string
106
- textColor?: string
107
- textFontSize?: number
108
- }
109
-
110
- export interface JudoThreeDSTextBoxCustomization {
111
- borderWidth?: number
112
- borderColor?: string
113
- cornerRadius?: number
114
- textFontName?: string
115
- textColor?: string
116
- textFontSize?: number
117
- }
118
-
119
- export enum JudoThreeDSButtonType {
120
- SUBMIT = 'SUBMIT',
121
- CONTINUE = 'CONTINUE',
122
- NEXT = 'NEXT',
123
- CANCEL = 'CANCEL',
124
- RESEND = 'RESEND'
125
- }
126
-
127
- export interface JudoThreeDSButtonCustomization {
128
- backgroundColor?: string
129
- cornerRadius?: number
130
- textFontName?: string
131
- textColor?: string
132
- textFontSize?: number
133
- }
134
-
135
- export interface JudoThreeDSUIConfiguration {
136
- buttonCustomizations?: Partial<
137
- Record<JudoThreeDSButtonType, JudoThreeDSButtonCustomization>
138
- >
139
- toolbarCustomization?: JudoThreeDSToolbarCustomization
140
- labelCustomization?: JudoThreeDSLabelCustomization
141
- textBoxCustomization?: JudoThreeDSTextBoxCustomization
142
- }
143
-
144
- export interface JudoUIConfiguration {
145
- isAVSEnabled: boolean
146
- shouldPaymentMethodsDisplayAmount: boolean
147
- shouldPaymentButtonDisplayAmount: boolean
148
- shouldPaymentMethodsVerifySecurityCode: boolean
149
- shouldAskForBillingInformation?: boolean
150
- theme?: JudoTheme
151
- threeDSUIConfiguration?: JudoThreeDSUIConfiguration
152
- }
153
-
154
- export interface JudoTheme {
155
- largeTitleFont: string
156
- largeTitleSize: number
157
- titleFont: string
158
- titleSize: number
159
- headlineFont: string
160
- headlineSize: number
161
- headlineLightFont: string
162
- headlineLightSize: number
163
- bodyFont: string
164
- bodySize: number
165
- bodyBoldFont: string
166
- bodyBoldSize: number
167
- captionFont: string
168
- captionSize: number
169
- captionBoldFont: string
170
- captionBoldSize: number
171
- jpBlackColor: string
172
- jpDarkGrayColor: string
173
- jpGrayColor: string
174
- jpLightGrayColor: string
175
- jpRedColor: string
176
- jpWhiteColor: string
177
- buttonColor: string
178
- buttonTitleColor: string
179
- backButtonImage: string
180
- buttonCornerRadius: number
181
- }
182
-
183
- export enum JudoPaymentMethod {
184
- Card = 1 << 0,
185
- ApplePay = 1 << 1,
186
- GooglePay = 1 << 2,
187
- iDEAL = 1 << 3,
188
- PayByBankApp = 1 << 4,
189
- All = 1 << 5
190
- }
191
-
192
- export enum JudoCardNetwork {
193
- Visa = 1 << 0,
194
- Mastercard = 1 << 1,
195
- Maestro = 1 << 2,
196
- Amex = 1 << 3,
197
- ChinaUnionPay = 1 << 4,
198
- JCB = 1 << 5,
199
- Discover = 1 << 6,
200
- DinersClub = 1 << 7,
201
- All = 1 << 8
202
- }
203
-
204
- export interface JudoAccountDetails {
205
- name?: string
206
- accountNumber?: string
207
- dateOfBirth?: string
208
- postCode?: string
209
- }
210
-
211
- export interface JudoCardDetails {
212
- cardLastFour?: string
213
- endDate?: string
214
- cardToken?: string
215
- cardNetwork?: JudoCardNetwork
216
- bank?: string
217
- cardCategory?: string
218
- cardCountry?: string
219
- cardFunding?: string
220
- cardScheme?: string
221
- cardHolderName?: string
222
- }
223
-
224
- export interface JudoConsumer {
225
- consumerReference?: string
226
- consumerToken?: string
227
- }
228
-
229
- export interface JudoResponse {
230
- receiptId?: string
231
- yourPaymentReference?: string
232
- type?: JudoTransactionType
233
- createdAt?: string
234
- result?: JudoTransactionResult
235
- message?: string
236
- judoId?: string
237
- merchantName?: string
238
- appearsOnStatementAs?: string
239
- originalAmount?: string
240
- netAmount?: string
241
- amount?: string
242
- currency?: string
243
- cardDetails?: JudoCardDetails
244
- consumerResponse?: JudoConsumer
245
- }
246
-
247
- export interface JudoAuthorization {
248
- token: string
249
- secret?: string
250
- paymentSession?: string
251
- }