react-native-moyasar-sdk
Version:
Official React Native Moyasar SDK - Integrate Credit Cards, Apple Pay, Samsung Pay, and STC Pay with simple interfaces for a seamless payment experience in your React Native app
28 lines (25 loc) • 515 B
text/typescript
export class ApiError {
message?: string;
type?: string;
errors?: { [key: string]: string[] };
private constructor({
message,
type,
errors,
}: {
message?: string;
type?: string;
errors?: { [key: string]: string[] };
}) {
this.message = message;
this.type = type;
this.errors = errors;
}
static fromJson(json: Record<string, any>): ApiError {
return new ApiError({
message: json.message,
type: json.type,
errors: json.errors,
});
}
}