Skip to content

feat: react-native sdk parity with main-sdk - #54

Open
manideepk90 wants to merge 3 commits into
mainfrom
feat-core-sdk
Open

feat: react-native sdk parity with main-sdk#54
manideepk90 wants to merge 3 commits into
mainfrom
feat-core-sdk

Conversation

@manideepk90

Copy link
Copy Markdown
Contributor

No description provided.

@manideepk90 manideepk90 changed the title feat: consume main sdk directly instead of duplication feat: react-native sdk parity with main-sdk Jul 13, 2026
Comment thread example/android/app/build.gradle Outdated
Comment thread example/android/build.gradle Outdated
Comment thread example/ios/Podfile
Comment thread example/package.json Outdated
…ypeScript

- Deleted obsolete ReasonML files: AppearanceTransformer.res, EventValidator.res, NewArchUtils.res, PaymentSheetEventManager.res, ReactNativeUtils.res, ResponseHandler.res, CvcWidget.res, NativePaymentWidget.res, PaymentWidget.res.
- Introduced new TypeScript files: EventValidator.ts, NewArchUtils.ts, ReactNativeUtils.ts, NativePaymentWidget.ts, CVCElementView.tsx, PaymentElement.ts, PaymentElementView.tsx, CvcWidget.ts, NativePaymentWidgetImpl.ts.
- Updated CVC and Payment widgets to use new TypeScript components and utility functions.
- Enhanced event validation and response handling in the new TypeScript implementations.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to bring the React Native Hyperswitch SDK in line with the main SDK by moving to a TypeScript-based “universal session” contract, updating native module specs/bridges, and introducing a new @juspay-tech/react-hyperswitch package that provides platform-agnostic React bindings.

Changes:

  • Replaces large parts of the prior ReScript-based surface area with TypeScript implementations (elements factories, widget registry, new-arch utils, etc.).
  • Updates native specs and iOS/Android integrations to match the new configuration/session APIs (including update-intent hooks and event plumbing).
  • Adds a new @juspay-tech/react-hyperswitch package + updates the example app and tooling to consume the new universal API.

Reviewed changes

Copilot reviewed 165 out of 170 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
packages/@juspay-tech/react-native-hyperswitch/src/views/PaymentElement.ts Adds RN PaymentElement handle factory aligned with universal session contract.
packages/@juspay-tech/react-native-hyperswitch/src/views/NativePaymentWidgetImpl.ts New TS implementation for selecting Fabric vs legacy native component.
packages/@juspay-tech/react-native-hyperswitch/src/views/NativePaymentWidgetImpl.res Removes prior ReScript implementation.
packages/@juspay-tech/react-native-hyperswitch/src/views/NativePaymentWidget.ts Re-exports native widget wrapper for TS consumers.
packages/@juspay-tech/react-native-hyperswitch/src/views/NativePaymentWidget.res Removes prior ReScript wrapper.
packages/@juspay-tech/react-native-hyperswitch/src/views/CvcWidget.ts Adds RN CVC widget handle factory aligned with universal session contract.
packages/@juspay-tech/react-native-hyperswitch/src/views/CvcWidget.res Removes prior ReScript implementation.
packages/@juspay-tech/react-native-hyperswitch/src/views/CVCElementView.tsx Adds TSX RN view wrapper for the CVC widget.
packages/@juspay-tech/react-native-hyperswitch/src/utils/ResponseHandler.res Removes prior ReScript response parsing utilities.
packages/@juspay-tech/react-native-hyperswitch/src/utils/ReactNativeUtils.ts Adds TS wrappers for UIManager command dispatch + findNodeHandle.
packages/@juspay-tech/react-native-hyperswitch/src/utils/ReactNativeUtils.res Removes prior ReScript react-native externals.
packages/@juspay-tech/react-native-hyperswitch/src/utils/PaymentSheetEventManager.res Removes prior ReScript event manager (DeviceEventEmitter wiring).
packages/@juspay-tech/react-native-hyperswitch/src/utils/NewArchUtils.ts Adds TS new-architecture detection helpers (TurboModule/Fabric).
packages/@juspay-tech/react-native-hyperswitch/src/utils/NewArchUtils.res Removes prior ReScript new-arch helpers.
packages/@juspay-tech/react-native-hyperswitch/src/utils/EventValidator.ts Adds TS event subscription validation + warning payload helper.
packages/@juspay-tech/react-native-hyperswitch/src/utils/EventValidator.res Removes prior ReScript event validator.
packages/@juspay-tech/react-native-hyperswitch/src/utils/AppearanceTransformer.res Removes prior ReScript appearance transformer for CVC.
packages/@juspay-tech/react-native-hyperswitch/src/types/rescript-react-native.d.ts Removes ReScript React Native type shims.
packages/@juspay-tech/react-native-hyperswitch/src/types/NativeModuleTypes.ts Adds TS native event and native component prop types.
packages/@juspay-tech/react-native-hyperswitch/src/types/NativeModuleTypes.res Removes prior ReScript native type definitions.
packages/@juspay-tech/react-native-hyperswitch/src/types/HyperTypes.res Removes prior ReScript HyperTypes definitions.
packages/@juspay-tech/react-native-hyperswitch/src/specs/PaymentWidgetNativeComponent.ts Updates codegen component spec types (result/payload) and options import.
packages/@juspay-tech/react-native-hyperswitch/src/specs/NativeHyperswitchSdkReactNative.ts Updates TurboModule spec to handle instanceHandle + richer config + updateIntent.
packages/@juspay-tech/react-native-hyperswitch/src/specs/NativeHyperswitchSdkNative.ts Adds new native method surface (onUpdateIntentEvent).
packages/@juspay-tech/react-native-hyperswitch/src/specs/GooglePayButtonNativeComponent.android.ts Removes older Android-specific codegen component.
packages/@juspay-tech/react-native-hyperswitch/src/specs/ApplePayViewNativeComponent.ts Exports NativeProps interface for wider reuse.
packages/@juspay-tech/react-native-hyperswitch/src/modules/NativeHyperswitchSdk.ts Adds TS bridge wrapper + widget-related native module function accessors.
packages/@juspay-tech/react-native-hyperswitch/src/modules/NativeHyperswitchSdk.res Removes prior ReScript native module wrapper.
packages/@juspay-tech/react-native-hyperswitch/src/index.tsx Removes prior ReScript-generated entrypoint exports.
packages/@juspay-tech/react-native-hyperswitch/src/index.ts Adds new TS entrypoint implementing universal session adapter (loadHyper).
packages/@juspay-tech/react-native-hyperswitch/src/hooks/useWidget.res Removes prior ReScript hook implementation.
packages/@juspay-tech/react-native-hyperswitch/src/hooks/usePaymentSession.res Removes prior ReScript session hook implementation.
packages/@juspay-tech/react-native-hyperswitch/src/definitions.ts Adds shared universal contract types for session/elements/widgets.
packages/@juspay-tech/react-native-hyperswitch/src/core/HyperElements.res Removes prior ReScript context provider.
packages/@juspay-tech/react-native-hyperswitch/src/context/WidgetRegistry.ts Adds TS widget registry to map widget IDs to native view IDs + widget actions.
packages/@juspay-tech/react-native-hyperswitch/src/context/WidgetRegistry.res Removes prior ReScript widget registry.
packages/@juspay-tech/react-native-hyperswitch/src/context/HyperProvider.res Removes legacy ReScript provider code.
packages/@juspay-tech/react-native-hyperswitch/src/tests/index.test.tsx Removes placeholder test.
packages/@juspay-tech/react-native-hyperswitch/rollup.config.js Switches bundling entrypoint from index.tsx to index.ts.
packages/@juspay-tech/react-native-hyperswitch/rescript.json Removes ReScript build configuration.
packages/@juspay-tech/react-native-hyperswitch/package.json Updates entrypoints/scripts/deps for TS-based build + workspace example reference.
packages/@juspay-tech/react-native-hyperswitch/ios/Views/Native/NativePaymentWidget.m Exposes update-intent methods in RN extern module declarations.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/Version.swift Bumps iOS SDK version constant.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/SDKParams.swift Adds SDK params helper (app/device metadata).
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/SavedPaymentMethodsConfiguration.swift Adds config type for filtering returned saved methods.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentSheetAppearance+Codable.swift Adds codable support for new primary button height field.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentSheetAppearance.swift Refactors appearance structures; adds primary button height.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentSheet.swift Updates PaymentSheet initialization model and internal fields.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentSessionConfiguration.swift Adds codable session configuration wrapper.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentSession.swift Adds update-intent support and moves to instance-based configuration state.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/PaymentMethodType.swift Adds payment request data + method type enums.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/NativeLogger/LogPayload.swift Extends log payload + event names for new flows.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/NativeLogger/LogBuilder.swift Wires authentication_id into payload building.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperUIViewController.swift Adds paymentSheet reference for view controller ownership.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperswitchEnvironment.swift Adds environment enum (sandbox/production).
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperswitchConfigurationSchema.swift Adds codable Hyperswitch configuration schema types.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/Hyperswitch.swift Adds Hyperswitch wrapper entrypoint to create payment sessions.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventType.swift Adds typed event types and PaymentEvent model.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventSubscriptionBuilder.swift Adds subscription builder + listener wiring for events.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/HyperEvents/PaymentEventData.swift Adds typed payload parsing helpers for payment events.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/Extensions.swift Adds Encodable->Dictionary and UIColor hex utilities.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/CustomEndpointConfiguration.swift Adds codable endpoint override config model.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/Codable+UIKit.swift Removes UIColor helpers duplicated elsewhere.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Shared/APIClient.swift Adds profileId property to shared API client.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/CoreLite/SwiftUI+Lite.swift Adds SwiftUI-lite integration for presenting payment sheet.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/CoreLite/PaymentSheetView+Lite.swift Adds Lite payment sheet presentation via webview controller.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/CoreLite/PaymentSession+Lite.swift Adds PaymentSession Lite API to present the lite sheet.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/NativeModule/WidgetAction.swift Adds update-intent actions to widget action enum.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/NativeModule/RNViewManager.swift Adds method to create widget root views with module name + props.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/NativeModule/HyperModule.m Updates extern methods: removes presentPaymentSheet; adds update-intent + iframe bridge hooks.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.swift Updates headless module behavior and introduces payment result parsing helper.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/NativeModule/HyperHeadless.m Updates extern signature for getPaymentSession to include rootTag.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperSession/PaymentSessionTypes.swift Updates handler signature to accept CVCWidget for last-used confirm.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+UIKit.swift Switches completion type to PaymentResult; refactors presentation setup.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView+SwiftUI.swift Updates SwiftUI completion type to PaymentResult.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheetView.swift Updates props passed into RN root view (config/session/sdk params) + removes old response handler.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentSheet/PaymentSheet+Events.swift Adds event dispatch and shouldProceedWithPayment callback plumbing.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentMethodManagement/PaymentMethodManagementWidget.swift Updates props to include profileId and new SDK params.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperPaymentCardTextField/PaymentIntentParams.swift Includes profileId in card field props.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperExpressCheckout/ExpressCheckoutLauncher.swift Includes profileId + new SDK params wiring in express checkout flows.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/HyperCVCWidget/CVCWidget.swift Adds native CVCWidget view that hosts RN and supports confirm + event subscriptions.
packages/@juspay-tech/react-native-hyperswitch/ios/hyperswitchSDK/Core/DeviceDataCollection/HeadlessWebView.swift Adds headless webview for device data collection with timeout + cleanup.
packages/@juspay-tech/react-native-hyperswitch/HyperswitchSdkReactNative.podspec Refines iOS source/resource globs; pins resources explicitly.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/io/hyperswitch/HyperswitchReactPackageProvider.kt Adds host-side package provider for autolinked packages.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/views/GooglePayButtonViewManager.kt Removes local Google Pay view manager (delegated to shared RN lib).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/views/GooglePayButtonView.kt Removes local Google Pay view implementation.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/utils/HyperFragmentManager.kt Removes fragment manager glue (moved to shared RN artifact).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperProvider.kt Removes provider glue (moved to shared RN artifact).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/HyperswitchSdkReactNativePackage.kt Updates RN package to use shared io.hyperswitch.react modules/managers.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/PaymentSessionHandler.kt Removes headless bridge types (moved to shared RN artifact).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/PaymentMethod.kt Removes headless model types (moved to shared RN artifact).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/HyperHeadlessModule.kt Removes wrapper headless module (replaced by shared RN module).
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/HeadlessPaymentResult.kt Removes wrapper headless result type.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/HeadlessManager.kt Removes wrapper headless task manager.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/HeadlessFlowController.kt Removes wrapper orchestration glue for headless flow.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/GetPaymentSessionCallBackManager.kt Removes wrapper callback manager.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/java/com/hyperswitchsdkreactnative/headless/ExitHeadlessCallBackManager.kt Removes wrapper exit callback manager.
packages/@juspay-tech/react-native-hyperswitch/android/src/main/AndroidManifest.xml Adds metadata toggles for Hermes/new-arch + native loading flags.
packages/@juspay-tech/react-native-hyperswitch/android/src/legacy/java/com/hyperswitchsdkreactnative/NativeHyperswitchSdkReactNativeSpec.java Updates legacy spec signatures (config object, instanceHandle, updateIntent, etc.).
packages/@juspay-tech/react-native-hyperswitch/android/src/legacy/java/com/facebook/react/viewmanagers/NativePaymentWidgetManagerInterface.java Removes widgetId prop setter from legacy generated manager interface.
packages/@juspay-tech/react-native-hyperswitch/android/src/legacy/java/com/facebook/react/viewmanagers/NativePaymentWidgetManagerDelegate.java Removes widgetId prop routing from legacy delegate.
packages/@juspay-tech/react-native-hyperswitch/android/build.gradle Adds local repos + switches dependency to shared hyperswitch-sdk-android-react-native artifact.
packages/@juspay-tech/react-hyperswitch/tsconfig.json Adds TS config for new universal React bindings package.
packages/@juspay-tech/react-hyperswitch/src/types/react-native.d.ts Adds minimal RN module shim for compilation.
packages/@juspay-tech/react-hyperswitch/src/types/PaymentTypes.ts Introduces universal payment result/event/request types.
packages/@juspay-tech/react-hyperswitch/src/types/PaymentSessionTypes.ts Adds universal PaymentSession type contract.
packages/@juspay-tech/react-hyperswitch/src/types/PaymentMethodTypes.ts Adds saved payment method type models.
packages/@juspay-tech/react-hyperswitch/src/types/PaymentElementTypes.ts Adds universal PaymentElement API + props/handle types.
packages/@juspay-tech/react-hyperswitch/src/types/HyperswitchSessionTypes.ts Adds universal session/configuration types.
packages/@juspay-tech/react-hyperswitch/src/types/ElementsTypes.ts Adds Elements + actions contract used by hooks/components.
packages/@juspay-tech/react-hyperswitch/src/types/CvcWidgetTypes.ts Adds CVC widget types for universal API.
packages/@juspay-tech/react-hyperswitch/src/types/CustomerSavedPaymentMethodsSessionTypes.ts Adds types for saved payment methods session contract.
packages/@juspay-tech/react-hyperswitch/src/types/CustomerLastUsedPaymentMethodTypes.ts Adds last-used payment method types.
packages/@juspay-tech/react-hyperswitch/src/types/CustomerDefaultSavedPaymentMethodTypes.ts Adds default-saved payment method types.
packages/@juspay-tech/react-hyperswitch/src/types/AppearanceTypes.ts Adds universal appearance configuration types.
packages/@juspay-tech/react-hyperswitch/src/react/widget-registry.ts Adds small registry for widgets in React bindings package.
packages/@juspay-tech/react-hyperswitch/src/react/PlatformView.tsx Adds cross-platform container for RN vs web rendering.
packages/@juspay-tech/react-hyperswitch/src/react/PaymentElement.tsx Adds universal PaymentElement React component and imperative handle wiring.
packages/@juspay-tech/react-hyperswitch/src/react/HyperElements.tsx Adds universal HyperElements context provider.
packages/@juspay-tech/react-hyperswitch/src/react/hooks.ts Adds universal hooks (usePaymentSession, useElements).
packages/@juspay-tech/react-hyperswitch/src/index.ts Exports public API of the new universal bindings package.
packages/@juspay-tech/react-hyperswitch/src/definitions.ts Aggregates type exports for consumer imports.
packages/@juspay-tech/react-hyperswitch/package.json Adds package metadata/scripts/peer deps for new universal bindings package.
packages/@juspay-tech/react-hyperswitch/.gitignore Adds build/artifact ignores for new package.
example/tsconfig.json Adds example TS config with workspace path aliases for local dev.
example/src/utils.ts Updates example configuration to use new universal types/options.
example/src/styles.ts Removes old example styles file.
example/src/HyperContent.tsx Adds example UI integration using universal components/hooks.
example/src/GradientBackground.tsx Removes old example gradient background component.
example/src/DemoPopup.tsx Adds example popup flow for payment intent + HyperElements integration.
example/react-native.config.js Adds local dependency mapping for new @juspay-tech/react-hyperswitch package.
example/package.json Links workspace packages + adds merchant-mode scripts + dev deps.
example/metro.config.js Reworks Metro setup for workspace source vs “merchant mode” resolution.
example/ios/Podfile Forces old-arch (new-arch disabled) and adds Xcode fmt workaround.
example/android/build.gradle Adds mavenLocal and sets hyperswitchSdkVersion ext property.
example/android/app/build.gradle Adds repositories block to include mavenLocal/google/mavenCentral.
example/android/.kotlin/errors/errors-1783336022927.log Adds Kotlin daemon error log (should not be committed).
example/android/.kotlin/errors/errors-1782755475880.log Adds Kotlin daemon error log (should not be committed).
Comments suppressed due to low confidence (2)

packages/@juspay-tech/react-native-hyperswitch/android/build.gradle:10

  • mavenLocal() is enabled unconditionally for the library buildscript repositories. This can cause non-reproducible builds or accidental dependency shadowing if developers have local artifacts installed.
    packages/@juspay-tech/react-native-hyperswitch/android/build.gradle:29
  • mavenLocal() is enabled unconditionally for the library's repositories, which can shadow remote artifacts and make CI vs local builds diverge. Consider making it opt-in.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +13
export function getFindNodeHandle(ref: unknown): number {
return findNodeHandle(ref as React.ElementRef<typeof UIManager>) ?? -1;
}
Comment on lines +1 to +2
import type { ViewStyle } from 'react-native';
import type { options as PaymentSheetConfigurationOptions } from './PaymentSheetConfiguration';
Comment on lines +24 to +26
function parsePaymentResult(result: string): paymentResult {
return JSON.parse(result);
}
Comment on lines +22 to +24
export function consoleLogAll(): void {
console.log('Current widgetHashMap contents: ', widgetHashMap);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

Comment on lines +26 to +28
export function confirmPayment(widgetId: string): Promise<paymentResult> {
console.log('Confirming payment for widget with widgetId: ', widgetId);
const nativeId = widgetHashMap[widgetId];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this log

Comment on lines +10 to +24
function mapStatus(status: string): PaymentResult['type'] {
switch (status) {
case 'succeeded':
case 'completed':
case 'success':
return 'completed';
case 'cancelled':
case 'canceled':
return 'canceled';
case 'failed':
case 'error':
default:
return 'failed';
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sh-iv-am should we normalise this

Comment on lines +6 to +9
export interface PaymentEventData {
type: string;
payload: Record<string, string>;
}
Comment on lines +4 to +18
export interface OverrideEndpontConfiguration {
customBackendEndpoint?: string;
customLoggingEndpoint?: string;
customAssetEndpoint?: string;
customSDKConfigEndpoint?: string;
customAirborneEndpoint?: string;
}

export interface CommonEndpoint {
commonEndpoint: string;
}

export interface OverrideEndpoints {
overrideEndpoints: OverrideEndpontConfiguration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants