@onramper/onramper-react-native 1.2.0 → 1.2.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 (77) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +10 -1
  3. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Info.plist +0 -0
  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 +12 -1
  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/Info.plist +0 -0
  8. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2240 -2234
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Info.plist +0 -0
  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 +12 -1
  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 +12 -1
  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/Info.plist +0 -0
  17. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  18. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2240 -2234
  19. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2206 -2200
  20. package/ios/HybridOnramperCheckoutButton.swift +77 -3
  21. package/ios/HybridOnramperNitro.swift +12 -0
  22. package/lib/commonjs/CheckoutButton.js +34 -0
  23. package/lib/commonjs/CheckoutButton.js.map +1 -0
  24. package/lib/commonjs/OnramperClient.js +38 -8
  25. package/lib/commonjs/OnramperClient.js.map +1 -1
  26. package/lib/commonjs/generated/OnramperCheckoutButtonConfig.json +1 -0
  27. package/lib/module/CheckoutButton.js +30 -0
  28. package/lib/module/CheckoutButton.js.map +1 -0
  29. package/lib/module/OnramperClient.js +38 -8
  30. package/lib/module/OnramperClient.js.map +1 -1
  31. package/lib/module/generated/OnramperCheckoutButtonConfig.json +1 -0
  32. package/lib/typescript/commonjs/src/CheckoutButton.d.ts +20 -0
  33. package/lib/typescript/commonjs/src/CheckoutButton.d.ts.map +1 -0
  34. package/lib/typescript/commonjs/src/OnramperClient.d.ts +5 -0
  35. package/lib/typescript/commonjs/src/OnramperClient.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/src/specs/OnramperCheckoutButton.nitro.d.ts +6 -0
  37. package/lib/typescript/commonjs/src/specs/OnramperCheckoutButton.nitro.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts +1 -0
  39. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/src/types.d.ts +2 -0
  41. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  42. package/lib/typescript/module/src/CheckoutButton.d.ts +20 -0
  43. package/lib/typescript/module/src/CheckoutButton.d.ts.map +1 -0
  44. package/lib/typescript/module/src/OnramperClient.d.ts +5 -0
  45. package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -1
  46. package/lib/typescript/module/src/specs/OnramperCheckoutButton.nitro.d.ts +6 -0
  47. package/lib/typescript/module/src/specs/OnramperCheckoutButton.nitro.d.ts.map +1 -1
  48. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts +1 -0
  49. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  50. package/lib/typescript/module/src/types.d.ts +2 -0
  51. package/lib/typescript/module/src/types.d.ts.map +1 -1
  52. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.cpp +16 -0
  53. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Bridge.hpp +75 -0
  54. package/nitrogen/generated/ios/OnramperReactNative-Swift-Cxx-Umbrella.hpp +1 -0
  55. package/nitrogen/generated/ios/c++/HybridOnramperCheckoutButtonSpecSwift.hpp +9 -0
  56. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.hpp +7 -0
  57. package/nitrogen/generated/ios/c++/views/HybridOnramperCheckoutButtonComponent.mm +5 -0
  58. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  59. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
  60. package/nitrogen/generated/ios/swift/HybridOnramperCheckoutButtonSpec.swift +1 -0
  61. package/nitrogen/generated/ios/swift/HybridOnramperCheckoutButtonSpec_cxx.swift +32 -0
  62. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec.swift +1 -0
  63. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec_cxx.swift +22 -0
  64. package/nitrogen/generated/shared/c++/HybridOnramperCheckoutButtonSpec.cpp +2 -0
  65. package/nitrogen/generated/shared/c++/HybridOnramperCheckoutButtonSpec.hpp +4 -0
  66. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.cpp +1 -0
  67. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.hpp +2 -0
  68. package/nitrogen/generated/shared/c++/views/HybridOnramperCheckoutButtonComponent.cpp +11 -0
  69. package/nitrogen/generated/shared/c++/views/HybridOnramperCheckoutButtonComponent.hpp +3 -2
  70. package/nitrogen/generated/shared/json/OnramperCheckoutButtonConfig.json +1 -0
  71. package/package.json +4 -2
  72. package/src/CheckoutButton.ts +28 -0
  73. package/src/OnramperClient.ts +40 -6
  74. package/src/generated/OnramperCheckoutButtonConfig.json +1 -0
  75. package/src/specs/OnramperCheckoutButton.nitro.ts +6 -0
  76. package/src/specs/OnramperNitro.nitro.ts +2 -0
  77. package/src/types.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.2.2-1]
6
+
7
+ Wrapper-only change; still bundles `OnramperSDK@1.2.2`.
8
+
9
+ ### Fixed
10
+
11
+ - The native checkout button no longer draws over neighbouring views. It reports its content height
12
+ (for example when ToS text appears under the Buy button) and sizes itself to match, and clips any
13
+ overflow as a backstop.
14
+ - A checkout button given an intent that has expired or was already used now shows nothing, instead of
15
+ keeping the previous quote's button on screen.
16
+
17
+ ### Changed
18
+
19
+ - No public TypeScript type changes. Containers around `button` no longer need a `minHeight`.
20
+ - `button` is now an element of a small sizing wrapper rather than the native view itself, and it
21
+ manages its own `style`. Style passed with `cloneElement(button, { style })` is no longer applied;
22
+ style the containing `View` instead.
23
+ - The bare example app is now a demo app: environment switching, automatic SDK initialization,
24
+ currency / payment / country selection, and a settings sheet.
25
+
26
+ ## [1.2.2]
27
+
28
+ Bundles `OnramperSDK@1.2.2`.
29
+
30
+ ### Fixed
31
+
32
+ - Fixed authentication handling during SDK session initialization and refresh.
33
+
34
+ ### Changed
35
+
36
+ - No public React Native API changes or migration are required.
37
+
38
+ ## [1.2.1]
39
+
40
+ Bundles `OnramperSDK@1.2.1`.
41
+
42
+ ### Added
43
+
44
+ - Durable Onramper transaction IDs. `checkoutFinalized.response` now includes the required
45
+ `onramperTransactionId`, and `OnramperClient.currentTransactionId` mirrors the native
46
+ published value. Subscribe with `addTransactionIdListener` when UI must react to it.
47
+ - Both example apps display and log the transaction ID at finalization.
48
+
49
+ ### Changed
50
+
51
+ - No migration is required. The release is additive. Persist `onramperTransactionId` for
52
+ support, reconciliation, and status lookup instead of per-attempt checkout/intent IDs.
53
+ Read it before `reset()` or `signOut()`, which clear the current value. TypeScript tests
54
+ that manually construct a `CheckoutFinalizeResponse` fixture must add the required field.
55
+
5
56
  ## [1.2.0]
6
57
 
7
58
  Bundles `OnramperSDK@1.2.0`.
package/README.md CHANGED
@@ -56,7 +56,7 @@ return (
56
56
  );
57
57
  ```
58
58
 
59
- The button renders natively and presents login + payment sheets internally. ToS is rendered inside the button view.
59
+ The button renders natively and presents login + payment sheets internally. ToS is rendered inside the button view, and the button sizes its own height to fit it — don't give its container a fixed height.
60
60
 
61
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
62
 
@@ -65,6 +65,11 @@ Already know the user? Pass a third `prefill` argument (`email`, `firstName`, `l
65
65
  The SwiftUI `OnramperCheckoutButton` does not expose external callback hooks; checkout outcomes flow via the module-level event stream:
66
66
 
67
67
  ```ts
68
+ const onFinalized = client.addEventListener('checkoutFinalized', ({ response }) => {
69
+ // Durable transaction identifier: store this for support/reconciliation.
70
+ persistTransactionId(response.onramperTransactionId);
71
+ });
72
+
68
73
  const unsub = client.addEventListener('completed', (e) => {
69
74
  console.log('done:', e.checkoutId);
70
75
  });
@@ -74,6 +79,10 @@ const onFailed = client.addEventListener('failed', (e) => {
74
79
  });
75
80
  ```
76
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
+
77
86
  ## Error handling
78
87
 
79
88
  All native errors arrive as `OnramperError` with a typed `code`:
@@ -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
  }
@@ -450,6 +451,16 @@ public enum RenderType : Swift.String, Swift.Codable, Swift.Sendable {
450
451
  get
451
452
  }
452
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
453
464
  @_Concurrency.MainActor final public let configuration: OnramperSDK.OnramperConfiguration
454
465
  @_Concurrency.MainActor weak final public var delegate: (any OnramperSDK.OnramperDelegate)?
455
466
  @_Concurrency.MainActor final public var sessionId: Swift.String? {