@primer-io/react-native 0.15.4 → 2.0.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 (203) hide show
  1. package/README.md +114 -24
  2. package/android/build.gradle +7 -2
  3. package/android/gradle.properties +3 -3
  4. package/android/src/main/java/com/primerioreactnative/PrimerRN.kt +122 -143
  5. package/android/src/main/java/com/primerioreactnative/PrimerRNEventListener.kt +212 -127
  6. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerCheckoutDataRN.kt +12 -0
  7. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerClientSessionRN.kt +54 -0
  8. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerErrorRN.kt +3 -7
  9. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerEvents.kt +13 -0
  10. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentInstrumentTokenRN.kt +4 -4
  11. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentMethodDataRN.kt +8 -0
  12. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerSettingsRN.kt +43 -125
  13. package/android/src/main/java/com/primerioreactnative/extensions/Payment.kt +6 -0
  14. package/android/src/main/java/com/primerioreactnative/extensions/PrimerAddress.kt +15 -0
  15. package/android/src/main/java/com/primerioreactnative/extensions/PrimerCheckoutData.kt +7 -0
  16. package/android/src/main/java/com/primerioreactnative/extensions/PrimerClientSession.kt +15 -0
  17. package/android/src/main/java/com/primerioreactnative/extensions/PrimerCustomer.kt +13 -0
  18. package/android/src/main/java/com/primerioreactnative/extensions/PrimerLineItem.kt +8 -0
  19. package/android/src/main/java/com/primerioreactnative/extensions/PrimerOrder.kt +6 -0
  20. package/android/src/main/java/com/primerioreactnative/extensions/PrimerPaymentMethodData.kt +7 -0
  21. package/android/src/main/java/com/primerioreactnative/utils/ErrorHelper.kt +1 -3
  22. package/android/src/main/java/com/primerioreactnative/utils/JsonConverter.kt +45 -0
  23. package/android/src/main/java/com/primerioreactnative/utils/PrimerImplementedRNCallbacks.kt +16 -6
  24. package/ios/DataModels/ImplementedRNCallbacks.swift +31 -0
  25. package/ios/DataModels/PrimerErrorRN.swift +0 -17
  26. package/ios/DataModels/PrimerSettingsRN.swift +69 -150
  27. package/ios/DataModels/PrimerThemeRN.swift +1 -10
  28. package/ios/{Pods/Manifest.lock → Podfile.lock} +1 -1
  29. package/ios/RNTPrimer.m +26 -12
  30. package/ios/RNTPrimer.swift +297 -237
  31. package/ios/ReactNative.xcodeproj/project.pbxproj +14 -14
  32. package/lib/commonjs/Primer.js +187 -176
  33. package/lib/commonjs/Primer.js.map +1 -1
  34. package/lib/commonjs/RNPrimer.js +102 -40
  35. package/lib/commonjs/RNPrimer.js.map +1 -1
  36. package/lib/commonjs/index.js +117 -4
  37. package/lib/commonjs/index.js.map +1 -1
  38. package/lib/commonjs/models/Primer.js +6 -0
  39. package/lib/commonjs/models/{action-request.js.map → Primer.js.map} +0 -0
  40. package/lib/commonjs/models/PrimerCheckoutData.js +9 -0
  41. package/lib/commonjs/models/PrimerCheckoutData.js.map +1 -0
  42. package/lib/commonjs/models/PrimerCheckoutPaymentMethodData.js +2 -0
  43. package/lib/commonjs/models/{client-session-actions-request.js.map → PrimerCheckoutPaymentMethodData.js.map} +0 -0
  44. package/lib/commonjs/models/PrimerClientSession.js +2 -0
  45. package/lib/commonjs/models/{primer-callbacks.js.map → PrimerClientSession.js.map} +0 -0
  46. package/lib/commonjs/models/{utils/countryCode.js → PrimerCountryCode.js} +1 -1
  47. package/lib/commonjs/models/PrimerCountryCode.js.map +1 -0
  48. package/lib/commonjs/models/{utils/currencyCode.js → PrimerCurrencyCode.js} +1 -1
  49. package/lib/commonjs/models/PrimerCurrencyCode.js.map +1 -0
  50. package/lib/commonjs/models/PrimerError.js +28 -0
  51. package/lib/commonjs/models/PrimerError.js.map +1 -0
  52. package/lib/commonjs/models/PrimerPaymentMethodTokenData.js +14 -0
  53. package/lib/commonjs/models/PrimerPaymentMethodTokenData.js.map +1 -0
  54. package/lib/commonjs/models/PrimerSessionIntent.js +14 -0
  55. package/lib/commonjs/models/PrimerSessionIntent.js.map +1 -0
  56. package/lib/commonjs/models/PrimerSettings.js +6 -0
  57. package/lib/commonjs/models/{primer-config.js.map → PrimerSettings.js.map} +0 -0
  58. package/lib/commonjs/models/PrimerTheme.js +2 -0
  59. package/lib/commonjs/models/{primer-request.js.map → PrimerTheme.js.map} +0 -0
  60. package/lib/commonjs/utils/index.js +1 -1
  61. package/lib/commonjs/utils/index.js.map +1 -1
  62. package/lib/module/Primer.js +187 -162
  63. package/lib/module/Primer.js.map +1 -1
  64. package/lib/module/RNPrimer.js +102 -40
  65. package/lib/module/RNPrimer.js.map +1 -1
  66. package/lib/module/index.js +9 -4
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/models/Primer.js +2 -0
  69. package/lib/{commonjs/models/primer-settings.js.map → module/models/Primer.js.map} +0 -0
  70. package/lib/module/models/PrimerCheckoutData.js +7 -0
  71. package/lib/module/models/PrimerCheckoutData.js.map +1 -0
  72. package/lib/module/models/PrimerCheckoutPaymentMethodData.js +2 -0
  73. package/lib/{commonjs/models/primer-theme.js.map → module/models/PrimerCheckoutPaymentMethodData.js.map} +0 -0
  74. package/lib/module/models/PrimerClientSession.js +2 -0
  75. package/lib/{commonjs/models/primer.js.map → module/models/PrimerClientSession.js.map} +0 -0
  76. package/lib/module/models/{utils/countryCode.js → PrimerCountryCode.js} +1 -1
  77. package/lib/module/models/PrimerCountryCode.js.map +1 -0
  78. package/lib/module/models/{utils/currencyCode.js → PrimerCurrencyCode.js} +1 -1
  79. package/lib/module/models/PrimerCurrencyCode.js.map +1 -0
  80. package/lib/module/models/PrimerError.js +19 -0
  81. package/lib/module/models/PrimerError.js.map +1 -0
  82. package/lib/module/models/PrimerPaymentMethodTokenData.js +7 -0
  83. package/lib/module/models/PrimerPaymentMethodTokenData.js.map +1 -0
  84. package/lib/module/models/PrimerSessionIntent.js +7 -0
  85. package/lib/module/models/PrimerSessionIntent.js.map +1 -0
  86. package/lib/module/models/PrimerSettings.js +2 -0
  87. package/lib/module/models/{action-request.js.map → PrimerSettings.js.map} +0 -0
  88. package/lib/module/models/PrimerTheme.js +2 -0
  89. package/lib/module/models/{client-session-actions-request.js.map → PrimerTheme.js.map} +0 -0
  90. package/lib/module/utils/index.js.map +1 -1
  91. package/lib/typescript/Primer.d.ts +2 -15
  92. package/lib/typescript/RNPrimer.d.ts +16 -9
  93. package/lib/typescript/index.d.ts +9 -3
  94. package/lib/typescript/models/Primer.d.ts +26 -0
  95. package/lib/typescript/models/PrimerCheckoutData.d.ts +15 -0
  96. package/lib/typescript/models/PrimerCheckoutPaymentMethodData.d.ts +5 -0
  97. package/lib/typescript/models/PrimerClientSession.d.ts +45 -0
  98. package/lib/typescript/models/{utils/countryCode.d.ts → PrimerCountryCode.d.ts} +1 -1
  99. package/lib/typescript/models/{utils/currencyCode.d.ts → PrimerCurrencyCode.d.ts} +1 -1
  100. package/lib/typescript/models/PrimerError.d.ts +11 -0
  101. package/lib/typescript/models/PrimerPaymentMethodTokenData.d.ts +116 -0
  102. package/lib/typescript/models/PrimerSessionIntent.d.ts +4 -0
  103. package/lib/typescript/models/PrimerSettings.d.ts +73 -0
  104. package/lib/typescript/models/{primer-theme.d.ts → PrimerTheme.d.ts} +1 -1
  105. package/lib/typescript/utils/index.d.ts +1 -1
  106. package/package.json +1 -1
  107. package/primer-io-react-native.podspec +1 -1
  108. package/src/Primer.ts +214 -196
  109. package/src/RNPrimer.ts +135 -50
  110. package/src/index.tsx +33 -6
  111. package/src/models/Primer.ts +35 -0
  112. package/src/models/PrimerCheckoutData.ts +18 -0
  113. package/src/models/PrimerCheckoutPaymentMethodData.ts +5 -0
  114. package/src/models/PrimerClientSession.ts +53 -0
  115. package/src/models/{utils/countryCode.ts → PrimerCountryCode.ts} +1 -1
  116. package/src/models/{utils/currencyCode.ts → PrimerCurrencyCode.ts} +1 -1
  117. package/src/models/PrimerError.ts +20 -0
  118. package/src/models/PrimerPaymentMethodTokenData.ts +130 -0
  119. package/src/models/PrimerSessionIntent.ts +4 -0
  120. package/src/models/PrimerSettings.ts +93 -0
  121. package/src/models/{primer-theme.ts → PrimerTheme.ts} +1 -1
  122. package/src/utils/index.ts +1 -1
  123. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerEventsRN.kt +0 -11
  124. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerIntentRN.kt +0 -80
  125. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerOnClientSessionActionsRequestRN.kt +0 -65
  126. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerRequestRN.kt +0 -9
  127. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerThemeRN.kt +0 -51
  128. package/android/src/main/java/com/primerioreactnative/utils/PrimerEventQueueRN.kt +0 -30
  129. package/ios/DataModels/PrimerIntentRN.swift +0 -10
  130. package/ios/DataModels/PrimerRequestRN.swift +0 -14
  131. package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -344
  132. package/ios/Pods/Pods.xcodeproj/xcuserdata/aladintaleb.xcuserdatad/xcschemes/Pods-ReactNative.xcscheme +0 -60
  133. package/ios/Pods/Pods.xcodeproj/xcuserdata/aladintaleb.xcuserdatad/xcschemes/xcschememanagement.plist +0 -16
  134. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-acknowledgements.markdown +0 -3
  135. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-acknowledgements.plist +0 -29
  136. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-dummy.m +0 -5
  137. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative.debug.xcconfig +0 -8
  138. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative.release.xcconfig +0 -8
  139. package/ios/ReactNative.xcworkspace/xcuserdata/aladintaleb.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  140. package/lib/commonjs/models/action-request.js +0 -2
  141. package/lib/commonjs/models/client-session-actions-request.js +0 -2
  142. package/lib/commonjs/models/payment-instrument-token.js +0 -30
  143. package/lib/commonjs/models/payment-instrument-token.js.map +0 -1
  144. package/lib/commonjs/models/primer-callbacks.js +0 -2
  145. package/lib/commonjs/models/primer-config.js +0 -2
  146. package/lib/commonjs/models/primer-error.js +0 -4
  147. package/lib/commonjs/models/primer-error.js.map +0 -1
  148. package/lib/commonjs/models/primer-intent.js +0 -4
  149. package/lib/commonjs/models/primer-intent.js.map +0 -1
  150. package/lib/commonjs/models/primer-request.js +0 -2
  151. package/lib/commonjs/models/primer-settings.js +0 -2
  152. package/lib/commonjs/models/primer-theme.js +0 -2
  153. package/lib/commonjs/models/primer.js +0 -2
  154. package/lib/commonjs/models/utils/countryCode.js.map +0 -1
  155. package/lib/commonjs/models/utils/currencyCode.js.map +0 -1
  156. package/lib/commonjs/models/utils/redirectScheme.js +0 -4
  157. package/lib/commonjs/models/utils/redirectScheme.js.map +0 -1
  158. package/lib/module/models/action-request.js +0 -2
  159. package/lib/module/models/client-session-actions-request.js +0 -2
  160. package/lib/module/models/payment-instrument-token.js +0 -28
  161. package/lib/module/models/payment-instrument-token.js.map +0 -1
  162. package/lib/module/models/primer-callbacks.js +0 -2
  163. package/lib/module/models/primer-callbacks.js.map +0 -1
  164. package/lib/module/models/primer-config.js +0 -2
  165. package/lib/module/models/primer-config.js.map +0 -1
  166. package/lib/module/models/primer-error.js +0 -2
  167. package/lib/module/models/primer-error.js.map +0 -1
  168. package/lib/module/models/primer-intent.js +0 -2
  169. package/lib/module/models/primer-intent.js.map +0 -1
  170. package/lib/module/models/primer-request.js +0 -2
  171. package/lib/module/models/primer-request.js.map +0 -1
  172. package/lib/module/models/primer-settings.js +0 -2
  173. package/lib/module/models/primer-settings.js.map +0 -1
  174. package/lib/module/models/primer-theme.js +0 -2
  175. package/lib/module/models/primer-theme.js.map +0 -1
  176. package/lib/module/models/primer.js +0 -2
  177. package/lib/module/models/primer.js.map +0 -1
  178. package/lib/module/models/utils/countryCode.js.map +0 -1
  179. package/lib/module/models/utils/currencyCode.js.map +0 -1
  180. package/lib/module/models/utils/redirectScheme.js +0 -2
  181. package/lib/module/models/utils/redirectScheme.js.map +0 -1
  182. package/lib/typescript/models/action-request.d.ts +0 -10
  183. package/lib/typescript/models/client-session-actions-request.d.ts +0 -15
  184. package/lib/typescript/models/payment-instrument-token.d.ts +0 -76
  185. package/lib/typescript/models/primer-callbacks.d.ts +0 -10
  186. package/lib/typescript/models/primer-config.d.ts +0 -40
  187. package/lib/typescript/models/primer-error.d.ts +0 -8
  188. package/lib/typescript/models/primer-intent.d.ts +0 -13
  189. package/lib/typescript/models/primer-request.d.ts +0 -7
  190. package/lib/typescript/models/primer-settings.d.ts +0 -63
  191. package/lib/typescript/models/primer.d.ts +0 -33
  192. package/lib/typescript/models/utils/redirectScheme.d.ts +0 -3
  193. package/src/models/action-request.ts +0 -12
  194. package/src/models/client-session-actions-request.ts +0 -21
  195. package/src/models/payment-instrument-token.ts +0 -109
  196. package/src/models/primer-callbacks.ts +0 -14
  197. package/src/models/primer-config.ts +0 -50
  198. package/src/models/primer-error.ts +0 -19
  199. package/src/models/primer-intent.ts +0 -49
  200. package/src/models/primer-request.ts +0 -7
  201. package/src/models/primer-settings.ts +0 -70
  202. package/src/models/primer.ts +0 -41
  203. package/src/models/utils/redirectScheme.ts +0 -5
@@ -1,5 +1,5 @@
1
1
  export type PrimerTheme = IPrimerTheme;
2
- interface IPrimerTheme {
2
+ export interface IPrimerTheme {
3
3
  colors?: ColorTheme;
4
4
  darkModeColors?: ColorTheme;
5
5
  }
@@ -1,4 +1,4 @@
1
- import type { RgbaColor } from 'src/models/primer-theme';
1
+ import type { RgbaColor } from "../models/PrimerTheme";
2
2
 
3
3
  export function toRgbColor(hex: string): RgbaColor | null {
4
4
  // Make sure it looks like a proper color hex string
@@ -1,11 +0,0 @@
1
- package com.primerioreactnative.datamodels
2
-
3
- sealed class PrimerEventsRN(val string: String) {
4
- object OnClientTokenCallback: PrimerEventsRN("onClientTokenCallback")
5
- object OnClientSessionActions: PrimerEventsRN("onClientSessionActions")
6
- object OnTokenizeSuccessCallback: PrimerEventsRN("onTokenizeSuccessCallback")
7
- object OnResumeSuccess: PrimerEventsRN("onResumeSuccess")
8
- object OnCheckoutDismissed: PrimerEventsRN("onCheckoutDismissed")
9
- object OnError: PrimerEventsRN("onError")
10
- object OnVaultSuccess: PrimerEventsRN("onVaultSuccess")
11
- }
@@ -1,80 +0,0 @@
1
- package com.primerioreactnative.datamodels
2
-
3
- import io.primer.android.PaymentMethod
4
- import io.primer.android.payment.card.Card
5
- import io.primer.android.payment.gocardless.GoCardless
6
- import io.primer.android.payment.google.GooglePay
7
- import io.primer.android.payment.klarna.Klarna
8
- import io.primer.android.payment.paypal.PayPal
9
- import kotlinx.serialization.Serializable
10
-
11
- @Serializable
12
- data class PrimerIntentRN(
13
- val vault: Boolean = false,
14
- val paymentMethod: PrimerPaymentMethodTypeRN = PrimerPaymentMethodTypeRN.Any,
15
- ) {
16
-
17
- fun toPaymentMethods(settings: PrimerSettingsRN): List<PaymentMethod> {
18
- return when (paymentMethod) {
19
- PrimerPaymentMethodTypeRN.Any -> {
20
- val countryCode = settings.order?.countryCode ?: throw Exception()
21
- val currency = settings.order.currency ?: throw Exception()
22
- val amount = settings.order.amount ?: throw Exception()
23
-
24
- val googlePay = GooglePay(
25
- countryCode = countryCode,
26
- currencyCode = currency,
27
- totalPrice = amount.toString(),
28
- )
29
-
30
- listOf(Klarna(), Card(), PayPal(), googlePay)
31
- }
32
- PrimerPaymentMethodTypeRN.Klarna -> listOf(Klarna())
33
- PrimerPaymentMethodTypeRN.Card -> listOf(Card())
34
- PrimerPaymentMethodTypeRN.PayPal -> listOf(PayPal())
35
- PrimerPaymentMethodTypeRN.GooglePay -> {
36
- val countryCode = settings.order?.countryCode ?: throw Exception()
37
- val currency = settings.order.currency ?: throw Exception()
38
- val amount = settings.order.amount ?: throw Exception()
39
-
40
- val googlePay = GooglePay(
41
- countryCode = countryCode,
42
- currencyCode = currency,
43
- totalPrice = amount.toString(),
44
- )
45
- listOf(googlePay)
46
- }
47
- PrimerPaymentMethodTypeRN.GoCardless -> {
48
- val companyName = settings.business?.name ?: throw Exception()
49
- val companyAddress = addressToString(settings.business.address) ?: throw Exception()
50
- val goCardless = GoCardless(
51
- companyName = companyName,
52
- companyAddress = companyAddress
53
- )
54
- return listOf(goCardless)
55
- }
56
- else -> throw Exception()
57
- }
58
- }
59
-
60
- companion object {
61
- fun addressToString(a: PrimerAddressRN?): String? {
62
- if (a == null) return null
63
- val values = listOf<String?>(a.line1, a.line2, a.postalCode, a.city, a.country)
64
- return values.reduce { acc, s ->
65
- s?.let { "$acc$s, " }
66
- }?.dropLast(2)
67
- }
68
- }
69
- }
70
-
71
- @Serializable
72
- enum class PrimerPaymentMethodTypeRN {
73
- Any,
74
- Klarna,
75
- Card,
76
- PayPal,
77
- GooglePay,
78
- ApplePay,
79
- GoCardless,
80
- }
@@ -1,65 +0,0 @@
1
- package com.primerioreactnative.datamodels
2
-
3
- import io.primer.android.data.action.models.ClientSessionActionsRequest
4
- import kotlinx.serialization.Serializable
5
-
6
- @Serializable
7
- data class PrimerOnClientSessionActionsRequestRN(
8
- val actions: List<Action>,
9
- ) {
10
-
11
- @Serializable
12
- data class Action(
13
- val type: String,
14
- val paymentMethodType: String? = null,
15
- val network: String? = null,
16
- val params: Params? = null,
17
- )
18
-
19
- @Serializable
20
- data class Params(
21
- val billingAddress: Map<String, String?>
22
- )
23
-
24
- companion object {
25
- fun build(
26
- request: ClientSessionActionsRequest,
27
- ): PrimerOnClientSessionActionsRequestRN {
28
- return PrimerOnClientSessionActionsRequestRN(
29
- actions = request.actions.map { action ->
30
- when (action) {
31
- is ClientSessionActionsRequest.SetPaymentMethod -> {
32
- Action(
33
- type = "SELECT_PAYMENT_METHOD",
34
- paymentMethodType = action.paymentMethodType,
35
- network = action.network,
36
- )
37
- }
38
- is ClientSessionActionsRequest.UnsetPaymentMethod -> {
39
- Action(
40
- type = "UNSELECT_PAYMENT_METHOD",
41
- )
42
- }
43
- is ClientSessionActionsRequest.SetBillingAddress -> {
44
- Action(
45
- type = "SET_BILLING_ADDRESS",
46
- params = Params(
47
- billingAddress = mapOf(
48
- "firstName" to action.firstName,
49
- "lastName" to action.lastName,
50
- "addressLine1" to action.addressLine1,
51
- "addressLine2" to action.addressLine2,
52
- "city" to action.city,
53
- "postalCode" to action.postalCode,
54
- "state" to action.state,
55
- "countryCode" to action.countryCode
56
- )
57
- )
58
- )
59
- }
60
- }
61
- }
62
- )
63
- }
64
- }
65
- }
@@ -1,9 +0,0 @@
1
- package com.primerioreactnative.datamodels
2
-
3
- import kotlinx.serialization.*
4
-
5
- @Serializable
6
- data class PrimerResumeRequest(
7
- val error: String? = null,
8
- val token: String? = null,
9
- )
@@ -1,51 +0,0 @@
1
- package com.primerioreactnative.datamodels
2
-
3
- import io.primer.android.InputThemeData
4
- import io.primer.android.PrimerTheme
5
- import kotlinx.serialization.Serializable
6
-
7
- @Serializable
8
- class PrimerThemeRN(
9
- private val colors: ColorThemeRN? = null,
10
- val darkModeColors: ColorThemeRN? = null,
11
- ) {
12
- fun format(): PrimerTheme {
13
- return PrimerTheme.build(
14
- input = InputThemeData()
15
- )
16
- }
17
- }
18
-
19
- @Serializable
20
- class ColorThemeRN(
21
- val mainColor: ColorRN? = null,
22
- val contrastingColor: ColorRN? = null,
23
- val background: ColorRN? = null,
24
- val text: ColorRN? = null,
25
- val contrastingText: ColorRN? = null,
26
- val borders: ColorRN? = null,
27
- val disabled: ColorRN? = null,
28
- val error: ColorRN? = null,
29
- )
30
-
31
- @Serializable
32
- class ColorRN(
33
- private val red: Int,
34
- private val green: Int,
35
- private val blue: Int,
36
- private val alpha: Int,
37
- ) {
38
-
39
- val hex: String
40
- get() {
41
- val alpha = pad(Integer.toHexString(alpha))
42
- val red = pad(Integer.toHexString(red))
43
- val green = pad(Integer.toHexString(green))
44
- val blue = pad(Integer.toHexString(blue))
45
- return "#$alpha$red$green$blue"
46
- }
47
-
48
- private fun pad(s: String): String {
49
- return if (s.length == 1) "0$s" else s
50
- }
51
- }
@@ -1,30 +0,0 @@
1
- package com.primerioreactnative.utils
2
-
3
- import com.facebook.react.bridge.Callback
4
- import java.util.*
5
-
6
- class PrimerEventQueueRN {
7
- private var mQueue: Deque<String> = ArrayDeque()
8
- private var mCallback: Callback? = null
9
-
10
- fun addRequestAndPoll(request: String) {
11
- mQueue.add(request)
12
- poll()
13
- }
14
-
15
- fun poll(cb: Callback? = null) {
16
- if (cb != null) mCallback = cb
17
- val callback = mCallback ?: return
18
- val next = mQueue.poll() ?: return
19
-
20
- callback.invoke(next)
21
-
22
- clear()
23
- }
24
-
25
- fun clear() {
26
- mQueue.clear()
27
- mCallback = null
28
- }
29
- }
30
-
@@ -1,10 +0,0 @@
1
- import PrimerSDK
2
-
3
- struct PrimerIntentRN: Decodable {
4
- let vault: Bool
5
- let paymentMethod: String
6
-
7
- var paymentMethodConfigType: PaymentMethodConfigType {
8
- PaymentMethodConfigType.init(rawValue: paymentMethod)
9
- }
10
- }
@@ -1,14 +0,0 @@
1
- struct PrimerInitRequest: Decodable {
2
- let intent: String;
3
- let token: String;
4
- let metadata: PrimerRequestMetadata?;
5
- }
6
-
7
- struct PrimerResumeRequest: Decodable {
8
- let error: String?
9
- let token: String?
10
- }
11
-
12
- struct PrimerRequestMetadata: Decodable {
13
- let message: String?
14
- }
@@ -1,344 +0,0 @@
1
- // !$*UTF8*$!
2
- {
3
- archiveVersion = 1;
4
- classes = {
5
- };
6
- objectVersion = 46;
7
- objects = {
8
-
9
- /* Begin PBXBuildFile section */
10
- 9E8C55F8977D10A75940A48A138A0AFE /* Pods-ReactNative-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 21494CACF6F2E013D9CB5866F5B70547 /* Pods-ReactNative-dummy.m */; };
11
- /* End PBXBuildFile section */
12
-
13
- /* Begin PBXFileReference section */
14
- 01A50817A1389F823A6016196ACC6BF1 /* libPods-ReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-ReactNative.a"; path = "libPods-ReactNative.a"; sourceTree = BUILT_PRODUCTS_DIR; };
15
- 21494CACF6F2E013D9CB5866F5B70547 /* Pods-ReactNative-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ReactNative-dummy.m"; sourceTree = "<group>"; };
16
- 2C33F1119B4C5BFECC9324C0F764B631 /* Pods-ReactNative.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ReactNative.debug.xcconfig"; sourceTree = "<group>"; };
17
- 2F8BD7D813BBFC9A1ECFDC65BFA4EB65 /* Pods-ReactNative.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ReactNative.release.xcconfig"; sourceTree = "<group>"; };
18
- 82B126974795CE04EAAAF88CB7D34268 /* Pods-ReactNative-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ReactNative-acknowledgements.plist"; sourceTree = "<group>"; };
19
- 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
20
- F58B2F425238CEE203A57909252762AA /* Pods-ReactNative-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ReactNative-acknowledgements.markdown"; sourceTree = "<group>"; };
21
- /* End PBXFileReference section */
22
-
23
- /* Begin PBXFrameworksBuildPhase section */
24
- 0AE86DDB555079E917C20C9B5309196B /* Frameworks */ = {
25
- isa = PBXFrameworksBuildPhase;
26
- buildActionMask = 2147483647;
27
- files = (
28
- );
29
- runOnlyForDeploymentPostprocessing = 0;
30
- };
31
- /* End PBXFrameworksBuildPhase section */
32
-
33
- /* Begin PBXGroup section */
34
- 2D3CED68F2826C3C8381FB3CBCEE392D /* Pods-ReactNative */ = {
35
- isa = PBXGroup;
36
- children = (
37
- F58B2F425238CEE203A57909252762AA /* Pods-ReactNative-acknowledgements.markdown */,
38
- 82B126974795CE04EAAAF88CB7D34268 /* Pods-ReactNative-acknowledgements.plist */,
39
- 21494CACF6F2E013D9CB5866F5B70547 /* Pods-ReactNative-dummy.m */,
40
- 2C33F1119B4C5BFECC9324C0F764B631 /* Pods-ReactNative.debug.xcconfig */,
41
- 2F8BD7D813BBFC9A1ECFDC65BFA4EB65 /* Pods-ReactNative.release.xcconfig */,
42
- );
43
- name = "Pods-ReactNative";
44
- path = "Target Support Files/Pods-ReactNative";
45
- sourceTree = "<group>";
46
- };
47
- 6BA0D8A96C7AD85281F53D2F7AF1DAD7 /* Targets Support Files */ = {
48
- isa = PBXGroup;
49
- children = (
50
- 2D3CED68F2826C3C8381FB3CBCEE392D /* Pods-ReactNative */,
51
- );
52
- name = "Targets Support Files";
53
- sourceTree = "<group>";
54
- };
55
- 7B268D4862065D83735E411AABCB1799 /* Products */ = {
56
- isa = PBXGroup;
57
- children = (
58
- 01A50817A1389F823A6016196ACC6BF1 /* libPods-ReactNative.a */,
59
- );
60
- name = Products;
61
- sourceTree = "<group>";
62
- };
63
- CF1408CF629C7361332E53B88F7BD30C = {
64
- isa = PBXGroup;
65
- children = (
66
- 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */,
67
- D89477F20FB1DE18A04690586D7808C4 /* Frameworks */,
68
- 7B268D4862065D83735E411AABCB1799 /* Products */,
69
- 6BA0D8A96C7AD85281F53D2F7AF1DAD7 /* Targets Support Files */,
70
- );
71
- sourceTree = "<group>";
72
- };
73
- D89477F20FB1DE18A04690586D7808C4 /* Frameworks */ = {
74
- isa = PBXGroup;
75
- children = (
76
- );
77
- name = Frameworks;
78
- sourceTree = "<group>";
79
- };
80
- /* End PBXGroup section */
81
-
82
- /* Begin PBXHeadersBuildPhase section */
83
- B3EA2B49F1AF137B106149563B751DAE /* Headers */ = {
84
- isa = PBXHeadersBuildPhase;
85
- buildActionMask = 2147483647;
86
- files = (
87
- );
88
- runOnlyForDeploymentPostprocessing = 0;
89
- };
90
- /* End PBXHeadersBuildPhase section */
91
-
92
- /* Begin PBXNativeTarget section */
93
- 596E717FE57719548E74A692D33C9E22 /* Pods-ReactNative */ = {
94
- isa = PBXNativeTarget;
95
- buildConfigurationList = 7728D94732A9241690087065400BB44B /* Build configuration list for PBXNativeTarget "Pods-ReactNative" */;
96
- buildPhases = (
97
- B3EA2B49F1AF137B106149563B751DAE /* Headers */,
98
- E8C4B3F8546D3B7E2B58E7A505A1006B /* Sources */,
99
- 0AE86DDB555079E917C20C9B5309196B /* Frameworks */,
100
- );
101
- buildRules = (
102
- );
103
- dependencies = (
104
- );
105
- name = "Pods-ReactNative";
106
- productName = "Pods-ReactNative";
107
- productReference = 01A50817A1389F823A6016196ACC6BF1 /* libPods-ReactNative.a */;
108
- productType = "com.apple.product-type.library.static";
109
- };
110
- /* End PBXNativeTarget section */
111
-
112
- /* Begin PBXProject section */
113
- BFDFE7DC352907FC980B868725387E98 /* Project object */ = {
114
- isa = PBXProject;
115
- attributes = {
116
- LastSwiftUpdateCheck = 1100;
117
- LastUpgradeCheck = 1100;
118
- };
119
- buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */;
120
- compatibilityVersion = "Xcode 3.2";
121
- developmentRegion = en;
122
- hasScannedForEncodings = 0;
123
- knownRegions = (
124
- en,
125
- Base,
126
- );
127
- mainGroup = CF1408CF629C7361332E53B88F7BD30C;
128
- productRefGroup = 7B268D4862065D83735E411AABCB1799 /* Products */;
129
- projectDirPath = "";
130
- projectRoot = "";
131
- targets = (
132
- 596E717FE57719548E74A692D33C9E22 /* Pods-ReactNative */,
133
- );
134
- };
135
- /* End PBXProject section */
136
-
137
- /* Begin PBXSourcesBuildPhase section */
138
- E8C4B3F8546D3B7E2B58E7A505A1006B /* Sources */ = {
139
- isa = PBXSourcesBuildPhase;
140
- buildActionMask = 2147483647;
141
- files = (
142
- 9E8C55F8977D10A75940A48A138A0AFE /* Pods-ReactNative-dummy.m in Sources */,
143
- );
144
- runOnlyForDeploymentPostprocessing = 0;
145
- };
146
- /* End PBXSourcesBuildPhase section */
147
-
148
- /* Begin XCBuildConfiguration section */
149
- 07CE986916C51009E26F9F9F8BC685F2 /* Release */ = {
150
- isa = XCBuildConfiguration;
151
- baseConfigurationReference = 2F8BD7D813BBFC9A1ECFDC65BFA4EB65 /* Pods-ReactNative.release.xcconfig */;
152
- buildSettings = {
153
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
154
- CLANG_ENABLE_OBJC_WEAK = NO;
155
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
156
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
157
- "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
158
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
159
- MACH_O_TYPE = staticlib;
160
- OTHER_LDFLAGS = "";
161
- OTHER_LIBTOOLFLAGS = "";
162
- PODS_ROOT = "$(SRCROOT)";
163
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
164
- SDKROOT = iphoneos;
165
- SKIP_INSTALL = YES;
166
- TARGETED_DEVICE_FAMILY = "1,2";
167
- VALIDATE_PRODUCT = YES;
168
- };
169
- name = Release;
170
- };
171
- 7EE7A78859F657F6BEFC651185B43192 /* Release */ = {
172
- isa = XCBuildConfiguration;
173
- buildSettings = {
174
- ALWAYS_SEARCH_USER_PATHS = NO;
175
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
176
- CLANG_ANALYZER_NONNULL = YES;
177
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
178
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
179
- CLANG_CXX_LIBRARY = "libc++";
180
- CLANG_ENABLE_MODULES = YES;
181
- CLANG_ENABLE_OBJC_ARC = YES;
182
- CLANG_ENABLE_OBJC_WEAK = YES;
183
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
184
- CLANG_WARN_BOOL_CONVERSION = YES;
185
- CLANG_WARN_COMMA = YES;
186
- CLANG_WARN_CONSTANT_CONVERSION = YES;
187
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
188
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
189
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
190
- CLANG_WARN_EMPTY_BODY = YES;
191
- CLANG_WARN_ENUM_CONVERSION = YES;
192
- CLANG_WARN_INFINITE_RECURSION = YES;
193
- CLANG_WARN_INT_CONVERSION = YES;
194
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
195
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
196
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
197
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
198
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
199
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
200
- CLANG_WARN_STRICT_PROTOTYPES = YES;
201
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
202
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
203
- CLANG_WARN_UNREACHABLE_CODE = YES;
204
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
205
- COPY_PHASE_STRIP = NO;
206
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
207
- ENABLE_NS_ASSERTIONS = NO;
208
- ENABLE_STRICT_OBJC_MSGSEND = YES;
209
- GCC_C_LANGUAGE_STANDARD = gnu11;
210
- GCC_NO_COMMON_BLOCKS = YES;
211
- GCC_PREPROCESSOR_DEFINITIONS = (
212
- "POD_CONFIGURATION_RELEASE=1",
213
- "$(inherited)",
214
- );
215
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
216
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
217
- GCC_WARN_UNDECLARED_SELECTOR = YES;
218
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
219
- GCC_WARN_UNUSED_FUNCTION = YES;
220
- GCC_WARN_UNUSED_VARIABLE = YES;
221
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
222
- MTL_ENABLE_DEBUG_INFO = NO;
223
- MTL_FAST_MATH = YES;
224
- PRODUCT_NAME = "$(TARGET_NAME)";
225
- STRIP_INSTALLED_PRODUCT = NO;
226
- SWIFT_COMPILATION_MODE = wholemodule;
227
- SWIFT_OPTIMIZATION_LEVEL = "-O";
228
- SWIFT_VERSION = 5.0;
229
- SYMROOT = "${SRCROOT}/../build";
230
- };
231
- name = Release;
232
- };
233
- D299434AB35E7FD6F7921C8EF24742FF /* Debug */ = {
234
- isa = XCBuildConfiguration;
235
- buildSettings = {
236
- ALWAYS_SEARCH_USER_PATHS = NO;
237
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
238
- CLANG_ANALYZER_NONNULL = YES;
239
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
240
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
241
- CLANG_CXX_LIBRARY = "libc++";
242
- CLANG_ENABLE_MODULES = YES;
243
- CLANG_ENABLE_OBJC_ARC = YES;
244
- CLANG_ENABLE_OBJC_WEAK = YES;
245
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
246
- CLANG_WARN_BOOL_CONVERSION = YES;
247
- CLANG_WARN_COMMA = YES;
248
- CLANG_WARN_CONSTANT_CONVERSION = YES;
249
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
250
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
251
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
252
- CLANG_WARN_EMPTY_BODY = YES;
253
- CLANG_WARN_ENUM_CONVERSION = YES;
254
- CLANG_WARN_INFINITE_RECURSION = YES;
255
- CLANG_WARN_INT_CONVERSION = YES;
256
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
257
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
258
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
259
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
260
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
261
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
262
- CLANG_WARN_STRICT_PROTOTYPES = YES;
263
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
264
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
265
- CLANG_WARN_UNREACHABLE_CODE = YES;
266
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
267
- COPY_PHASE_STRIP = NO;
268
- DEBUG_INFORMATION_FORMAT = dwarf;
269
- ENABLE_STRICT_OBJC_MSGSEND = YES;
270
- ENABLE_TESTABILITY = YES;
271
- GCC_C_LANGUAGE_STANDARD = gnu11;
272
- GCC_DYNAMIC_NO_PIC = NO;
273
- GCC_NO_COMMON_BLOCKS = YES;
274
- GCC_OPTIMIZATION_LEVEL = 0;
275
- GCC_PREPROCESSOR_DEFINITIONS = (
276
- "POD_CONFIGURATION_DEBUG=1",
277
- "DEBUG=1",
278
- "$(inherited)",
279
- );
280
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
281
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
282
- GCC_WARN_UNDECLARED_SELECTOR = YES;
283
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
284
- GCC_WARN_UNUSED_FUNCTION = YES;
285
- GCC_WARN_UNUSED_VARIABLE = YES;
286
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
287
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
288
- MTL_FAST_MATH = YES;
289
- ONLY_ACTIVE_ARCH = YES;
290
- PRODUCT_NAME = "$(TARGET_NAME)";
291
- STRIP_INSTALLED_PRODUCT = NO;
292
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
293
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
294
- SWIFT_VERSION = 5.0;
295
- SYMROOT = "${SRCROOT}/../build";
296
- };
297
- name = Debug;
298
- };
299
- ED632BBB0E7E0A6D3E30EE1A65FF0A83 /* Debug */ = {
300
- isa = XCBuildConfiguration;
301
- baseConfigurationReference = 2C33F1119B4C5BFECC9324C0F764B631 /* Pods-ReactNative.debug.xcconfig */;
302
- buildSettings = {
303
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
304
- CLANG_ENABLE_OBJC_WEAK = NO;
305
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
306
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
307
- "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
308
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
309
- MACH_O_TYPE = staticlib;
310
- OTHER_LDFLAGS = "";
311
- OTHER_LIBTOOLFLAGS = "";
312
- PODS_ROOT = "$(SRCROOT)";
313
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
314
- SDKROOT = iphoneos;
315
- SKIP_INSTALL = YES;
316
- TARGETED_DEVICE_FAMILY = "1,2";
317
- };
318
- name = Debug;
319
- };
320
- /* End XCBuildConfiguration section */
321
-
322
- /* Begin XCConfigurationList section */
323
- 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = {
324
- isa = XCConfigurationList;
325
- buildConfigurations = (
326
- D299434AB35E7FD6F7921C8EF24742FF /* Debug */,
327
- 7EE7A78859F657F6BEFC651185B43192 /* Release */,
328
- );
329
- defaultConfigurationIsVisible = 0;
330
- defaultConfigurationName = Release;
331
- };
332
- 7728D94732A9241690087065400BB44B /* Build configuration list for PBXNativeTarget "Pods-ReactNative" */ = {
333
- isa = XCConfigurationList;
334
- buildConfigurations = (
335
- ED632BBB0E7E0A6D3E30EE1A65FF0A83 /* Debug */,
336
- 07CE986916C51009E26F9F9F8BC685F2 /* Release */,
337
- );
338
- defaultConfigurationIsVisible = 0;
339
- defaultConfigurationName = Release;
340
- };
341
- /* End XCConfigurationList section */
342
- };
343
- rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */;
344
- }