File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1- import { Authorization } from "../types/authorization"
1+ import { Authorization , AuthorizationStatus } from "../types/authorization"
22import { Meta , UnitConfig , UnitResponse } from "../types/common"
33import { BaseResource } from "./baseResource"
44
@@ -28,7 +28,8 @@ export class Authorizations extends BaseResource {
2828 ...( params ?. includeNonAuthorized && { "filter[includeNonAuthorized]" : params . includeNonAuthorized } ) ,
2929 ...( params ?. sort && { "sort" : params . sort } ) ,
3030 ...( params ?. toAmount && { "filter[toAmount]" : params . toAmount } ) ,
31- ...( params ?. fromAmount && { "filter[fromAmount]" : params . fromAmount } )
31+ ...( params ?. fromAmount && { "filter[fromAmount]" : params . fromAmount } ) ,
32+ ...( params ?. status && { "filter[status]" : params . status } )
3233 }
3334
3435 if ( params ?. merchantCategoryCode )
@@ -89,7 +90,7 @@ export interface AuthorizationQueryParams {
8990 /**
9091 * Optional. Filter authorizations by (Authorization Status)[https://docs.unit.co/cards-authorizations/#authorization-statuses].
9192 */
92- status ?: string [ ]
93+ status ?: AuthorizationStatus
9394
9495 /**
9596 * Optional. Leave empty or provide sort=createdAt for ascending order. Provide sort=-createdAt (leading minus sign) for descending order.
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const authorizationIds: string[] = []
77
88describe ( "Authorization Find" , ( ) => {
99 test ( "Get Authorization List" , async ( ) => {
10- const res = await unit . authorizations . find ( { limit : 10 } )
10+ const res = await unit . authorizations . find ( { limit : 10 , status : "Authorized" } )
1111 res . data . forEach ( element => { 0
1212 expect ( element . type === "authorization" ) . toBeTruthy ( )
1313 authorizationIds . push ( element . id )
Original file line number Diff line number Diff line change 11import { Relationship } from "./common"
22
3+ export type AuthorizationStatus = "Authorized" | "Completed" | "Canceled" | "Declined"
4+
35export interface Authorization {
46 /**
57 * Identifier of the authorization resource.
You can’t perform that action at this time.
0 commit comments