paychangu-js
Version:
Paychangu JavaScript SDK for easy integration of payment services
94 lines (93 loc) • 2.15 kB
TypeScript
export interface Customer {
email: string;
first_name: string;
last_name: string;
}
export interface Customization {
title: string;
description: string;
}
export interface PaychanguConfig {
public_key: string;
tx_ref: string;
amount: number;
currency: string;
callback_url: string;
return_url: string;
customer: Customer;
customization: Customization;
meta?: Record<string, unknown>;
}
export interface LevelConfig {
amount: number;
currency: string;
email: string;
first_name: string;
last_name: string;
callback_url: string;
return_url: string;
tx_ref: string;
customization?: {
title?: string;
description?: string;
};
meta?: Record<string, unknown>;
}
export interface LevelResponse {
message: string;
status: string;
data: {
event: string;
checkout_url: string;
data: {
tx_ref: string;
currency: string;
amount: number;
mode: string;
status: string;
};
};
}
export interface VerificationResponse {
status: string;
message: string;
data: {
event_type: string;
tx_ref: string;
mode: string;
type: string;
status: string;
number_of_attempts: number;
reference: string;
currency: string;
amount: number;
charges: number;
customization: {
title: string;
description: string;
logo: string | null;
};
meta: any;
authorization: {
channel: string;
card_number?: string;
expiry?: string;
brand?: string;
provider?: string;
mobile_number?: string;
completed_at: string;
};
customer: {
email: string;
first_name: string;
last_name: string;
};
logs: Array<{
type: string;
message: string;
created_at: string;
}>;
created_at: string;
updated_at: string;
};
}