@onramper/onramper-react-native 1.1.1 → 1.2.1

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 (56) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +11 -0
  3. package/ios/Frameworks/OnramperSDK.xcframework/Info.plist +5 -5
  4. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  5. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftinterface +25 -2
  6. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
  7. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +36 -0
  8. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/PrivacyInfo.xcprivacy +36 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2684 -2578
  11. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  12. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +25 -2
  13. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  14. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +25 -2
  15. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
  16. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +36 -0
  17. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/PrivacyInfo.xcprivacy +36 -0
  18. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  19. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2684 -2578
  20. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2651 -2545
  21. package/ios/HybridOnramperNitro.swift +32 -4
  22. package/ios/OnramperCheckoutBridge.swift +33 -0
  23. package/lib/commonjs/OnramperClient.js +47 -3
  24. package/lib/commonjs/OnramperClient.js.map +1 -1
  25. package/lib/module/OnramperClient.js +47 -3
  26. package/lib/module/OnramperClient.js.map +1 -1
  27. package/lib/typescript/commonjs/src/OnramperClient.d.ts +17 -2
  28. package/lib/typescript/commonjs/src/OnramperClient.d.ts.map +1 -1
  29. package/lib/typescript/commonjs/src/index.d.ts +1 -1
  30. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  31. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts +2 -1
  32. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  33. package/lib/typescript/commonjs/src/types.d.ts +9 -0
  34. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  35. package/lib/typescript/module/src/OnramperClient.d.ts +17 -2
  36. package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -1
  37. package/lib/typescript/module/src/index.d.ts +1 -1
  38. package/lib/typescript/module/src/index.d.ts.map +1 -1
  39. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts +2 -1
  40. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  41. package/lib/typescript/module/src/types.d.ts +9 -0
  42. package/lib/typescript/module/src/types.d.ts.map +1 -1
  43. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.cpp +8 -0
  44. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.hpp +38 -0
  45. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Umbrella.hpp +1 -0
  46. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.hpp +9 -2
  47. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
  48. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec.swift +2 -1
  49. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec_cxx.swift +24 -2
  50. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.cpp +1 -0
  51. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.hpp +3 -1
  52. package/package.json +2 -2
  53. package/src/OnramperClient.ts +55 -2
  54. package/src/index.ts +1 -0
  55. package/src/specs/OnramperNitro.nitro.ts +7 -2
  56. package/src/types.ts +27 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,60 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.2.1]
6
+
7
+ Bundles `OnramperSDK@1.2.1`.
8
+
9
+ ### Added
10
+
11
+ - Durable Onramper transaction IDs. `checkoutFinalized.response` now includes the required
12
+ `onramperTransactionId`, and `OnramperClient.currentTransactionId` mirrors the native
13
+ published value. Subscribe with `addTransactionIdListener` when UI must react to it.
14
+ - Both example apps display and log the transaction ID at finalization.
15
+
16
+ ### Changed
17
+
18
+ - No migration is required. The release is additive. Persist `onramperTransactionId` for
19
+ support, reconciliation, and status lookup instead of per-attempt checkout/intent IDs.
20
+ Read it before `reset()` or `signOut()`, which clear the current value. TypeScript tests
21
+ that manually construct a `CheckoutFinalizeResponse` fixture must add the required field.
22
+
23
+ ## [1.2.0]
24
+
25
+ Bundles `OnramperSDK@1.2.0`.
26
+
27
+ ### Added
28
+
29
+ - Client-supplied **user-field prefill**. `getCheckoutRequirements()` accepts an optional third argument carrying values you already know about the user, and the OnramperID sign-in and additional-info screens arrive pre-populated instead of blank. New exported type: `OnramperUserPrefill` — `email`, `firstName`, `lastName`, `phoneNumber`, all optional; supply only what you know.
30
+
31
+ ```ts
32
+ const { button, quote } = await client.getCheckoutRequirements(request, style, {
33
+ firstName: 'Ada',
34
+ lastName: 'Lovelace',
35
+ phoneNumber: '+3712345678', // E.164
36
+ });
37
+ ```
38
+
39
+ Prefill is **best-effort and never blocks sign-in.** If it can't be applied, the login flow opens normally without it. No error surfaces to your app, and there is nothing to handle. Prefill values are never logged at any `logLevel`.
40
+
41
+ A prefilled phone number is always a *candidate*: the user still verifies it, and a number already verified on the account takes precedence.
42
+
43
+ **Supply `email` only when you are confident** it is the address the user will sign in with. It identifies which account the other values belong to, so it is not merely another prefilled value: when it matches the account that signs in, the remaining values may be applied automatically; when it does not match, the whole prefill is dropped — which is strictly worse than omitting `email`, where the values are still offered to the user for confirmation.
44
+
45
+ Prefill is enabled per integration. Talk to your Onramper representative before relying on it — without it enabled, sign-in simply proceeds without prefill.
46
+
47
+ - Both example apps gained a prefill panel (a send/don't-send switch plus editable fields) so the flow can be exercised on device. `email` and `phoneNumber` start blank deliberately.
48
+
49
+ ### Changed
50
+
51
+ - `getCheckoutRequirements(request, buttonStyle?)` gains a trailing `prefill?` parameter and is now `getCheckoutRequirements(request, buttonStyle?, prefill?)`. Existing call sites are unaffected; no migration is required. (The Swift SDK places `prefill` before `buttonStyle`, where argument labels keep it non-breaking — JavaScript has no labels, so the wrapper appends it instead.)
52
+
53
+ ## [1.1.1]
54
+ Minor version bundling security enhancements from Onramper iOS SDK v1.1.1
55
+
56
+ ### Changed (breaking)
57
+ - All clients should upgrade to this version. This version includes a new security paradigm for backend communications that is required.
58
+
5
59
  ## [1.1.0]
6
60
 
7
61
  Bundles `OnramperSDK@1.1.0`. The SDK is pre-adoption, so breaking changes ship within the 1.x line.
package/README.md CHANGED
@@ -58,11 +58,18 @@ return (
58
58
 
59
59
  The button renders natively and presents login + payment sheets internally. ToS is rendered inside the button view.
60
60
 
61
+ Already know the user? Pass a third `prefill` argument (`email`, `firstName`, `lastName`, `phoneNumber` — all optional) to have the OnramperID screens arrive pre-populated. It's best-effort and never blocks sign-in. See [prefilling known user values](docs/GETTING_STARTED.md#prefilling-known-user-values) — note the caveat on `email` before supplying it.
62
+
61
63
  ## Checkout events
62
64
 
63
65
  The SwiftUI `OnramperCheckoutButton` does not expose external callback hooks; checkout outcomes flow via the module-level event stream:
64
66
 
65
67
  ```ts
68
+ const onFinalized = client.addEventListener('checkoutFinalized', ({ response }) => {
69
+ // Durable transaction identifier: store this for support/reconciliation.
70
+ persistTransactionId(response.onramperTransactionId);
71
+ });
72
+
66
73
  const unsub = client.addEventListener('completed', (e) => {
67
74
  console.log('done:', e.checkoutId);
68
75
  });
@@ -72,6 +79,10 @@ const onFailed = client.addEventListener('failed', (e) => {
72
79
  });
73
80
  ```
74
81
 
82
+ `checkoutStarted.intentId` and `completed.checkoutId` identify an attempt, while
83
+ `onramperTransactionId` identifies the transaction and is available before payment rendering.
84
+ `client.currentTransactionId` mirrors the same value; `reset()` clears it.
85
+
75
86
  ## Error handling
76
87
 
77
88
  All native errors arrive as `OnramperError` with a typed `code`:
@@ -10,18 +10,15 @@
10
10
  <key>DebugSymbolsPath</key>
11
11
  <string>dSYMs</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64_x86_64-simulator</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>OnramperSDK.framework</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
21
  <string>ios</string>
23
- <key>SupportedPlatformVariant</key>
24
- <string>simulator</string>
25
22
  </dict>
26
23
  <dict>
27
24
  <key>BinaryPath</key>
@@ -29,15 +26,18 @@
29
26
  <key>DebugSymbolsPath</key>
30
27
  <string>dSYMs</string>
31
28
  <key>LibraryIdentifier</key>
32
- <string>ios-arm64</string>
29
+ <string>ios-arm64_x86_64-simulator</string>
33
30
  <key>LibraryPath</key>
34
31
  <string>OnramperSDK.framework</string>
35
32
  <key>SupportedArchitectures</key>
36
33
  <array>
37
34
  <string>arm64</string>
35
+ <string>x86_64</string>
38
36
  </array>
39
37
  <key>SupportedPlatform</key>
40
38
  <string>ios</string>
39
+ <key>SupportedPlatformVariant</key>
40
+ <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
@@ -161,8 +161,9 @@ public struct ToSRequirementCompletion : Swift.Codable, Swift.Sendable {
161
161
  }
162
162
  public struct CheckoutFinalizeResponse : Swift.Codable, Swift.Sendable {
163
163
  public let headlessCheckoutId: Swift.String
164
+ public let onramperTransactionId: Swift.String
164
165
  public let headlessCheckoutData: OnramperSDK.HeadlessCheckoutData
165
- public init(headlessCheckoutId: Swift.String, headlessCheckoutData: OnramperSDK.HeadlessCheckoutData)
166
+ public init(headlessCheckoutId: Swift.String, onramperTransactionId: Swift.String, headlessCheckoutData: OnramperSDK.HeadlessCheckoutData)
166
167
  public func encode(to encoder: any Swift.Encoder) throws
167
168
  public init(from decoder: any Swift.Decoder) throws
168
169
  }
@@ -364,6 +365,16 @@ public struct EncryptedPayload : Swift.Codable, Swift.Sendable, Swift.Equatable
364
365
  public func encode(to encoder: any Swift.Encoder) throws
365
366
  public init(from decoder: any Swift.Decoder) throws
366
367
  }
368
+ public struct OnramperUserPrefill : Swift.Sendable, Swift.Equatable {
369
+ public var email: Swift.String?
370
+ public var firstName: Swift.String?
371
+ public var lastName: Swift.String?
372
+ public var phoneNumber: Swift.String?
373
+ #if compiler(>=5.3) && $NonescapableTypes
374
+ public init(email: Swift.String? = nil, firstName: Swift.String? = nil, lastName: Swift.String? = nil, phoneNumber: Swift.String? = nil)
375
+ #endif
376
+ public static func == (a: OnramperSDK.OnramperUserPrefill, b: OnramperSDK.OnramperUserPrefill) -> Swift.Bool
377
+ }
367
378
  public struct QuoteResponse : Swift.Codable, Swift.Sendable, Swift.Equatable {
368
379
  public let quoteId: Swift.String
369
380
  public let ramp: Swift.String
@@ -440,6 +451,16 @@ public enum RenderType : Swift.String, Swift.Codable, Swift.Sendable {
440
451
  get
441
452
  }
442
453
  #endif
454
+ #if compiler(>=5.3) && $NonescapableTypes
455
+ @Combine.Published @_projectedValueProperty($currentTransactionId) @_Concurrency.MainActor final public var currentTransactionId: Swift.String? {
456
+ get
457
+ }
458
+ #endif
459
+ #if compiler(>=5.3) && $NonescapableTypes
460
+ @_Concurrency.MainActor final public var $currentTransactionId: Combine.Published<Swift.String?>.Publisher {
461
+ get
462
+ }
463
+ #endif
443
464
  @_Concurrency.MainActor final public let configuration: OnramperSDK.OnramperConfiguration
444
465
  @_Concurrency.MainActor weak final public var delegate: (any OnramperSDK.OnramperDelegate)?
445
466
  @_Concurrency.MainActor final public var sessionId: Swift.String? {
@@ -450,7 +471,9 @@ public enum RenderType : Swift.String, Swift.Codable, Swift.Sendable {
450
471
  }
451
472
  @_Concurrency.MainActor convenience public init(configuration: OnramperSDK.OnramperConfiguration)
452
473
  @_Concurrency.MainActor final public func initialize(sessionId: Swift.String, sessionToken: Swift.String) async throws
453
- @_Concurrency.MainActor final public func getCheckoutRequirements(_ request: OnramperSDK.CheckoutIntentRequest, buttonStyle: OnramperSDK.CheckoutButtonStyle = CheckoutButtonStyle()) async throws -> OnramperSDK.CheckoutRequirementsResult
474
+ #if compiler(>=5.3) && $NonescapableTypes
475
+ @_Concurrency.MainActor final public func getCheckoutRequirements(_ request: OnramperSDK.CheckoutIntentRequest, prefill: OnramperSDK.OnramperUserPrefill? = nil, buttonStyle: OnramperSDK.CheckoutButtonStyle = CheckoutButtonStyle()) async throws -> OnramperSDK.CheckoutRequirementsResult
476
+ #endif
454
477
  @_Concurrency.MainActor final public func reset() async
455
478
  @_Concurrency.MainActor final public func signOut() async
456
479
  public typealias ObjectWillChangePublisher = Combine.ObservableObjectPublisher
@@ -16,6 +16,42 @@
16
16
  <key>NSPrivacyCollectedDataTypeTracking</key>
17
17
  <false/>
18
18
  </dict>
19
+ <dict>
20
+ <key>NSPrivacyCollectedDataType</key>
21
+ <string>NSPrivacyCollectedDataTypeEmailAddress</string>
22
+ <key>NSPrivacyCollectedDataTypePurposes</key>
23
+ <array>
24
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
25
+ </array>
26
+ <key>NSPrivacyCollectedDataTypeLinked</key>
27
+ <true/>
28
+ <key>NSPrivacyCollectedDataTypeTracking</key>
29
+ <false/>
30
+ </dict>
31
+ <dict>
32
+ <key>NSPrivacyCollectedDataType</key>
33
+ <string>NSPrivacyCollectedDataTypeName</string>
34
+ <key>NSPrivacyCollectedDataTypePurposes</key>
35
+ <array>
36
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
37
+ </array>
38
+ <key>NSPrivacyCollectedDataTypeLinked</key>
39
+ <true/>
40
+ <key>NSPrivacyCollectedDataTypeTracking</key>
41
+ <false/>
42
+ </dict>
43
+ <dict>
44
+ <key>NSPrivacyCollectedDataType</key>
45
+ <string>NSPrivacyCollectedDataTypePhoneNumber</string>
46
+ <key>NSPrivacyCollectedDataTypePurposes</key>
47
+ <array>
48
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
49
+ </array>
50
+ <key>NSPrivacyCollectedDataTypeLinked</key>
51
+ <true/>
52
+ <key>NSPrivacyCollectedDataTypeTracking</key>
53
+ <false/>
54
+ </dict>
19
55
  </array>
20
56
  <key>NSPrivacyAccessedAPITypes</key>
21
57
  <array/>
@@ -16,6 +16,42 @@
16
16
  <key>NSPrivacyCollectedDataTypeTracking</key>
17
17
  <false/>
18
18
  </dict>
19
+ <dict>
20
+ <key>NSPrivacyCollectedDataType</key>
21
+ <string>NSPrivacyCollectedDataTypeEmailAddress</string>
22
+ <key>NSPrivacyCollectedDataTypePurposes</key>
23
+ <array>
24
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
25
+ </array>
26
+ <key>NSPrivacyCollectedDataTypeLinked</key>
27
+ <true/>
28
+ <key>NSPrivacyCollectedDataTypeTracking</key>
29
+ <false/>
30
+ </dict>
31
+ <dict>
32
+ <key>NSPrivacyCollectedDataType</key>
33
+ <string>NSPrivacyCollectedDataTypeName</string>
34
+ <key>NSPrivacyCollectedDataTypePurposes</key>
35
+ <array>
36
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
37
+ </array>
38
+ <key>NSPrivacyCollectedDataTypeLinked</key>
39
+ <true/>
40
+ <key>NSPrivacyCollectedDataTypeTracking</key>
41
+ <false/>
42
+ </dict>
43
+ <dict>
44
+ <key>NSPrivacyCollectedDataType</key>
45
+ <string>NSPrivacyCollectedDataTypePhoneNumber</string>
46
+ <key>NSPrivacyCollectedDataTypePurposes</key>
47
+ <array>
48
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
49
+ </array>
50
+ <key>NSPrivacyCollectedDataTypeLinked</key>
51
+ <true/>
52
+ <key>NSPrivacyCollectedDataTypeTracking</key>
53
+ <false/>
54
+ </dict>
19
55
  </array>
20
56
  <key>NSPrivacyAccessedAPITypes</key>
21
57
  <array/>