diff --git a/strr-base-web/app/components/connect/fee/Widget.vue b/strr-base-web/app/components/connect/fee/Widget.vue
index e0e0df3e..153c54f8 100644
--- a/strr-base-web/app/components/connect/fee/Widget.vue
+++ b/strr-base-web/app/components/connect/fee/Widget.vue
@@ -10,7 +10,11 @@ const {
totalPriorityFees,
totalProcessingFees,
totalGst,
- totalPst
+ totalPst,
+ userSelectedPaymentMethod,
+ allowedPaymentMethods,
+ userPaymentAccount,
+ allowAlternatePaymentMethod
} = storeToRefs(useConnectFeeStore())
const isPlaceholderActive = ref(false)
@@ -46,7 +50,7 @@ const getItemFee = (feeItem: ConnectFeeItem) => {
return '$ -'
}
if (feeItem.waived) {
- return t('feeSummary.noFee')
+ return t('ConnectFeeWidget.feeSummary.noFee')
}
return `$${(feeItem.filingFees * (feeItem.quantity || 1)).toFixed(2)}`
}
@@ -62,8 +66,8 @@ const getItemFee = (feeItem: ConnectFeeItem) => {
:role="isFoldable ? 'button' : 'title'"
class="flex w-full bg-midnightBlue-900 py-2 pl-4 text-lg font-bold transition-all"
:class="[folded ? 'rounded' : 'rounded-b-none rounded-t', isFoldable ? '' : 'pointer-events-none']"
- :aria-label="$t('feeSummary.title')"
- :label="$t('feeSummary.title')"
+ :aria-label="$t('ConnectFeeWidget.feeSummary.title')"
+ :label="$t('ConnectFeeWidget.feeSummary.title')"
@click="toggleFolded"
>
@@ -76,72 +80,114 @@ const getItemFee = (feeItem: ConnectFeeItem) => {
-
-
-
-
- {{ $t(`feeSummary.itemLabels.${feeItem.filingTypeCode}`) }}
+
+
+
+
+
+
+ {{ $t(`ConnectFeeWidget.feeSummary.itemLabels.${feeItem.filingTypeCode}`) }}
+
+
+ x {{ feeItem.quantity }} {{ feeItem.quantityDesc }}
+
+
+
{{ getItemFee(feeItem) }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t("ConnectFeeWidget.feeSummary.total") }}
-
- x {{ feeItem.quantity }} {{ feeItem.quantityDesc }}
+
+ {{ $t("currency.cad") }}
+
+ {{ !isPlaceholderActive ? `$${total.toFixed(2)}` : '$ -' }}
+
-
{{ getItemFee(feeItem) }}
-
-
-
-
-
-
-
-
-
- {{ $t("feeSummary.total") }}
-
-
- {{ $t("currency.cad") }}
-
- {{ !isPlaceholderActive ? `$${total.toFixed(2)}` : '$ -' }}
-
-
+
+
+
-
+
diff --git a/strr-base-web/app/composables/useStrrBasePermit.ts b/strr-base-web/app/composables/useStrrBasePermit.ts
index dad59c4c..d878d528 100644
--- a/strr-base-web/app/composables/useStrrBasePermit.ts
+++ b/strr-base-web/app/composables/useStrrBasePermit.ts
@@ -50,6 +50,7 @@ export const useStrrBasePermit =
(application.value?.header.applicationNumber as string)
if (application.value?.header.registrationId) {
// Get linked registration if applicable
registration.value = await getAccountRegistrations(
diff --git a/strr-base-web/app/enums/connect-payment-method.ts b/strr-base-web/app/enums/connect-payment-method.ts
new file mode 100644
index 00000000..4bf58251
--- /dev/null
+++ b/strr-base-web/app/enums/connect-payment-method.ts
@@ -0,0 +1,6 @@
+export enum ConnectPaymentMethod {
+ DIRECT_PAY = 'DIRECT_PAY',
+ PAD = 'PAD',
+ BCOL = 'BCOL',
+ JV = 'JV'
+}
diff --git a/strr-base-web/app/interfaces/connect-pay-account.ts b/strr-base-web/app/interfaces/connect-pay-account.ts
new file mode 100644
index 00000000..fe9bfda1
--- /dev/null
+++ b/strr-base-web/app/interfaces/connect-pay-account.ts
@@ -0,0 +1,23 @@
+import type { ConnectPaymentMethod } from '~/enums/connect-payment-method'
+
+export interface ConnectPayAccount {
+ accountId: string
+ accountName: string
+ billable: boolean
+ cfsAccount: {
+ bankAccountNumber: string
+ bankInstitutionNumber: string
+ bankTransitNumber: string
+ cfsAccountNumber: string
+ cfsPartyNumber: string
+ cfsSiteNumber: string
+ paymentMethod: ConnectPaymentMethod
+ status: string // enum ??
+ }
+ credit: number
+ id: number
+ padTosAcceptedBy: string
+ padTosAcceptedDate: string
+ paymentMethod: ConnectPaymentMethod
+ version: number
+}
diff --git a/strr-base-web/app/interfaces/strr-api.ts b/strr-base-web/app/interfaces/strr-api.ts
index aef15d4f..78b2cbd8 100644
--- a/strr-base-web/app/interfaces/strr-api.ts
+++ b/strr-base-web/app/interfaces/strr-api.ts
@@ -43,6 +43,9 @@ export interface ApiBusinessDetails {
}
export interface ApiBaseRegistration {
+ header?: {
+ paymentMethod: ConnectPaymentMethod
+ }
registrationType: ApplicationType
businessDetails: ApiBusinessDetails
}
diff --git a/strr-base-web/app/locales/en-CA.ts b/strr-base-web/app/locales/en-CA.ts
index 0ce3d863..68ff972f 100644
--- a/strr-base-web/app/locales/en-CA.ts
+++ b/strr-base-web/app/locales/en-CA.ts
@@ -387,19 +387,6 @@ export default {
BCEID: ''
}
},
- feeSummary: {
- title: 'Fee Summary',
- total: 'Total Fees',
- noFee: 'No Fee',
- priorityFees: 'Priority Fees',
- futureEffectiveFees: 'Future Effective Fees',
- serviceFees: 'Service Fee',
- itemLabels: {
- PLACEHOLDER: 'Placeholder (Replace Me)', // each project using the connect fee widget should change the placeholder filingTypeCode
- TEST: 'This is test entry',
- undefined: 'Item Fee'
- }
- },
validation: {
required: 'Required',
address: {
@@ -521,5 +508,34 @@ export default {
content: 'An unknown error occured, please refresh the page or try again later.'
}
}
+ },
+ ConnectFeeWidget: {
+ feeSummary: {
+ title: 'Fee Summary',
+ total: 'Total Fees',
+ noFee: 'No Fee',
+ priorityFees: 'Priority Fees',
+ futureEffectiveFees: 'Future Effective Fees',
+ serviceFees: 'Service Fee',
+ itemLabels: {
+ PLACEHOLDER: 'Placeholder (Replace Me)', // each project using the connect fee widget should change the placeholder filingTypeCode
+ TEST: 'This is test entry',
+ undefined: 'Item Fee'
+ }
+ },
+ paymentMethod: {
+ DIRECT_PAY: 'Credit Card',
+ PAD: 'Pre-authorized Debit (PAD) {account}',
+ BCOL: 'Online Banking',
+ JV: 'Journal Voucher',
+ undefined: 'Default'
+ },
+ payingWith: {
+ DIRECT_PAY: 'Paying with Credit Card',
+ PAD: 'Paying with Pre-authorized Debit (PAD) {account}',
+ BCOL: 'Paying with Online Banking',
+ JV: 'Paying with Journal Voucher',
+ undefined: 'Paying with default method'
+ }
}
}
diff --git a/strr-base-web/app/stores/connectFee.ts b/strr-base-web/app/stores/connectFee.ts
index 37118e70..e7eb4833 100644
--- a/strr-base-web/app/stores/connectFee.ts
+++ b/strr-base-web/app/stores/connectFee.ts
@@ -1,5 +1,8 @@
+import { ConnectPaymentMethod } from '~/enums/connect-payment-method'
+
export const useConnectFeeStore = defineStore('connect/fee', () => {
const { $payApi } = useNuxtApp()
+ const { t } = useI18n()
const feeOptions = ref({
showFutureEffectiveFees: false,
@@ -112,6 +115,45 @@ export const useConnectFeeStore = defineStore('connect/fee', () => {
placeholderFeeItem.value.serviceFees = fees
}
+ // alternate payment option stuff
+ const userPaymentAccount = ref({} as ConnectPayAccount)
+ const userSelectedPaymentMethod = ref(ConnectPaymentMethod.DIRECT_PAY)
+ const allowAlternatePaymentMethod = ref(false)
+ const allowedPaymentMethods = ref<{ label: string, value: ConnectPaymentMethod }[]>([])
+
+ const initAlternatePaymentMethod = async () => {
+ const accountId = useConnectAccountStore().currentAccount.id
+ try {
+ // get payment account
+ const res = await $payApi(`/accounts/${accountId}`)
+ userPaymentAccount.value = res
+ userSelectedPaymentMethod.value = res.paymentMethod
+
+ // add options to allowedPaymentMethods
+ const defaultMethod = userPaymentAccount.value.paymentMethod
+ if (defaultMethod !== undefined) {
+ const accountNum = userPaymentAccount.value.cfsAccount?.bankAccountNumber ?? ''
+ allowedPaymentMethods.value.push({
+ label: t(`ConnectFeeWidget.paymentMethod.${defaultMethod}`, { account: accountNum }),
+ value: defaultMethod
+ })
+
+ // only add direct pay if not default option
+ if (defaultMethod !== ConnectPaymentMethod.DIRECT_PAY) {
+ allowedPaymentMethods.value.push({
+ label: t(`ConnectFeeWidget.paymentMethod.${ConnectPaymentMethod.DIRECT_PAY}`),
+ value: ConnectPaymentMethod.DIRECT_PAY
+ })
+ }
+ }
+
+ // only set allowed flag to true if previous steps didnt cause an error
+ allowAlternatePaymentMethod.value = true
+ } catch (e) {
+ logFetchError(e, 'Error initializing user payment account')
+ }
+ }
+
return {
feeOptions,
fees,
@@ -128,6 +170,11 @@ export const useConnectFeeStore = defineStore('connect/fee', () => {
removeFee,
setFeeQuantity,
setPlaceholderFilingTypeCode,
- setPlaceholderServiceFee
+ setPlaceholderServiceFee,
+ initAlternatePaymentMethod,
+ userPaymentAccount,
+ userSelectedPaymentMethod,
+ allowedPaymentMethods,
+ allowAlternatePaymentMethod
}
})
diff --git a/strr-host-pm-web/app/locales/en-CA.ts b/strr-host-pm-web/app/locales/en-CA.ts
index 549dd614..fd51d800 100644
--- a/strr-host-pm-web/app/locales/en-CA.ts
+++ b/strr-host-pm-web/app/locales/en-CA.ts
@@ -28,12 +28,6 @@ export default {
authorization: 'I, {boldStart}{name}{boldEnd}, have relevant knowledge of and am authorized to submit this registration.',
tac: 'Terms and Conditions.'
},
- feeSummary: {
- itemLabels: {
- HOSTREG_1: 'STR Application Fee',
- HOSTREG_2: 'STR Application Fee'
- }
- },
form: {
pr: {
declaration: {
@@ -467,5 +461,13 @@ export default {
},
tooltip: {
pid: 'You can find your Parcel Identifier (PID) on your Property Assessment Notice from BC Assessment. Alternatively, visit the BC Assessment website, search for your civic address, and look for the PID under ‘Legal Description and Parcel ID’.'
+ },
+ ConnectFeeWidget: {
+ feeSummary: {
+ itemLabels: {
+ HOSTREG_1: 'STR Application Fee',
+ HOSTREG_2: 'STR Application Fee'
+ }
+ }
}
}
diff --git a/strr-host-pm-web/app/stores/hostApplication.ts b/strr-host-pm-web/app/stores/hostApplication.ts
index ea61439e..1f634d59 100644
--- a/strr-host-pm-web/app/stores/hostApplication.ts
+++ b/strr-host-pm-web/app/stores/hostApplication.ts
@@ -59,7 +59,7 @@ export const useHostApplicationStore = defineStore('host/application', () => {
const submitApplication = async () => {
const body = createApplicationBody()
- console.info('submitting application: ', body)
+ // console.info('submitting application: ', body)
const res = await postApplication(body) as HostApplicationResp
diff --git a/strr-host-pm-web/package.json b/strr-host-pm-web/package.json
index da6fe0ea..c8b92867 100644
--- a/strr-host-pm-web/package.json
+++ b/strr-host-pm-web/package.json
@@ -2,7 +2,7 @@
"name": "strr-host-pm-web",
"private": true,
"type": "module",
- "version": "0.0.17",
+ "version": "0.0.18",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
diff --git a/strr-platform-web/app/locales/en-CA.ts b/strr-platform-web/app/locales/en-CA.ts
index 54d71845..9172c894 100644
--- a/strr-platform-web/app/locales/en-CA.ts
+++ b/strr-platform-web/app/locales/en-CA.ts
@@ -3,13 +3,6 @@ export default {
act: {
fippa: 'Freedom of Information and Protection of Privacy Act'
},
- feeSummary: {
- itemLabels: {
- PLATREG_SM: 'Platform Application Fee',
- PLATREG_LG: 'Platform Application Fee',
- PLATREG_WV: 'Platform Application Fee'
- }
- },
modal: {
info: {
collectionNotice: {
@@ -134,5 +127,14 @@ export default {
},
btn: {
learnMore: 'Learn More'
+ },
+ ConnectFeeWidget: {
+ feeSummary: {
+ itemLabels: {
+ PLATREG_SM: 'Platform Application Fee',
+ PLATREG_LG: 'Platform Application Fee',
+ PLATREG_WV: 'Platform Application Fee'
+ }
+ }
}
}
diff --git a/strr-platform-web/app/pages/platform/application.vue b/strr-platform-web/app/pages/platform/application.vue
index 0bd4a21e..a9488cfc 100644
--- a/strr-platform-web/app/pages/platform/application.vue
+++ b/strr-platform-web/app/pages/platform/application.vue
@@ -4,6 +4,7 @@ import { ConnectStepper, FormPlatformReviewConfirm } from '#components'
const { t } = useI18n()
const localePath = useLocalePath()
const strrModal = useStrrModals()
+const { handlePaymentRedirect } = useConnectNav()
const { validateContact } = useStrrContactStore()
const { validatePlatformBusiness } = useStrrPlatformBusiness()
@@ -19,7 +20,8 @@ const {
getFee,
removeFee,
setPlaceholderFilingTypeCode,
- setPlaceholderServiceFee
+ setPlaceholderServiceFee,
+ initAlternatePaymentMethod,
} = useConnectFeeStore()
setPlaceholderFilingTypeCode(StrrFeeCode.STR_PLAT_SM)
@@ -28,6 +30,8 @@ const platFeeSm = ref(undefined)
const platFeeLg = ref(undefined)
const platFeeWv = ref(undefined)
onMounted(async () => {
+ await initAlternatePaymentMethod()
+
applicationReset()
const [smallFeeResp, largeFeeResp, waivedFeeResp] = await Promise.all([
getFee(StrrFeeEntityType.STRR, StrrFeeCode.STR_PLAT_SM),
@@ -160,9 +164,12 @@ const handlePlatformSubmit = async () => {
// if all steps valid, submit form with store function
if (isApplicationValid) {
- const response = await submitPlatformApplication()
- if (response) {
- return navigateTo(localePath('/platform/dashboard'))
+ const { paymentToken, applicationStatus } = await submitPlatformApplication()
+ const redirectPath = '/platform/dashboard'
+ if (applicationStatus === ApplicationStatus.PAYMENT_DUE) {
+ handlePaymentRedirect(paymentToken, redirectPath)
+ } else {
+ await navigateTo(localePath(redirectPath))
}
} else {
stepperRef.value?.buttonRefs[activeStepIndex.value]?.focus() // move focus to stepper on form validation errors
diff --git a/strr-platform-web/app/stores/platformApplication.ts b/strr-platform-web/app/stores/platformApplication.ts
index f3a5cc68..546cf6a4 100644
--- a/strr-platform-web/app/stores/platformApplication.ts
+++ b/strr-platform-web/app/stores/platformApplication.ts
@@ -33,6 +33,9 @@ export const useStrrPlatformApplication = defineStore('strr/platformApplication'
const createApplicationBody = (): PlatformApplicationPayload => {
const applicationBody: PlatformApplicationPayload = {
+ header: {
+ paymentMethod: useConnectFeeStore().userSelectedPaymentMethod
+ },
registration: {
registrationType: ApplicationType.PLATFORM,
completingParty: formatParty(platContactStore.completingParty),
@@ -61,8 +64,13 @@ export const useStrrPlatformApplication = defineStore('strr/platformApplication'
const body = createApplicationBody()
// console.info('submitting application: ', body)
+ const res = await postApplication(body)
- return await postApplication(body)
+ const paymentToken = res.header.paymentToken
+ const filingId = res.header.applicationNumber
+ const applicationStatus = res.header.status
+
+ return { paymentToken, filingId, applicationStatus }
}
const $reset = () => {
diff --git a/strr-platform-web/app/utils/account-change.ts b/strr-platform-web/app/utils/account-change.ts
index 51acfd48..2947816c 100644
--- a/strr-platform-web/app/utils/account-change.ts
+++ b/strr-platform-web/app/utils/account-change.ts
@@ -1,12 +1,12 @@
// warning modal to prevent account change
-export function manageAccountChangeApplication (oldAccount: Account, newAccount: Account) {
+export function manageAccountChangeApplication (_oldAccount: Account, newAccount: Account) {
const strrModal = useStrrModals()
strrModal.openConfirmSwitchAccountModal(newAccount.id)
return false // return false to abort account change
}
// change accounts and send user to reg dashboard
-export function manageAccountChangeDashboard (oldAccount: Account, newAccount: Account) {
+export function manageAccountChangeDashboard (_oldAccount: Account, newAccount: Account) {
useConnectAccountStore().switchCurrentAccount(newAccount.id)
const { handleExternalRedirect } = useConnectNav()
handleExternalRedirect(useRuntimeConfig().public.registryHomeURL + 'dashboard')
diff --git a/strr-platform-web/package.json b/strr-platform-web/package.json
index 44e3c426..1df6a6f2 100644
--- a/strr-platform-web/package.json
+++ b/strr-platform-web/package.json
@@ -2,7 +2,7 @@
"name": "strr-platform-web",
"private": true,
"type": "module",
- "version": "0.0.30",
+ "version": "0.0.31",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
diff --git a/strr-strata-web/app/locales/en-CA.ts b/strr-strata-web/app/locales/en-CA.ts
index de096e7e..d77a38cf 100644
--- a/strr-strata-web/app/locales/en-CA.ts
+++ b/strr-strata-web/app/locales/en-CA.ts
@@ -5,11 +5,6 @@ export default {
strataApplication: 'STR Strata-Titled Hotel or Motel Application'
}
},
- feeSummary: {
- itemLabels: {
- STRATAREG: 'Strata Hotel Application Fee'
- }
- },
strr: {
step: {
stepperLabel: 'Strata Hotel Application Step Navigation',
@@ -160,5 +155,12 @@ export default {
1: '{terms} I agree to comply with the {link} of registration.',
2: '{boldStart}Accuracy of Information.{boldEnd} I confirm that the information contained in the application for registration is accurate and true. I understand that if I have knowingly provided inaccurate or false information, I may be subject to enforcement action under Part 4 of the {italicStart}Short-term Rental Accommodations Act{italicEnd}.',
checkbox: 'I confirm that I understand and agree to the above.'
+ },
+ ConnectFeeWidget: {
+ feeSummary: {
+ itemLabels: {
+ STRATAREG: 'Strata Hotel Application Fee'
+ }
+ }
}
}
diff --git a/strr-strata-web/package.json b/strr-strata-web/package.json
index eaadc61c..0b9d70e3 100644
--- a/strr-strata-web/package.json
+++ b/strr-strata-web/package.json
@@ -2,7 +2,7 @@
"name": "strr-strata-web",
"private": true,
"type": "module",
- "version": "0.0.27",
+ "version": "0.0.28",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",