Skip to content

Commit

Permalink
18769 - EFT switching logic fix (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-barraza authored Sep 12, 2024
1 parent 8481d30 commit 23b05a7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.6.85",
"version": "2.6.86",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@

<script lang="ts">
import { AccessType, Account, LoginSource, Pages, PaymentTypes, Permission, Role } from '@/util/constants'
import { CreateRequestBody, OrgPaymentDetails, PADInfo, PADInfoValidation } from '@/models/Organization'
import {
CreateRequestBody, Member, MembershipType, OrgPaymentDetails, Organization, PADInfo, PADInfoValidation
} from '@/models/Organization'
import { computed, defineComponent, onMounted, reactive, ref, toRefs, watch } from '@vue/composition-api'
import { BcolProfile } from '@/models/bcol'
import ModalDialog from '@/components/auth/common/ModalDialog.vue'
import PaymentMethods from '@/components/auth/common/PaymentMethods.vue'
import { StatementNotificationSettings } from '@/models/statement'
import { useAccount } from '@/composables/account-factory'
import { useOrgStore } from '@/stores/org'
import { useUserStore } from '@/stores/user'
Expand Down Expand Up @@ -146,7 +149,9 @@ export default defineComponent({
ejvValid: false,
paymentMethodChanged: props.hasPaymentChanged,
isFuturePaymentMethodAvailable: false, // set true if in between 3 days cooling period
isTOSandAcknowledgeCompleted: false // set true if TOS already accepted
isTOSandAcknowledgeCompleted: false, // set true if TOS already accepted
activeOrgMembers: computed<Member[]>(() => orgStore.activeOrgMembers),
currentOrganization: computed<Organization>(() => orgStore.currentOrganization)
})
const errorDialog = ref<InstanceType<typeof ModalDialog>>()
Expand Down Expand Up @@ -331,6 +336,7 @@ export default defineComponent({
state.isLoading = true
const { isValid, createRequestBody } = await getCreateRequestBody()
const selectedPaymentMethod = state.selectedPaymentMethod
if (isValid) {
try {
Expand All @@ -339,7 +345,27 @@ export default defineComponent({
state.isLoading = false
state.paymentMethodChanged = false
initialize()
orgStore.setCurrentOrganizationPaymentType(state.selectedPaymentMethod)
orgStore.setCurrentOrganizationPaymentType(selectedPaymentMethod)
if (selectedPaymentMethod === PaymentTypes.EFT) {
const recipientList = []
await orgStore.syncActiveOrgMembers()
state.activeOrgMembers.forEach((member) => {
if (member.membershipTypeCode !== MembershipType.User) {
recipientList.push({
authUserId: member.user?.id,
firstname: member.user?.firstname,
lastname: member.user?.lastname,
email: member.user?.contacts[0]?.email
})
}
})
const statementNotification: StatementNotificationSettings = {
statementNotificationEnabled: true,
recipients: recipientList,
accountName: state.currentOrganization.name
}
await orgStore.updateStatementNotifications(statementNotification)
}
} catch (error) {
console.error(error)
state.isLoading = false
Expand Down

0 comments on commit 23b05a7

Please sign in to comment.