Skip to content

Commit

Permalink
Merge branch 'main' into enable-new-connector
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Dec 5, 2023
2 parents bd079f1 + b220415 commit ae9f64b
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 360 deletions.
18 changes: 13 additions & 5 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ commit_msg=$(cat "$commit_msg_file")
npx prettier --write .
npm run re:format

# Define your commit message convention (e.g., starts with "feature:", "fix:", etc.)
commit_regex="^(Merge branch|feat|fix|chore|docs|style|refactor|test|enhancement):.+"
# Define your commit message convention (e.g., starts with "feat:", "fix:", etc.)
commit_regex="^(Merge branch|(feat|fix|chore|refactor|docs|test|style|enhancement):).+"

if ! echo "$commit_msg" | grep -Ei "$commit_regex" ; then
echo "Aborting commit. Your commit message does not follow the conventional format."
echo "Example - <feat>: <subject> - <description>"

if git log -1 --show-signature &> /dev/null; then
if ! echo "$commit_msg" | grep -Ei "$commit_regex" ; then
echo "Aborting commit. Your commit message does not follow the conventional format."
echo "The commit message should begin with one of the following keywords followed by a colon: 'feat', 'fix', 'chore', 'refactor', 'docs', 'test' or 'style'. For example, it should be formatted like this: 'feat: <subject> - <description>'"
exit 1
fi
else
echo "~~~~**** Error: Commit Signature Missing. ****~~~~"
echo "Please make sure to sign your commits. You can sign your commit by using the '-S' option with 'git commit'."
echo "Example: git commit -S -m 'Your commit message'"
exit 1
fi

Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,6 @@ The `production_access` feature flag enables a flow for users to request live pr

The `quick_start` feature flag enables the simplified onboarding flow for new users, where he connects to processors, configure payment routing and testing a payment, all in one flow.

#### Stripe plus paypal

The `stripe_plus_paypal` feature flag enables access to simplified multi-processor connectivity through Stripe and PayPal. When turned on, users are guided through a streamlined setup flow to connect both Stripe and PayPal accounts and experience it in a checkout page.

#### Woocommerce

The `woocommerce` feature flag controls the visibility of WooCommerce integration with Hyperswitch flow within the dashboard. When enabled, users will have access to the step-by-step guide to integrate the woocommerce plugin for hyperswitch.

#### Open SDK

The `open_sdk` feature flag enables access to the Checkout Page web SDK from within the dashboard. When enabled, developers can preview the SDK from within the dashboard and make payments.
Expand Down
2 changes: 0 additions & 2 deletions config/FeatureFlag.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"magic_link": false,
"production_access": false,
"quick_start": false,
"stripe_plus_paypal": false,
"woocommerce": false,
"open_sdk": false,
"switch_merchant": false,
"audit_trail": false,
Expand Down
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@
"author": "Shiva Nandan <[email protected]>",
"license": "MIT",
"scripts": {
"setup-env": "chmod +x ./replace_env.sh && ./replace_env.sh",
"pre-commit": "bash .githooks/commit-msg",
"start": "chmod +x ./replace_env.sh && ./replace_env.sh && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && appName=hyperswitch webpack serve --config webpack.dev.js",
"start:server_compiler": "webpack --config webpack.server.js --watch",
"start": "npm run setup-env && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && appName=hyperswitch webpack serve --config webpack.dev.js",
"serve": "npm run setup-env && cp env-config.js ./dist/hyperswitch && node dist/server/server.js",
"prod:start": "webpack serve --config webpack.dev.js",
"build:prod": "chmod +x ./replace_env.sh && ./replace_env.sh && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && webpack --config webpack.prod.js",
"ssr_sript_build": "BRANCH_NAME=ssr webpack --config webpack.prod.js",
"ssr_run_server": "node --watch dist/server/server.js",
"build:netlify": "webpack --config webpack.prod.js --env netlifyHosted",
"build:test": "cd tests && npx rescript build -with-deps",
"build:prod": "npm run setup-env && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && webpack --config webpack.prod.js",
"re:build": "rescript",
"re:clean": "rescript clean",
"re:start": "rescript build -w",
"re:format": "rescript format -all",
"use-prod-ec": "mv public/_redirects_for_prod public/_redirects",
"serve": "chmod +x ./replace_env.sh && ./replace_env.sh && cp env-config.js ./dist/hyperswitch && node dist/server/server.js",
"build:test": "cd tests && npx rescript build -with-deps",
"clean:test": "cd tests && npx rescript clean -with-deps",
"unit:test": "cd tests && npx rescript build -with-deps && jest unit_test",
"revert:test": "cd tests && npx rescript clean -with-deps && cd .. && npx rescript build -with-deps",
"postinstall": "git config core.hooksPath .githooks && chmod +x .githooks/commit-msg"
},
"husky": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LoadedTable.res
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ let make = (
? ""
: `${isMinHeightRequired ? noScrollbar ? "" : "overflow-x-scroll" : "overflow-scroll"}`
let loadedTable =
<div className={`no-scrollbar ${scrollBarClass} no-scrollbar`}>
<div className={`no-scrollbar ${scrollBarClass}`}>
{switch dataView {
| Table => {
let children =
Expand Down
13 changes: 6 additions & 7 deletions src/components/Loader.res
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ let make = (
<div className={`${animationType} mb-10`}>
<Icon name="spinner" size customIconColor=customSpinnerIconColor />
</div>
{React.string(loadingText)}
{children}
</div>

<div className="flex flex-col">
<div className="w-full flex justify-center py-10">
<div className="w-20 h-16">
<div className="scale-400 pt-px">
<React.Suspense fallback={loader}>
<ErrorBoundary>
<React.Suspense fallback={loader}>
<ErrorBoundary>
<div className="scale-400 pt-px">
<Lottie animationData={loaderLottieFile} autoplay=true loop=true />
</ErrorBoundary>
</React.Suspense>
</div>
</div>
</ErrorBoundary>
</React.Suspense>
</div>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/entryPoints/hyperswitch/FeatureFlagUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ type featureFlag = {
testLiveToggle: bool,
magicLink: bool,
quickStart: bool,
stripePlusPayPal: bool,
wooCommerce: bool,
openSDK: bool,
switchMerchant: bool,
testLiveMode: option<bool>,
Expand Down Expand Up @@ -34,8 +32,6 @@ let featureFlagType = (featureFlags: Js.Json.t) => {
testLiveToggle: dict->getBool("test_live_toggle", false),
magicLink: dict->getBool("magic_link", false),
quickStart: dict->getBool("quick_start", false),
stripePlusPayPal: dict->getBool("stripe_plus_paypal", false),
wooCommerce: dict->getBool("woocommerce", false),
openSDK: dict->getBool("open_sdk", false),
switchMerchant: dict->getBool("switch_merchant", false),
testLiveMode: dict->getOptionBool("test_live_mode"),
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/hyperswitch/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ let make = () => {
</div>
</div>
<div
className="w-full h-screen overflow-x-scroll xl:overflow-x-hidden overflow-y-scroll ">
className="w-full h-screen overflow-x-scroll xl:overflow-x-hidden overflow-y-scroll">
<div
className="w-full h-full max-w-fixedPageWidth p-6 md:px-16 md:pb-16 pt-[3rem] overflow-scroll md:overflow-y-scroll md:overflow-x-hidden flex flex-col gap-10">
<ErrorBoundary>
Expand Down
4 changes: 1 addition & 3 deletions src/entryPoints/hyperswitch/HyperSwitchEntry.res
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ module HyperSwitchEntryComponent = {
(await postDetails(url, Js.Dict.empty()->Js.Json.object_, Post))->Js.Json.stringify
setFeatureFlag(._ => stringifiedResponse)
} catch {
| Js.Exn.Error(e) => {
let _err = Js.Exn.message(e)->Belt.Option.getWithDefault("Failed to Fetch!")
}
| _ => ()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/hyperswitch/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ let reconTag = (recon, isReconEnabled) =>
: emptyComponent

let getHyperSwitchAppSidebars = (
~isReconEnabled=false,
~isReconEnabled: bool,
~featureFlagDetails: FeatureFlagUtils.featureFlag,
~userRole,
(),
Expand Down
6 changes: 1 addition & 5 deletions src/screens/HyperSwitch/Analytics/HSAnalyticsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ let getStringListFromArrayDict = metrics => {
metrics->Js.Array2.map(item => item->getDictFromJsonObject->getString("name", ""))
}

let getCustomFormattedFloatDate = (floatDate, format) => {
floatDate->Js.Date.fromFloat->Js.Date.toISOString->Table.dateFormat(format)
}

module NoData = {
@react.component
let make = (~title, ~subTitle) => {
Expand Down Expand Up @@ -209,7 +205,7 @@ let generateTablePayload = (
~isIndustry: bool,
~mode: option<string>,
~customFilter,
~showDeltaMetrics=false,
~showDeltaMetrics,
~moduleName as _: string,
~source: string="BATCH",
(),
Expand Down
16 changes: 1 addition & 15 deletions src/screens/HyperSwitch/Developer/DeveloperUtils.res
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
open HSwitchSettingTypes
let titleClass = "md:font-bold font-semibold md:text-fs-16 text-fs-13 text-jp-gray-900 text-opacity-75 dark:text-white dark:text-opacity-75"

let paymentsEvents = ["succeeded", "failed", "processing", "action_required"]
let refundsEvents = ["succeeded", "failed"]
let disputesEvents = ["opened", "expired", "accepted", "cancelled", "challenged", "won", "lost"]

let webhookEventsDict =
[
("payment", paymentsEvents->Js.Array2.map(Js.Json.string)->Js.Json.array),
("refund", refundsEvents->Js.Array2.map(Js.Json.string)->Js.Json.array),
("dispute", disputesEvents->Js.Array2.map(Js.Json.string)->Js.Json.array),
]->Js.Dict.fromArray

let validateAPIKeyForm = (
values: Js.Json.t,
~setIsDisabled=_ => (),
keys: array<string>,
~setShowCustomDate=_ => (),
~setShowCustomDate,
(),
) => {
let errors = Js.Dict.empty()
Expand Down Expand Up @@ -81,7 +69,6 @@ let getRecordTypeFromString = value => {

type apiKey = {
key_id: string,
merchant_id: string,
name: string,
description: string,
prefix: string,
Expand All @@ -93,7 +80,6 @@ type apiKey = {
let itemToObjMapper = dict => {
open LogicUtils
{
merchant_id: getString(dict, "merchant_id", ""),
key_id: getString(dict, "key_id", ""),
name: getString(dict, "name", ""),
description: getString(dict, "description", ""),
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HyperSwitch/Developer/Webhooks.res
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ let make = (~webhookOnly=false, ~showFormOnly=false, ~profileId="") => {
open HSwitchSettingTypes
HSwitchMerchantAccountUtils.validateMerchantAccountForm(
~values,
~setIsDisabled,
~setIsDisabled=Some(setIsDisabled),
~fieldsToValidate={
[WebhookUrl, ReturnUrl]->Js.Array2.filter(urlField =>
urlField === WebhookUrl || !webhookOnly
Expand Down
Loading

0 comments on commit ae9f64b

Please sign in to comment.