@hachther/mesomb
Version:
JS client for browser to perform mobile payment operation with MeSomb
37 lines (36 loc) • 1.12 kB
TypeScript
import Contribution from './Contribution';
import { CustomerData, TransactionData } from '../types';
/**
* Class representing a transaction response
*
* @property {boolean} success - Indicates if the operation was successful
* @property {string} message - The message of the response
* @property {Contribution} contribution - The contribution
* @property {'SUCCESS' | 'FAILED' | 'PENDING'} status - The status of the transaction
*/
export default class TransactionResponse {
readonly success: boolean;
message: string;
contribution: Contribution;
status: 'SUCCESS' | 'FAILED' | 'PENDING';
constructor(data: {
success: boolean;
message: string;
contribution: Omit<TransactionData, 'customer'> & {
contributor: CustomerData;
};
status: 'SUCCESS' | 'FAILED' | 'PENDING';
});
/**
* Check if the operation is successful
*
* @returns {boolean}
*/
isOperationSuccess(): boolean;
/**
* Check if the contribution is successful
*
* @returns {boolean}
*/
isContributionSuccess(): boolean;
}