@springtree/eva-core
Version:
The EVA core typings
152 lines (130 loc) • 3.99 kB
TypeScript
declare module EVA.Payment.UserCard {
/**
* Cancel a pending paymentransaction created with the UserCardPaymentMethod
*/
export interface CancelPendingUserCardPayment {
PaymentTransactionID: number;
}
/**
* Mutate the balance on an UserCard with the given amount.
*/
export interface CreateUserCardMutation {
UserCardID: number;
Amount?: number;
Description?: string;
}
/**
* Create a new UserCard
*
* The type is required, it can optionally be attached to an User.
* When the CurrencyID is not supplied the currency of the current session will be used.
*/
export interface CreateUserCard {
UserID: number;
CurrencyID?: string;
UserCardTypeID: number;
}
export interface CreateUserCardResponse {
ID: number;
Error: EVA.Core.ServiceError;
}
/**
* Get the currenct balance of an UserCard
*/
export interface GetUserCardBalance {
UserCardID: number;
CurrencyID?: string;
}
export interface GetUserCardBalanceResponse {
CurrentBalance: EVA.Core.UserCardBalance;
Error: EVA.Core.ServiceError;
}
/**
* Get the UserCard including the current balance
*/
export interface GetUserCardDetails {
UserCardID: number;
CardNumber?: string;
CurrencyID?: string;
}
export interface GetUserCardDetailsResponse {
UserCard: EVA.Core.UserCardDto;
Error: EVA.Core.ServiceError;
}
/**
* Returns all the UserCard for the current or requested User.
* The currency is used to convert UserCards without a currency to their monetary value. Defaults to the session Currency.
*
* Service was renamed from `ListUserCardsForUser` to `GetUserCardsForUser`
*/
export interface GetUserCardsForUser {
UserID: number;
CurrencyID?: string;
}
export interface GetUserCardsForUserResponse {
UserCards: EVA.Core.UserCardDto[];
Error: EVA.Core.ServiceError;
}
/**
* Returns the available UserCardTypes
*/
export interface GetUserCardTypes {
}
export interface GetUserCardTypesResponse {
Types: EVA.Core.UserCardTypeDto[];
Error: EVA.Core.ServiceError;
}
/**
* List the mutations for a UserCard. Customers can only view the mutations of their own usercards.
*/
export interface ListUserCardMutations {
UserCardID: number;
PageConfig?: EVA.Core.PageConfig;
}
export interface ListUserCardMutationsResponse {
Result: EVA.Core.PagedResult<ListUserCardMutationsDto>;
Error: EVA.Core.ServiceError;
}
export interface ListUserCardMutationsDto {
Amount?: number;
CreationTime?: string;
Description: string;
Status: EVA.Core.UserCardMutationStatuses;
}
/**
* Lists all user cards, with their number, type and linked user (full) name.
* Using the `PageConfig`, you could filter on `Barcode`, `TypeID`, `FullName` and/or `UserName`.
*/
export interface ListUserCards {
PageConfig?: EVA.Core.PageConfig;
}
export interface ListUserCardsResponse {
Result: EVA.Core.PagedResult<ListUserCardDto>;
Error: EVA.Core.ServiceError;
}
export interface ListUserCardDto {
Barcode: string;
ID: number;
Type: EVA.Core.UserCardTypeDto;
UserFullName: string;
}
/**
* Refund an amount from an UserCard
*
* This works by selecting on which paymenttransaction it will be refunded. These PaymentTransactions are returned from the `GetAvailableRefundPaymentMethods` service.
*
* The `RefundPaymentTypeCode` property was removed, because the method is determined based on the selected PaymentTransaction.
*/
export interface RefundAmountFromUserCard {
UserCardID: number;
Amount?: number;
PaymentTransactionID: number;
RefundOptions?: { [key: string]: any };
}
export interface RefundAmountFromUserCardResponse {
ActualRefundedAmount?: number;
RefundStatus: EVA.Core.PaymentStatuses;
Message: EVA.Core.RefundAttemptMessage;
Error: EVA.Core.ServiceError;
}
}