Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAY-469-updated-types-for-recurring-payments #88

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 17 additions & 29 deletions src/schema/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ export type PaymentActorType = "api-payee" | "mh-user-account"

export type PayerType = "api-payer" | "mh-user-account"

export type PaymentContext =
| "Other"
| "PartyToParty"
| "BillPayment"
export type PaymentContext = "Other" | "PartyToParty" | "BillPayment"

export interface AuthRequestPostPayment {
amount: number
Expand All @@ -25,13 +22,7 @@ export interface AuthRequestPostPayment {
context?: PaymentContext
}

type PeriodType =
| "Day"
| "Week"
| "Fortnight"
| "Month"
| "Half-year"
| "Year"
type PeriodType = "Day" | "Week" | "Fortnight" | "Month" | "Half-year" | "Year"

type PeriodAlignment = "Consent" | "Calendar"

Expand Down Expand Up @@ -88,10 +79,7 @@ type ChargeBearer =
| "FollowingServiceLevel"
| "Shared"

type ChargeType =
| "CHAPSOut"
| "BalanceTransferOut"
| "MoneyTransferOut"
type ChargeType = "CHAPSOut" | "BalanceTransferOut" | "MoneyTransferOut"

interface Charge {
bearer?: ChargeBearer
Expand Down Expand Up @@ -138,15 +126,7 @@ export interface RecurringPaymentSearchParams extends SearchParams {
userId?: string
}

type RecurringPaymentStatus =
| "InProgress"
| "AwaitingAuthorisation"
| "Rejected"
| "Authorised"
| "Revoked"
| "Expired"

interface RecurringPayment {
tomstrat marked this conversation as resolved.
Show resolved Hide resolved
export interface RecurringPayment{
reference: string
validFromDate?: string
validToDate?: string
Expand All @@ -156,10 +136,18 @@ interface RecurringPayment {
type: RecurringPaymentType[]
}

type RecurringPaymentStatus =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i think we only return these statuses: https://openbankinguk.github.io/read-write-api-site3/v3.1.11/resources-and-data-models/vrp/domestic-vrps.html#status

The longer list is if we get the paymentDetails and i am not too sure if we add that to the normal status. I can have a look and return to this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have used the condensed list for now

| "Pending"
| "Rejected"
| "AcceptedSettlementInProcess"
| "AcceptedSettlementCompleted"
| "AcceptedWithoutPosting"
| "AcceptedCreditSettlementCompleted"

export interface RecurringPaymentRequest {
id: string
status?: RecurringPaymentStatus
createdAt: string
updatedAt?: string
recurringPayment?: RecurringPayment
paymentSubmissionId: string
providerStatus: RecurringPaymentStatus
status: PaymentStatus
submittedAt: string
authRequestId: string
}
Loading