Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

improve payout method clarity

Steven Teya66958ed44fc
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
index 244536ebe1..ec66c65db6 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
@@ -14,14 +14,22 @@ import { PayoutMethodsDropdown } from "@/ui/partners/payout-methods-dropdown";
import {
AnimatedSizeContainer,
Button,
+ InfoTooltip,
Sheet,
+ SimpleTooltipContent,
Slider,
useScrollProgress,
} from "@dub/ui";
-import { CONNECT_SUPPORTED_COUNTRIES, currencyFormatter } from "@dub/utils";
+import {
+ CONNECT_SUPPORTED_COUNTRIES,
+ COUNTRIES,
+ currencyFormatter,
+} from "@dub/utils";
+import { COUNTRY_CURRENCY_CODES } from "@dub/utils/src";
import NumberFlow from "@number-flow/react";
import { PartyPopper } from "lucide-react";
import { useAction } from "next-safe-action/hooks";
+import Link from "next/link";
import {
Dispatch,
SetStateAction,
@@ -104,8 +112,17 @@ function PartnerPayoutSettingsSheetInner({
return (
<form onSubmit={handleSubmit(onSubmit)} className="flex h-full flex-col">
<div className="flex h-16 items-center justify-between border-b border-neutral-200 px-6 py-4">
- <Sheet.Title className="text-lg font-semibold">
- Payout settings
+ <Sheet.Title className="flex items-center gap-1 text-lg font-semibold">
+ Payout settings{" "}
+ <InfoTooltip
+ content={
+ <SimpleTooltipContent
+ title="Learn how to set up your payout account and receive payouts."
+ cta="Learn more."
+ href="https://dub.co/help/article/receiving-payouts"
+ />
+ }
+ />
</Sheet.Title>
</div>
@@ -129,6 +146,33 @@ function PartnerPayoutSettingsSheetInner({
) : (
<PayoutMethodsDropdown />
)}
+
+ {partner?.country &&
+ CONNECT_SUPPORTED_COUNTRIES.includes(partner.country) && (
+ <p className="text-xs text-neutral-500">
+ For compliance reasons, your payout bank account must match
+ your local currency. Since you're based in{" "}
+ <Link
+ href="/profile"
+ target="_blank"
+ className="font-medium text-neutral-900 underline decoration-dotted underline-offset-2"
+ >
+ {COUNTRIES[partner.country]}
+ </Link>{" "}
+ , you will need to connect a{" "}
+ <span className="font-medium text-neutral-900">
+ {COUNTRY_CURRENCY_CODES[partner.country]} bank account
+ </span>{" "}
+ to receive payouts.{" "}
+ <Link
+ href="https://dub.co/help/article/receiving-payouts"
+ target="_blank"
+ className="font-medium text-neutral-900 underline decoration-dotted underline-offset-2"
+ >
+ Learn more ↗
+ </Link>
+ </p>
+ )}
</div>
{/* Minimum withdrawal amount */}
diff --git a/packages/email/src/templates/connect-payout-reminder.tsx b/packages/email/src/templates/connect-payout-reminder.tsx
index 1618b4cde7..68629aac34 100644
--- a/packages/email/src/templates/connect-payout-reminder.tsx
+++ b/packages/email/src/templates/connect-payout-reminder.tsx
@@ -22,13 +22,13 @@ export default function ConnectPayoutReminder({
{
id: "1",
name: "Acme",
- logo: "https://dubassets.com/logos/clrei1gld0002vs9mzn93p8ik_384uSfo",
+ logo: "https://dubassets.com/programs/prog_CYCu7IMAapjkRpTnr8F1azjN/logo_ObfFYsM",
amount: 120_00,
},
{
id: "2",
name: "Dub",
- logo: "https://dubassets.com/programs/prog_d8pl69xXCv4AoHNT281pHQdo/logo_MJb5L8D",
+ logo: "https://dubassets.com/programs/prog_d8pl69xXCv4AoHNT281pHQdo/logo_TMLMTHs",
amount: 40_24,
},
],
diff --git a/packages/email/src/templates/welcome-email-partner.tsx b/packages/email/src/templates/welcome-email-partner.tsx
index 0850d0bac4..fe3fab0e0f 100644
--- a/packages/email/src/templates/welcome-email-partner.tsx
+++ b/packages/email/src/templates/welcome-email-partner.tsx
@@ -72,22 +72,24 @@ export default function WelcomeEmailPartner({
>
Connect a payout method
</Link>{" "}
- to get paid for your referrals.
+ to get paid for your referrals. Your payout bank account must
+ match your local currency for compliance reasons. E.g. if you're
+ based in the UK, you will need to connect a GBP bank account to
+ receive payouts.{" "}
+ <Link
+ href="https://ship.dub.co/payouts-guide"
+ className="font-semibold text-black underline underline-offset-4"
+ >
+ Learn more ↗
+ </Link>
</Text>
<Text className="mb-4 text-sm leading-6 text-gray-600">
<strong className="font-medium text-black">
3. Join a program
</strong>
- : If you haven't already, join an affiliate program, or enroll in
- our own{" "}
- <Link
- href="https://ship.dub.co/dub-program"
- className="font-semibold text-black underline underline-offset-4"
- >
- Dub Affiliate Program
- </Link>{" "}
- to earn 30% for every sale you refer.
+ : If you haven't already, join an affiliate program and start
+ earning commissions for your referrals
</Text>
<Text className="mb-4 text-sm leading-6 text-gray-600">
diff --git a/packages/prisma/schema/workspace.prisma b/packages/prisma/schema/workspace.prisma
index 4934143e21..ca9aee5654 100644
--- a/packages/prisma/schema/workspace.prisma
+++ b/packages/prisma/schema/workspace.prisma
@@ -43,7 +43,6 @@ model Project {
conversionEnabled Boolean @default(false) // Whether to enable conversion tracking for links by default
webhookEnabled Boolean @default(false)
- ssoEnabled Boolean @default(false) // TODO: this is not used
dotLinkClaimed Boolean @default(false)
ssoEmailDomain String? @unique
ssoEnforcedAt DateTime?
diff --git a/packages/utils/src/constants/country-currency-codes.ts b/packages/utils/src/constants/country-currency-codes.ts
new file mode 100644
index 0000000000..4fe5dd6aa2
--- /dev/null
+++ b/packages/utils/src/constants/country-currency-codes.ts
@@ -0,0 +1,303 @@
+export const COUNTRY_CURRENCY_CODES: { [key: string]: string } = {
+ // A
+ AF: "AFN",
+ AL: "ALL",
+ DZ: "DZD",
+ AS: "USD",
+ AD: "EUR",
+ AO: "AOA",
+ AI: "XCD",
+ AQ: "N/A",
+ AG: "XCD",
+ AR: "ARS",
+ AM: "AMD",
+ AW: "AWG",
+ AU: "AUD",
+ AT: "EUR",
+ AZ: "AZN",
+
+ // B
+ BS: "BSD",
+ BH: "BHD",
+ BD: "BDT",
+ BB: "BBD",
+ BY: "BYN",
+ BE: "EUR",
+ BZ: "BZD",
+ BJ: "XOF",
+ BM: "BMD",
+ BT: "BTN",
+ BO: "BOB",
+ BA: "BAM",
+ BW: "BWP",
+ BV: "NOK",
+ BR: "BRL",
+ IO: "USD",
+ BN: "BND",
+ BG: "BGN",
+ BF: "XOF",
+ BI: "BIF",
+
+ // C
+ KH: "KHR",
+ CM: "XAF",
+ CA: "CAD",
+ CV: "CVE",
+ KY: "KYD",
+ CF: "XAF",
+ TD: "XAF",
+ CL: "CLP",
+ CN: "CNY",
+ CX: "AUD",
+ CC: "AUD",
+ CO: "COP",
+ KM: "KMF",
+ CG: "XAF",
+ CD: "CDF",
+ CK: "NZD",
+ CR: "CRC",
+ CI: "XOF",
+ HR: "EUR",
+ CU: "CUP",
+ CY: "EUR",
+ CZ: "CZK",
+
+ // D
+ DK: "DKK",
+ DJ: "DJF",
+ DM: "XCD",
+ DO: "DOP",
+
+ // E
+ EC: "USD",
+ EG: "EGP",
+ SV: "USD",
+ GQ: "XAF",
+ ER: "ERN",
+ EE: "EUR",
+ ET: "ETB",
+
+ // F
+ FK: "FKP",
+ FO: "DKK",
+ FJ: "FJD",
+ FI: "EUR",
+ FR: "EUR",
+ GF: "EUR",
+ PF: "XPF",
+ TF: "EUR",
+
+ // G
+ GA: "XAF",
+ GM: "GMD",
+ GE: "GEL",
+ DE: "EUR",
+ GH: "GHS",
+ GI: "GIP",
+ GR: "EUR",
+ GL: "DKK",
+ GD: "XCD",
+ GP: "EUR",
+ GU: "USD",
+ GT: "GTQ",
+ GN: "GNF",
+ GW: "XOF",
+ GY: "GYD",
+
+ // H
+ HT: "HTG",
+ HM: "AUD",
+ VA: "EUR",
+ HN: "HNL",
+ HK: "HKD",
+ HU: "HUF",
+
+ // I
+ IS: "ISK",
+ IN: "INR",
+ ID: "IDR",
+ IR: "IRR",
+ IQ: "IQD",
+ IE: "EUR",
+ IL: "ILS",
+ IT: "EUR",
+
+ // J
+ JM: "JMD",
+ JP: "JPY",
+ JO: "JOD",
+
+ // K
+ KZ: "KZT",
+ KE: "KES",
+ KI: "AUD",
+ KP: "KPW",
+ KR: "KRW",
+ KW: "KWD",
+ KG: "KGS",
+
+ // L
+ LA: "LAK",
+ LV: "EUR",
+ LB: "LBP",
+ LS: "LSL",
+ LR: "LRD",
+ LY: "LYD",
+ LI: "CHF",
+ LT: "EUR",
+ LU: "EUR",
+
+ // M
+ MO: "MOP",
+ MG: "MGA",
+ MW: "MWK",
+ MY: "MYR",
+ MV: "MVR",
+ ML: "XOF",
+ MT: "EUR",
+ MH: "USD",
+ MQ: "EUR",
+ MR: "MRU",
+ MU: "MUR",
+ YT: "EUR",
+ MX: "MXN",
+ FM: "USD",
+ MD: "MDL",
+ MC: "EUR",
+ MN: "MNT",
+ MS: "XCD",
+ MA: "MAD",
+ MZ: "MZN",
+ MM: "MMK",
+
+ // N
+ NA: "NAD",
+ NR: "AUD",
+ NP: "NPR",
+ NL: "EUR",
+ NC: "XPF",
+ NZ: "NZD",
+ NI: "NIO",
+ NE: "XOF",
+ NG: "NGN",
+ NU: "NZD",
+ NF: "AUD",
+ MK: "MKD",
+ MP: "USD",
+ NO: "NOK",
+
+ // O
+ OM: "OMR",
+
+ // P
+ PK: "PKR",
+ PW: "USD",
+ PS: "ILS",
+ PA: "PAB",
+ PG: "PGK",
+ PY: "PYG",
+ PE: "PEN",
+ PH: "PHP",
+ PN: "NZD",
+ PL: "PLN",
+ PT: "EUR",
+ PR: "USD",
+
+ // Q
+ QA: "QAR",
+
+ // R
+ RE: "EUR",
+ RO: "RON",
+ RU: "RUB",
+ RW: "RWF",
+
+ // S
+ SH: "SHP",
+ KN: "XCD",
+ LC: "XCD",
+ PM: "EUR",
+ VC: "XCD",
+ WS: "WST",
+ SM: "EUR",
+ ST: "STN",
+ SA: "SAR",
+ SN: "XOF",
+ SC: "SCR",
+ SL: "SLE",
+ SG: "SGD",
+ SK: "EUR",
+ SI: "EUR",
+ SB: "SBD",
+ SO: "SOS",
+ ZA: "ZAR",
+ GS: "GBP",
+ ES: "EUR",
+ LK: "LKR",
+ SD: "SDG",
+ SR: "SRD",
+ SJ: "NOK",
+ SZ: "SZL",
+ SE: "SEK",
+ CH: "CHF",
+ SY: "SYP",
+
+ // T
+ TW: "TWD",
+ TJ: "TJS",
+ TZ: "TZS",
+ TH: "THB",
+ TL: "USD",
+ TG: "XOF",
+ TK: "NZD",
+ TO: "TOP",
+ TT: "TTD",
+ TN: "TND",
+ TR: "TRY",
+ TM: "TMT",
+ TC: "USD",
+ TV: "AUD",
+
+ // U
+ UG: "UGX",
+ UA: "UAH",
+ AE: "AED",
+ GB: "GBP",
+ US: "USD",
+ UM: "USD",
+ UY: "UYU",
+ UZ: "UZS",
+
+ // V
+ VU: "VUV",
+ VE: "VES",
+ VN: "VND",
+ VG: "USD",
+ VI: "USD",
+
+ // W
+ WF: "XPF",
+ EH: "MAD",
+
+ // Y
+ YE: "YER",
+
+ // Z
+ ZM: "ZMW",
+ ZW: "ZWG",
+
+ // Additional territories
+ AX: "EUR",
+ BQ: "USD",
+ CW: "ANG",
+ GG: "GBP",
+ IM: "GBP",
+ JE: "GBP",
+ ME: "EUR",
+ BL: "EUR",
+ MF: "EUR",
+ RS: "RSD",
+ SX: "ANG",
+ SS: "SSP",
+ XK: "EUR",
+};
diff --git a/packages/utils/src/constants/index.ts b/packages/utils/src/constants/index.ts
index 7754a0082e..f426146089 100644
--- a/packages/utils/src/constants/index.ts
+++ b/packages/utils/src/constants/index.ts
@@ -2,6 +2,7 @@ export * from "./cctlds";
export * from "./connect-supported-countries";
export * from "./continents";
export * from "./countries";
+export * from "./country-currency-codes";
export * from "./country-phone-codes";
export * from "./domains";
export * from "./dub-domains";