repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 23
values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch-control-center | src/screens/Settings/HSwitchSettingTypes.res | .res | type address = {
line1: option<string>,
line2: option<string>,
line3: option<string>,
city: option<string>,
state: option<string>,
zip: option<string>,
country?: string,
}
type merchantDetails = {
primary_contact_person: option<string>,
primary_email: option<string>,
primary_phone: option<string>,
... | 1,061 | 9,821 |
hyperswitch-control-center | src/screens/Settings/HSwitchSettings.res | .res | open HSwitchSettingTypes
let deleteSampleData = {
heading: "Delete Sample Data",
subHeading: "Delete all the generated sample data.",
buttonText: "Delete All",
isApiCall: true,
cardName: #DELETE_SAMPLE_DATA,
}
module TileComponent = {
@react.component
let make = (
~heading,
~subHeading,
~red... | 1,075 | 9,822 |
hyperswitch-control-center | src/screens/Settings/SettingsFieldsInfo.res | .res | open HSwitchSettingTypes
let primaryDetails: fieldsInfoType = {
name: "Primary Details",
description: "Add primary contact details",
inputFields: [
{
placeholder: "Enter Contact Name",
label: "Contact Name",
name: "primary_contact_person",
inputType: InputFields.textInput(),
},
... | 525 | 9,823 |
hyperswitch-control-center | src/screens/Settings/BusinessDetails.res | .res | open HSwitchSettingTypes
open MerchantAccountUtils
open APIUtils
open SettingsFieldsInfo
module InfoOnlyView = {
@react.component
let make = (~heading, ~subHeading="Default value") => {
<div className="flex flex-col gap-2 m-2 md:m-4">
<p className="font-semibold text-fs-13"> {heading->React.string} </p>
... | 1,605 | 9,824 |
hyperswitch-control-center | src/screens/Settings/BusinessMapping/BusinessMappingEntity.res | .res | open HSwitchSettingTypes
open BusinessMappingUtils
module ProfileActions = {
@react.component
let make = (~defaultProfileName, ~profileId) => {
open APIUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let showToast = ToastState.useShowToast()
let (showModal, setShowModal) = ... | 1,578 | 9,825 |
hyperswitch-control-center | src/screens/Settings/BusinessMapping/BusinessMappingUtils.res | .res | open HSwitchSettingTypes
type modalFields = ProfileName
let getStringFromVariant = key => {
switch key {
| ProfileName => "profile_name"
}
}
let labelField = FormRenderer.makeFieldInfo(
~label="Profile Name",
~name="profile_name",
~placeholder="Enter profile name",
~customInput=InputFields.textInput(),... | 458 | 9,826 |
hyperswitch-control-center | src/screens/Settings/BusinessMapping/BusinessProfile.res | .res | module AddEntryBtn = {
@react.component
let make = (
~onSubmit,
~modalState,
~showModal,
~setShowModal,
~list,
~isFromSettings=true,
~updatedProfileId,
~setModalState,
) => {
open HSwitchUtils
open BusinessMappingUtils
let mixpanelEvent = MixpanelHook.useSendEvent()
... | 1,596 | 9,827 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/HSwitchProfileUtils.res | .res | let getTwoFaEnumFromString = string_value => {
open HSwitchSettingTypes
switch string_value {
| Some("reset_totp") => ResetTotp
| Some("regenerate_recovery_code") => RegenerateRecoveryCode
| Some(_) | None => ResetTotp
}
}
let typedValueForCheckStatus = dict => {
open HSwitchSettingTypes
open LogicUtil... | 122 | 9,828 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/HSwitchProfileSettings.res | .res | let titleClass = "text-hyperswitch_black text-base w-1/5"
let subTitleClass = "text-hyperswitch_black opacity-50 text-base font-semibold break-all"
let sectionHeadingClass = "font-semibold text-fs-18"
let p1Leading1TextClass = HSwitchUtils.getTextClass((P1, Regular))
let p3RegularTextClass = `${HSwitchUtils.getTextClas... | 2,277 | 9,829 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/HSwitchProfileSettingsEntity.res | .res | open SwitchMerchantUtils
type columns =
| MerchantName
| RoleName
| MerchantId
let visibleColumns = [MerchantId, MerchantName, RoleName]
let defaultColumns = [MerchantId, MerchantName, RoleName]
let allColumns = [MerchantId, MerchantName, RoleName]
let itemToObjMapper = dict => {
open LogicUtils
{
me... | 425 | 9,830 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/TwoFaSettings/TwoFaHelper.res | .res | let p2Regular = HSwitchUtils.getTextClass((P2, Regular))
module Verify2FAModalComponent = {
@react.component
let make = (
~twoFaState,
~setTwoFaState,
~errorMessage,
~setErrorMessage,
~otp="",
~setOtp=_ => (),
~recoveryCode="",
~setRecoveryCode=_ => (),
~showOnlyTotp=false,
... | 909 | 9,831 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/TwoFaSettings/ModifyTwoFaSettings.res | .res | @react.component
let make = () => {
open APIUtils
let showToast = ToastState.useShowToast()
let url = RescriptReactRouter.useUrl()
let twofactorAuthType = url.search->LogicUtils.getDictFromUrlSearchParams->Dict.get("type")
let getURL = useGetURL()
let fetchDetails = useGetMethod()
let (checkTwoFaStatusR... | 507 | 9,832 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/TwoFaSettings/ResetTotp.res | .res | let h2TextStyle = HSwitchUtils.getTextClass((H2, Optional))
let p2Regular = HSwitchUtils.getTextClass((P2, Regular))
let p3Regular = HSwitchUtils.getTextClass((P3, Regular))
module TwoFaVerifyModal = {
@react.component
let make = (
~showVerifyModal,
~setShowVerifyModal,
~buttonState,
~handleModalCl... | 2,956 | 9,833 |
hyperswitch-control-center | src/screens/Settings/HSwitchProfile/TwoFaSettings/RegenerateRC.res | .res | let p2Regular = HSwitchUtils.getTextClass((P2, Regular))
let h2TextStyle = HSwitchUtils.getTextClass((H2, Optional))
module TwoFaVerifyModal = {
@react.component
let make = (
~showVerifyModal,
~setShowVerifyModal,
~errorMessage,
~setErrorMessage,
~otpInModal,
~setOtpInModal,
~buttonStat... | 1,946 | 9,834 |
hyperswitch-control-center | src/screens/Settings/ComplianceCertificates/Compliance.res | .res | module DownloadCertificateTile = {
@react.component
let make = (~header, ~onClick, ~buttonState) => {
<div
className="flex flex-col bg-white pt-6 pl-6 pr-8 pb-8 justify-between gap-10 border border-jp-gray-border_gray rounded">
<div>
<p className="text-fs-16 font-semibold m-2"> {header->Reac... | 623 | 9,835 |
hyperswitch-control-center | src/screens/ConfigurePMTs/paymentMethodList.res | .res | @react.component
let make = (~isPayoutFlow=false) => {
open PaymentMethodConfigUtils
open PaymentMethodEntity
let fetchConnectorListResponse = ConnectorListHook.useFetchConnectorList()
let businessProfiles = Recoil.useRecoilValueFromAtom(HyperswitchAtom.businessProfilesAtom)
let (screenState, setScreenState) ... | 835 | 9,836 |
hyperswitch-control-center | src/screens/ConfigurePMTs/PaymentMethodConfigTypes.res | .res | type paymentMethodConfiguration = {
payment_method_index: int,
payment_method_types_index: int,
merchant_connector_id: string,
connector_name: string,
profile_id: string,
payment_method: string,
payment_method_type: string,
card_networks: array<string>,
accepted_currencies: option<ConnectorTypes.advan... | 202 | 9,837 |
hyperswitch-control-center | src/screens/ConfigurePMTs/PaymentMethodConfig.res | .res | module PmtConfigInp = {
@react.component
let make = (
~options: array<SelectBox.dropdownOption>,
~fieldsArray: array<ReactFinalForm.fieldRenderProps>,
) => {
let enabledList = (fieldsArray[0]->Option.getOr(ReactFinalForm.fakeFieldRenderProps)).input
let valueField = (fieldsArray[1]->Option.getOr(R... | 1,726 | 9,838 |
hyperswitch-control-center | src/screens/ConfigurePMTs/PaymentMethodConfigUtils.res | .res | let dropdownClassName = (options: array<SelectBox.dropdownOption>) =>
options->Array.length > 5 ? "h-80" : "h-full"
let getAdvanceConfiguration = (
advanceConfiguration: option<ConnectorTypes.advancedConfigurationList>,
) => {
let config = switch advanceConfiguration {
| Some(obj) => {
let firstThree = o... | 2,230 | 9,839 |
hyperswitch-control-center | src/screens/ConfigurePMTs/PaymentMethodEntity.res | .res | open PaymentMethodConfigTypes
type colType =
| Processor
| PaymentMethodType
| PaymentMethod
| CardNetwork
| CountriesAllowed
| CurrenciesAllowed
let defaultColumns = [
Processor,
PaymentMethodType,
PaymentMethod,
CountriesAllowed,
CurrenciesAllowed,
CardNetwork,
]
let getHeading = colType => ... | 916 | 9,840 |
hyperswitch-control-center | src/screens/ThreeDSFlow/ThreeDSUtils.res | .res | type pageState = NEW | LANDING
let statementObject: array<RoutingTypes.statement> = [
{
lhs: "amount",
value: {
\"type": "number",
value: ""->JSON.Encode.string,
},
comparison: "EQUAL TO",
},
{
logical: "AND",
value: {
\"type": "number",
value: ""->JSON.Encode.stri... | 428 | 9,841 |
hyperswitch-control-center | src/screens/ThreeDSFlow/HSwitchThreeDS.res | .res | open RoutingTypes
external toWasm: Dict.t<JSON.t> => wasmModule = "%identity"
module ActiveRulePreview = {
open LogicUtils
open APIUtils
@react.component
let make = (~initialRule, ~setInitialRule) => {
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let showPopUp = PopUpState.useShow... | 3,350 | 9,842 |
hyperswitch-control-center | src/screens/SDKPayment/SDKPaymentTypes.res | .res | type address = {
line1: string,
line2: string,
line3: string,
city: string,
state: string,
zip: string,
country: string,
first_name: string,
last_name: string,
}
type phone = {
number: string,
country_code: string,
}
type shipping = {
address: address,
phone: phone,
}
type billing = {
add... | 377 | 9,843 |
hyperswitch-control-center | src/screens/SDKPayment/SDKPage.res | .res | let h3Leading2Style = HSwitchUtils.getTextClass((H3, Leading_2))
module SDKConfiguarationFields = {
open MerchantAccountUtils
@react.component
let make = (~initialValues: SDKPaymentTypes.paymentType) => {
let businessProfiles = Recoil.useRecoilValueFromAtom(HyperswitchAtom.businessProfilesAtom)
let disab... | 1,798 | 9,844 |
hyperswitch-control-center | src/screens/SDKPayment/WebSDK.res | .res | open ReactHyperJs
open Promise
type configElements = {
appearanceElement: JSON.t,
paymentElement: JSON.t,
}
type configData = {
publishableKey: string,
config: string,
}
module CheckoutForm = {
@react.component
let make = (
~clientSecret,
~sdkType: sdkType,
~paymentStatus,
~currency,
... | 2,354 | 9,845 |
hyperswitch-control-center | src/screens/SDKPayment/TestCredentials.res | .res | @react.component
let make = () => {
let initialValues = Dict.make()
Dict.set(initialValues, "dummy_card_number", "4242 4242 4242 4242"->JSON.Encode.string)
<div className="p-6 bg-jp-gray-test_credentials_bg w-full h-fit">
<div className="mb-4">
<div className="flex items-center gap-4">
<p classN... | 860 | 9,846 |
hyperswitch-control-center | src/screens/SDKPayment/TestPayment.res | .res | module BasicAccountSetupSuccessfulPage = {
@react.component
let make = (
~iconName,
~statusText,
~buttonText,
~buttonOnClick,
~errorMessage="",
~customWidth="w-full",
~bgColor="bg-green-success_page_bg",
~buttonState=Button.Normal,
~isButtonVisible=true,
) => {
let headerTe... | 1,593 | 9,847 |
hyperswitch-control-center | src/screens/SDKPayment/SDKPaymentUtils.res | .res | let initialValueForForm: HSwitchSettingTypes.profileEntity => SDKPaymentTypes.paymentType = defaultBusinessProfile => {
{
amount: 10000.00,
currency: "USD",
profile_id: defaultBusinessProfile.profile_id,
description: "Default value",
customer_id: "hyperswitch_sdk_demo_id",
email: "guest@exampl... | 1,477 | 9,848 |
hyperswitch-control-center | src/screens/Transaction/Disputes/ShowDisputes.res | .res | open DisputesEntity
module DisputesNoteComponent = {
open ConnectorUtils
@react.component
let make = (~disputesData: DisputeTypes.disputes) => {
let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext(
ThemeProvider.themeContext,
)
let connectorTypeFromName = disputes... | 2,252 | 9,849 |
hyperswitch-control-center | src/screens/Transaction/Disputes/DisputesUtils.res | .res | open DisputeTypes
open LogicUtils
let disputeStatusVariantMapper = status => {
switch status {
| "dispute_opened" => DisputeOpened
| "dispute_expired" => DisputeExpired
| "dispute_accepted" => DisputeAccepted
| "dispute_cancelled" => DisputeCancelled
| "dispute_challenged" => DisputeChallenged
| "dispute_... | 1,857 | 9,850 |
hyperswitch-control-center | src/screens/Transaction/Disputes/DisputeTypes.res | .res | type disputes = {
profile_id: string,
dispute_id: string,
payment_id: string,
attempt_id: string,
amount: string,
currency: string,
dispute_status: string,
connector: string,
connector_status: string,
connector_dispute_id: string,
connector_reason: string,
connector_reason_code: string,
challe... | 329 | 9,851 |
hyperswitch-control-center | src/screens/Transaction/Disputes/DisputesEntity.res | .res | open LogicUtils
open DisputeTypes
let defaultColumns = [DisputeId, Amount, DisputeStatus, PaymentId, CreatedAt]
let columnsInPaymentPage = [DisputeId, ConnectorReason, DisputeStatus, CreatedAt]
let allColumns = [
Amount,
AttemptId,
ChallengeRequiredBy,
Connector,
ConnectorCreatedAt,
ConnectorDisputeId,
... | 1,662 | 9,852 |
hyperswitch-control-center | src/screens/Transaction/Disputes/Disputes.res | .res | @react.component
let make = () => {
open APIUtils
open HSwitchRemoteFilter
open DisputesUtils
open LogicUtils
let getURL = useGetURL()
let fetchDetails = useGetMethod()
let {filterValueJson, updateExistingKeys} = React.useContext(FilterContext.filterContext)
let (screenState, setScreenState) = React.us... | 1,264 | 9,853 |
hyperswitch-control-center | src/screens/Transaction/Disputes/UploadEvidenceForDisputes.res | .res | open HSwitchUtils
open FormDataUtils
let h3Leading2Text = getTextClass((H3, Leading_2))
let p1RegularText = getTextClass((P1, Regular))
let p1MediumText = getTextClass((P1, Medium))
let p2RegularText = getTextClass((P2, Regular))
let p3RegularText = getTextClass((P3, Regular))
module EvidenceUploadForm = {
@react.c... | 3,598 | 9,854 |
hyperswitch-control-center | src/screens/Transaction/CommonFilters/AmountFilter/AmountFilterTypes.res | .res | type amountFilter =
| GreaterThanOrEqualTo
| LessThanOrEqualTo
| EqualTo
| InBetween
| UnknownRange(string)
type amountFilterChild = [
| #start_amount
| #end_amount
| #amount_option
| #unknownchild
]
let mapStringToamountFilterChild = key => {
switch key {
| "start_amount" => #start_amount
| "... | 379 | 9,855 |
hyperswitch-control-center | src/screens/Transaction/CommonFilters/AmountFilter/AmountFilterUtils.res | .res | open AmountFilterTypes
open LogicUtils
let amountFilterOptions: array<FilterSelectBox.dropdownOption> = [
GreaterThanOrEqualTo,
LessThanOrEqualTo,
EqualTo,
InBetween,
]->Array.map(option => {
let label = option->mapRangeTypetoString
{
FilterSelectBox.label,
value: label,
}
})
let encodeFloatOrDefa... | 439 | 9,856 |
hyperswitch-control-center | src/screens/Transaction/CommonFilters/AmountFilter/AmountFilter.res | .res | let startamountField = FormRenderer.makeFieldInfo(
~label="",
~name="start_amount",
~placeholder="0",
~customInput=InputFields.numericTextInput(~precision=2),
~type_="number",
)
let endAmountField = FormRenderer.makeFieldInfo(
~label="",
~name="end_amount",
~placeholder="0",
~customInput=InputFields.... | 1,563 | 9,857 |
hyperswitch-control-center | src/screens/Transaction/Refunds/RefundUtils.res | .res | type filterTypes = {
connector: array<string>,
currency: array<string>,
status: array<string>,
connector_label: array<string>,
amount: array<string>,
}
type filter = [
| #connector
| #currency
| #status
| #connector_label
| #amount
| #unknown
]
let getFilterTypeFromString = filterType => {
swi... | 1,794 | 9,858 |
hyperswitch-control-center | src/screens/Transaction/Refunds/Refund.res | .res | @react.component
let make = () => {
open APIUtils
open HSwitchRemoteFilter
open LogicUtils
open RefundUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Loading)
let (refundData, setRefundsData) = React.useState... | 1,224 | 9,859 |
hyperswitch-control-center | src/screens/Transaction/Refunds/RefundEntity.res | .res | open LogicUtils
open HSwitchOrderUtils
type refunds = {
profile_id: string,
refund_id: string,
payment_id: string,
amount: float,
currency: string,
reason: string,
status: string,
metadata: string,
updated_at: string,
created_at: string,
error_message: string,
error_code: string,
connector: s... | 1,430 | 9,860 |
hyperswitch-control-center | src/screens/Transaction/Refunds/ShowRefund.res | .res | open OrderUtils
open RefundEntity
module RefundInfo = {
module Details = {
@react.component
let make = (
~data,
~getHeading,
~getCell,
~excludeColKeys=[],
~detailsFields,
~justifyClassName="justify-start",
~widthClass="w-1/4",
~bgColor="bg-white dark:bg-jp-gray... | 1,877 | 9,861 |
hyperswitch-control-center | src/screens/Transaction/Order/OrderTypes.res | .res | type refundMetaData = {
udf1: string,
new_customer: string,
login_date: string,
}
type refunds = {
refund_id: string,
payment_id: string,
amount: float,
currency: string,
reason: string,
status: string,
metadata: refundMetaData,
updated_at: string,
created_at: string,
error_message: string,
}... | 1,502 | 9,862 |
hyperswitch-control-center | src/screens/Transaction/Order/Orders.res | .res | @react.component
let make = (~previewOnly=false) => {
open APIUtils
open HSwitchRemoteFilter
open OrderUIUtils
open LogicUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let {updateTransactionEntity} = OMPSwitchHooks.useUserInfo()
let {userInfo: {transactionEntity, merchantId, orgId... | 1,572 | 9,863 |
hyperswitch-control-center | src/screens/Transaction/Order/OrderEntity.res | .res | open OrderTypes
open LogicUtils
module CurrencyCell = {
@react.component
let make = (~amount, ~currency) => {
<p className="whitespace-nowrap"> {`${amount} ${currency}`->React.string} </p>
}
}
let getRefundCell = (refunds: refunds, refundsColType: refundsColType): Table.cell => {
switch refundsColType {
... | 9,169 | 9,864 |
hyperswitch-control-center | src/screens/Transaction/Order/ShowOrder.res | .res | open LogicUtils
open OrderUtils
open HSwitchOrderUtils
open OrderTypes
type scrollIntoViewParams = {behavior: string, block: string, inline: string}
@send external scrollIntoView: (Dom.element, scrollIntoViewParams) => unit = "scrollIntoView"
module ShowOrderDetails = {
open OrderEntity
@react.component
let make... | 7,146 | 9,865 |
hyperswitch-control-center | src/screens/Transaction/Order/OrderUIUtils.res | .res | type filterTypes = {
connector: array<string>,
currency: array<string>,
authentication_type: array<string>,
payment_method: array<string>,
payment_method_type: array<string>,
status: array<string>,
connector_label: array<string>,
card_network: array<string>,
card_discovery: array<string>,
customer_i... | 4,143 | 9,866 |
hyperswitch-control-center | src/screens/Transaction/Order/OrderRefundForm.res | .res | open OrderEntity
open APIUtils
open OrderUtils
open HSwitchOrderUtils
open OrderTypes
open LogicUtils
@react.component
let make = (
~order,
~setShowModal,
~requestedRefundAmount,
~amountRefunded,
~amoutAvailableToRefund,
~refetch,
) => {
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
l... | 2,140 | 9,867 |
hyperswitch-control-center | src/screens/Transaction/Order/HSwitchOrderUtils.res | .res | open LogicUtils
type status =
| Succeeded
| Failed
| Cancelled
| Processing
| RequiresCustomerAction
| RequiresPaymentMethod
| RequiresConfirmation
| PartiallyCaptured
| None
type paymentAttemptStatus = [
| #STARTED
| #AUTHENTICATION_FAILED
| #ROUTER_DECLINED
| #AUTHENTICATION_PENDING
| #AU... | 1,568 | 9,868 |
hyperswitch-control-center | src/screens/Processors/ProcessorCards.res | .res | let p1MediumTextStyle = HSwitchUtils.getTextClass((P1, Medium))
module RequestConnector = {
@react.component
let make = (~connectorList, ~setShowModal) => {
<RenderIf condition={connectorList->Array.length === 0}>
<div
className="flex flex-col gap-6 items-center justify-center w-full bg-white rou... | 1,978 | 9,869 |
hyperswitch-control-center | src/screens/Processors/DummyProcessorModal.res | .res | open ProcessorCards
@react.component
let make = (
~processorModal,
~setProcessorModal,
~urlPrefix,
~configuredConnectors,
~connectorsAvailableForIntegration,
) => {
let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let showTestProcessor = featureFlagDetails.testProce... | 191 | 9,870 |
hyperswitch-control-center | src/screens/Payouts/ShowPayout.res | .res | module AttemptsSection = {
open PayoutsEntity
@react.component
let make = (~data: payoutAttempts) => {
let widthClass = "w-1/3"
<div className="flex flex-row flex-wrap">
<div className="w-full p-2">
<OrderUtils.Details
heading=String("Attempt Details")
data
deta... | 1,506 | 9,871 |
hyperswitch-control-center | src/screens/Payouts/PayoutsEntity.res | .res | open LogicUtils
type payoutAttempts = {
attempt_id: string,
status: string,
amount: float,
currency: string,
connector: string,
error_code: string,
error_message: string,
payment_method: string,
payout_method_type: string,
connector_transaction_id: string,
cancellation_reason: string,
unified_c... | 3,601 | 9,872 |
hyperswitch-control-center | src/screens/Payouts/PayoutsList.res | .res | @react.component
let make = () => {
open APIUtils
open HSwitchRemoteFilter
open LogicUtils
open PayoutsUtils
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Loading)
let (payoutData, setPayoutsData) = React.useState... | 1,099 | 9,873 |
hyperswitch-control-center | src/screens/Payouts/PayoutsUtils.res | .res | let getPayoutsList = async (
filterValueJson,
~updateDetails: (
string,
JSON.t,
Fetch.requestMethod,
~bodyFormData: Fetch.formData=?,
~headers: Dict.t<'a>=?,
~contentType: AuthHooks.contentType=?,
~version: UserInfoTypes.version=?,
) => promise<JSON.t>,
~setPayoutsData,
~setScreenS... | 1,117 | 9,874 |
hyperswitch-control-center | src/screens/DefaultHome/DefaultHome.res | .res | @react.component
let make = () => {
open PageUtils
open DefaultHomeUtils
// let count = 0
// let merchantCount = 1
<div
className="flex flex-1 flex-col gap-6 md:gap-8 w-full h-screen items-center overflow-auto p-4">
<div className="flex flex-col w-full gap-3 items-center justify-center cursor-pointer... | 508 | 9,875 |
hyperswitch-control-center | src/screens/DefaultHome/DefaultHomeUtils.res | .res | open DefaultHomeTypes
module DefaultActionItem = {
@react.component
let make = (~heading, ~description, ~img, ~action) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
<div
className="border rounded-xl p-3 flex items-center gap-4 shadow-cardShadow group cursor-pointer w-full justify-between py-4"
... | 1,142 | 9,876 |
hyperswitch-control-center | src/screens/DefaultHome/DefaultHomeTypes.res | .res | type actionType =
| InternalRoute(string)
| ExternalLink({url: string, trackingEvent: string})
| CustomAction
type productDetailCards = {
product?: ProductTypes.productTypes,
heading: string,
description: string,
imgSrc: string,
action: actionType,
}
| 66 | 9,877 |
hyperswitch-control-center | src/screens/GenerateReports/GenerateReport.res | .res | @react.component
let make = (~entityName) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let (reportModal, setReportModal) = React.useState(_ => false)
let {userHasAccess, hasAnyGroupAccess} = GroupACLHooks.useUserGroupACLHook()
let accessForGenerateReports = hasAnyGroupAccess(
userHasAccess(~groupAc... | 199 | 9,878 |
hyperswitch-control-center | src/screens/GenerateReports/DownloadReportModal.res | .res | type startAndEndTime = {
startTime: JSON.t,
endTime: JSON.t,
}
type timeRange = {timeRange: startAndEndTime}
@react.component
let make = (~reportModal, ~setReportModal, ~entityName) => {
open APIUtils
let getURL = useGetURL()
let showToast = ToastState.useShowToast()
let updateDetails = useUpdateMethod(~s... | 960 | 9,879 |
hyperswitch-control-center | src/screens/SbxOnboardingSurvey/SbxOnboardingSurveyUtils.res | .res | let keysToValidateForHyperswitch = [
"designation",
"business_website",
"about_business",
"major_markets",
"business_size",
"hyperswitch_req",
"required_features",
"required_processors",
"planned_live_date",
"miscellaneous",
]
let businessName = FormRenderer.makeFieldInfo(
~label="Business name",... | 1,115 | 9,880 |
hyperswitch-control-center | src/screens/SbxOnboardingSurvey/SbxOnboardingSurvey.res | .res | module OtherfieldRender = {
@react.component
let make = (~field_name) => {
open LogicUtils
let valueField = ReactFinalForm.useField(field_name).input
let textField = ReactFinalForm.useField(`${field_name}_otherstring`).input
let textInput: ReactFinalForm.fieldRenderPropsInput = {
name: `${fie... | 2,634 | 9,881 |
hyperswitch-control-center | src/screens/Surcharge/Surcharge.res | .res | module ActiveRulePreview = {
open LogicUtils
open APIUtils
@react.component
let make = (~initialRule, ~setInitialRule, ~setPageView, ~setShowWarning) => {
let rule = initialRule->Option.getOr(Dict.make())
let getURL = useGetURL()
let updateDetails = useUpdateMethod()
let showToast = ToastState.u... | 3,351 | 9,882 |
hyperswitch-control-center | src/screens/Surcharge/SurchargeUtils.res | .res | open ThreeDSUtils
let defaultSurcharge: RoutingTypes.surchargeDetailsType = {
surcharge: {
\"type": "rate",
value: {
percentage: 0.0,
},
},
tax_on_surcharge: {
percentage: 0.0,
},
}
let surchargeRules: RoutingTypes.rule = {
name: "rule_1",
connectorSelection: {
surcharge_details:... | 1,522 | 9,883 |
hyperswitch-control-center | src/Vault/VaultSampleData.res | .res | let customersList = [
{
"id": "cust_id_987654",
"merchant_reference_id": "dummy-ref_id_897654",
"name": "Alice Smith",
"email": "user@example.com",
"phone": "1234567890",
"phone_country_code": "+44",
"description": "First customer",
"default_billing_address": null,
"default_shippin... | 8,336 | 9,884 |
hyperswitch-control-center | src/Vault/VaultContainer/VaultContainer.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
let {userHasAccess} = GroupACLHooks.useUserGroupACLHook()
let fetchConnectorListResponse = ConnectorListHook.useFetchConnectorList(
~entityName=V2(V2_CONNECTOR),
~version=V2,
)
let (sampleReport, setSampleReport) = React.useSt... | 484 | 9,885 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultHomeTypes.res | .res | type actionType =
| InternalRoute(string)
| ExternalLink({url: string, trackingEvent: string})
type actionCards = {
heading: string,
imgSrc: string,
action: actionType,
}
type vaultSections = [
| #authenticateProcessor
| #setupPMTS
| #setupWebhook
| #reviewAndConnect
]
| 81 | 9,886 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultDefaultHome.res | .res | @react.component
let make = () => {
open PageUtils
let mixpanelEvent = MixpanelHook.useSendEvent()
<div className="flex flex-1 flex-col w-full gap-14 items-center justify-center w-full h-screen">
<img alt="vaultOnboarding" src="/assets/VaultOnboarding.svg" />
<div className="flex flex-col gap-8 items-ce... | 428 | 9,887 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultHome.res | .res | @react.component
let make = () => {
open PageUtils
let {setCreateNewMerchant} = React.useContext(ProductSelectionProvider.defaultContext)
let mixpanelEvent = MixpanelHook.useSendEvent()
let userHasCreateMerchantAccess = OMPCreateAccessHook.useOMPCreateAccessHook([
#tenant_admin,
#org_admin,
])
<d... | 384 | 9,888 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultOnboarding.res | .res | @react.component
let make = () => {
open APIUtils
open LogicUtils
open VerticalStepIndicatorTypes
open VerticalStepIndicatorUtils
open ConnectorUtils
open CommonAuthHooks
open VaultHomeUtils
open PageLoaderWrapper
let getURL = useGetURL()
let (_, getNameForId) = OMPSwitchHooks.useOMPData()
let up... | 2,377 | 9,889 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultHomeUtils.res | .res | open VaultHomeTypes
open VerticalStepIndicatorTypes
module VaultActionItem = {
@react.component
let make = (~heading, ~img, ~action) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
<div
className="border rounded-xl p-3 flex items-center gap-4 group cursor-pointer justify-between py-3"
onCl... | 810 | 9,890 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomersEntity.res | .res | open VaultCustomersType
let defaultColumns = [CustomerId, Name, Email, PhoneCountryCode, Phone, CreatedAt]
let allColumns = [CustomerId, Name, Email, Phone, PhoneCountryCode, Address, CreatedAt]
let getHeading = colType => {
switch colType {
| CustomerId => Table.makeHeaderInfo(~key="id", ~title="Customer Id")
... | 716 | 9,891 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodsEntity.res | .res | open VaultPaymentMethodsTypes
open LogicUtils
let defaultColumns = [
PaymentMethodId,
PaymentMethodType,
PaymentMethodData,
PSPTokensization,
NetworkTokenization,
CreatedAt,
LastUsed,
]
let getHeading = colType => {
switch colType {
| PaymentMethodId => Table.makeHeaderInfo(~key="id", ~title="Paymen... | 1,279 | 9,892 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodDetailsSidebar.res | .res | module PaymentMethodDetails = {
@react.component
let make = (~data) => {
<div className="flex flex-col gap-6">
<div
className="font-semibold text-nd_gray-700 leading-6 text-fs-18 dark:text-white dark:text-opacity-75">
{"Payment Method Details"->React.string}
</div>
<div classNa... | 1,281 | 9,893 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomersTotalDataView.res | .res | module TotalNumbersViewCard = {
@react.component
let make = (~title, ~count, ~countTextCss="font-semibold text-2xl text-nd_gray-600") => {
<div
className={`flex flex-col gap-3 h-20 justify-between bg-white text-semibold border rounded-md pt-3 px-4 pb-2.5 w-306-px my-8 border-nd_gray-150`}>
<p class... | 725 | 9,894 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomersAndTokens.res | .res | module NoDataFoundComponent = {
@react.component
let make = (
~setSampleReport,
~setCustomersData,
~setFilteredCustomersData,
~offset,
~setOffset,
~total,
~fieldArray,
) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let handleSampleReportButtonClick = () => {
mixpa... | 1,641 | 9,895 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodDetailsUtils.res | .res | open VaultPaymentMethodDetailsTypes
open LogicUtils
let cardDetailsMapper = dict => {
issuer_country: dict->getString("issuer_country", ""),
last4_digits: dict->getString("last4_digits", ""),
expiry_month: dict->getString("expiry_month", ""),
expiry_year: dict->getString("expiry_year", ""),
card_holder_name:... | 599 | 9,896 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodDetailsEntity.res | .res | open VaultPaymentMethodDetailsTypes
let defaultColumns = [
CardHolderName,
CardType,
CardNetwork,
LastFourDigits,
CardExpiryMonth,
CardExpiryYear,
CardIssuer,
CardIssuingCountry,
CardIsIn,
]
let allColumns = defaultColumns
let getHeading = colType => {
switch colType {
| CardHolderName => Table... | 443 | 9,897 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPSPTokensEntity.res | .res | open VaultPaymentMethodDetailsTypes
open LogicUtils
type pspTokenColsTypes =
| TokenId
| Connector
| MCAId
| TokenType
| Status
let defaultColumns = [TokenId, MCAId, TokenType, Status]
let getHeading = colType => {
switch colType {
| TokenId => Table.makeHeaderInfo(~key="token", ~title="Token")
| Con... | 542 | 9,898 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodDetailsTypes.res | .res | type cardDetails = {
issuer_country: string,
last4_digits: string,
expiry_month: string,
expiry_year: string,
card_holder_name: string,
card_fingerprint: string,
nick_name: string,
card_network: string,
card_isin: string,
card_issuer: string,
card_type: string,
saved_to_locker: bool,
}
type pay... | 328 | 9,899 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodsTypes.res | .res | type psp_tokens = {
mca_id: string,
connector: string,
status: string,
tokentype: string,
token: string,
}
type psp_tokensization = {psp_token: array<psp_tokens>}
type paymentMethodCardType = {
issuer_country: string,
last4_digits: string,
expiry_month: string,
expiry_year: string,
card_holder_nam... | 349 | 9,900 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomerSummary.res | .res | module DisplayKeyValueParams = {
@react.component
let make = (
~showTitle: bool=true,
~heading: Table.header,
~value: Table.cell,
~isInHeader=false,
~isHorizontal=false,
~customMoneyStyle="",
~labelMargin="",
~customDateStyle="",
~wordBreak=true,
~textColor="",
~overiddin... | 2,318 | 9,901 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultPaymentMethodUtils.res | .res | type status = Enabled | Disabled
type connectorTokenStatus = Active | Inactive
let statusToVariantMapper = (status: string) => {
switch status {
| "ENABLED" => Enabled
| "DISABLED" => Disabled
| _ => Disabled
}
}
let connectrTokensStatusToVariantMapper = (connectorTokenStatus: string) => {
switch connect... | 115 | 9,902 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultCustomersType.res | .res | type customers = {
id: string,
name: string,
email: string,
phone: string,
phone_country_code: string,
description: string,
address: string,
created_at: string,
metadata: JSON.t,
}
type customersColsType =
| CustomerId
| Name
| Email
| Phone
| PhoneCountryCode
| Address
| CreatedAt
typ... | 111 | 9,903 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultCustomersAndTokens/VaultNetworkTokensEntity.res | .res | open VaultPaymentMethodDetailsTypes
open LogicUtils
type networkTokenColsTypes =
| Token
| CardNetwork
let defaultColumns = [Token, CardNetwork]
let getHeading = colType => {
switch colType {
| Token => Table.makeHeaderInfo(~key="token", ~title="Token")
| CardNetwork => Table.makeHeaderInfo(~key="card_netw... | 181 | 9,904 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorUtils.res | .res | let connectorListForVault: array<ConnectorTypes.connectorTypes> = [Processors(STRIPE)]
| 21 | 9,905 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultNetworkTokenisation.res | .res | @react.component
let make = () => {
let (toggleState, setToggleState) = React.useState(_ => false)
<div className="mt-10 flex flex-col gap-2">
<div className="flex flex-row justify-between items-center">
<p className="font-semibold text-lg text-nd_gray-600">
{"Network Tokenization"->React.string... | 319 | 9,906 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProceesorReview.res | .res | @react.component
let make = (~connectorInfo) => {
open CommonAuthHooks
open LogicUtils
let {setShowSideBar} = React.useContext(GlobalProvider.defaultContext)
let connectorInfodict = ConnectorInterface.mapDictToConnectorPayload(
ConnectorInterface.connectorInterfaceV2,
connectorInfo->LogicUtils.getDictF... | 774 | 9,907 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProcessorList.res | .res | @react.component
let make = () => {
let (configuredConnectors, setConfiguredConnectors) = React.useState(_ => [])
let (filteredConnectorData, setFilteredConnectorData) = React.useState(_ => [])
let connectorListFromRecoil = ConnectorInterface.useConnectorArrayMapper(
~interface=ConnectorInterface.connectorInt... | 602 | 9,908 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConfiguration.res | .res | @react.component
let make = () => {
let (tabIndex, setTabIndex) = React.useState(_ => 0)
let setCurrentTabName = Recoil.useSetRecoilState(HyperswitchAtom.currentTabNameRecoilAtom)
let {setShowSideBar} = React.useContext(GlobalProvider.defaultContext)
let vaultPspTokenizationTabElement = {
<div className="f... | 788 | 9,909 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorHelper.res | .res | module VaultRequestProcessorCard = {
@react.component
let make = () => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let handleClick = () => {
mixpanelEvent(~eventName="vault_request_processor")
"https://hyperswitch-io.slack.com/?redir=%2Fssb%2Fredirect"->Window._open
}
<div
cl... | 226 | 9,910 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultConnectorEntity.res | .res | open ConnectorTypes
let getPreviouslyConnectedList: JSON.t => array<connectorPayloadV2> = json => {
let data = ConnectorInterface.mapJsonArrayToConnectorPayloads(
ConnectorInterface.connectorInterfaceV2,
json,
PaymentProcessor,
)
data
}
type colType =
| Name
| Status
| Disabled
| Actions
| P... | 881 | 9,911 |
hyperswitch-control-center | src/Vault/VaultScreens/VaultConnectors/VaultProcessorCards.res | .res | let p1MediumTextStyle = HSwitchUtils.getTextClass((P1, Medium))
module RequestConnector = {
@react.component
let make = (~connectorList, ~setShowModal) => {
let mixpanelEvent = MixpanelHook.useSendEvent()
let handleClick = () => {
mixpanelEvent(~eventName="vault_request_processor")
setShowModa... | 1,462 | 9,912 |
hyperswitch-control-center | src/Vault/VaultApp/VaultApp.res | .res | @react.component
let make = () => {
let url = RescriptReactRouter.useUrl()
{
switch url.path->HSwitchUtils.urlPath {
| list{"v2", "vault"} => <VaultHome />
| list{"v2", "vault", "home"} => <VaultDefaultHome />
| list{"v2", "vault", "onboarding", ..._} | list{"v2", "vault", "customers-tokens", ..._}... | 120 | 9,913 |
hyperswitch-control-center | src/Vault/VaultApp/VaultSidebarValues.res | .res | open SidebarTypes
let vaultConfiguration = {
Link({
name: "Configuration",
link: `/v2/vault/onboarding`,
icon: "nd-overview",
access: Access,
searchOptions: [("Vault configuration", "")],
selectedIcon: "nd-overview-fill",
})
}
let vaultCustomersAndTokens = {
Link({
name: "Customers &... | 216 | 9,914 |
hyperswitch-control-center | src/UIConifg/UIConfig.res | .res | module ButtonConfig = {
type borderRadius = {
default: string,
defaultPagination: string,
}
type textColor = {
primaryOutline: string,
primaryNormal: string,
primaryDisabled: string,
secondaryNormal: string,
secondaryLoading: string,
secondaryDisabled: string,
secondaryNoBorder... | 1,717 | 9,915 |
hyperswitch-control-center | src/server/config.mjs | .mjs | import * as Fs from "fs";
import toml from "@iarna/toml";
// Helper function for error handling
const errorHandler = (res, errorMessage = "something went wrong") => {
res.writeHead(500, { "Content-Type": "text/plain" });
console.error(errorMessage);
res.end("Internal Server Error");
};
// Update config with env... | 1,292 | 9,916 |
hyperswitch-control-center | src/server/NodeJs.res | .res | type promisifyable
type execResponse
type promiseableExecFile = (string, array<string>) => Promise.t<execResponse>
module Util = {
@module("util")
external promisify: promisifyable => promiseableExecFile = "promisify"
}
module ChildProcess = {
@module("child_process")
external execFile: promisifyable = "execF... | 365 | 9,917 |
hyperswitch-control-center | src/server/Server.res | .res | @val @scope("process")
external env: Dict.t<string> = "env"
let appName = Some("hyperswitch")
let serverPath = "dist/hyperswitch"
let port = 9000
open NodeJs
@module("./config.mjs")
external configHandler: (Http.request, Http.response, bool, string, string) => unit =
"configHandler"
@module("./config.mjs")
exter... | 1,261 | 9,918 |
hyperswitch-control-center | src/server/health.mjs | .mjs | import * as Fs from "fs";
const errorHandler = (res, result) => {
res.writeHead(500, { "Content-Type": "application/json" });
res.write(JSON.stringify(result));
res.end();
};
let checkHealth = async (res) => {
let output = {
env_config: false,
app_file: false,
wasm_file: false,
};
try {
let... | 362 | 9,919 |
hyperswitch-control-center | src/entities/EntityType.res | .res | type initialFilters<'t> = {
field: FormRenderer.fieldInfoType,
localFilter: option<(array<Nullable.t<'t>>, JSON.t) => array<Nullable.t<'t>>>,
}
type optionType<'t> = {
urlKey: string,
field: FormRenderer.fieldInfoType,
parser: JSON.t => JSON.t,
localFilter: option<(array<Nullable.t<'t>>, JSON.t) => array<Nu... | 1,002 | 9,920 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.