Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
obmagnusson committed Sep 4, 2024
1 parent 1853c4b commit ab5c173
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions libs/api/domains/payment/src/lib/api-domains-payment.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface CallbackResult {
data?: Callback
}

export enum paidStatus {
export enum PaidStatus {
paid = 'paid',
cancelled = 'cancelled',
recreated = 'recreated',
Expand All @@ -37,7 +37,7 @@ export class Callback {
readonly chargeItemSubject!: string

@IsNotEmpty()
@IsEnum(paidStatus)
@ApiProperty({ enum: paidStatus })
readonly status!: paidStatus
@IsEnum(PaidStatus)
@ApiProperty({ enum: PaidStatus })
readonly status!: PaidStatus
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Body, Controller, Param, Post, ParseUUIDPipe } from '@nestjs/common'
import { Callback } from '@island.is/api/domains/payment'
import { PaymentService } from './payment.service'
import { ApplicationService } from '@island.is/application/api/core'
import { ApiCreatedResponse, ApiTags } from '@nestjs/swagger'
import { ApiTags } from '@nestjs/swagger'
import addMonths from 'date-fns/addMonths'

@ApiTags('payment-callback')
@Controller()
Expand Down Expand Up @@ -30,8 +31,7 @@ export class PaymentCallbackController {

const application = await this.applicationService.findOneById(applicationId)
if (application) {
const oneMonthFromNow = new Date()
oneMonthFromNow.setMonth(oneMonthFromNow.getMonth() + 1)
const oneMonthFromNow = addMonths(new Date(), 1)
//Applications payment states are default to be pruned in 24 hours.
//If the application is paid, we want to hold on to it for longer in case we get locked in an error state.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export class ExamplePaymentActionsService extends BaseTemplateApiService {

// Note: after this point, you can be asured that the payment has been made, so you can
// safely do appropriate api calls at this point.
throw new Error('External api call fails here !! oh no...')

return {
success: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const PaymentPending: FC<
<AlertMessage
type="error"
title={msg(coreErrorMessages.paymentSubmitFailed)}
message="Villa hefur komið upp við áframhaldandi vinnslu. Vinsamlegast reynið aftur síðar. Ef villa endurtekur sig vinsamlegast hafið samband við island@island.is."
message={msg(coreErrorMessages.paymentSubmitFailedDescription)}
/>
</Box>
<Box>
Expand Down

0 comments on commit ab5c173

Please sign in to comment.