119 lines
2.1 KiB
TypeScript
119 lines
2.1 KiB
TypeScript
export interface PaymentIntention {
|
|
amount: number;
|
|
currency: string;
|
|
payment_methods: number[];
|
|
items: any[];
|
|
billing_data: BillingData;
|
|
customer: Customer;
|
|
extras: IntentionExtras;
|
|
}
|
|
|
|
interface BillingData {
|
|
apartment: string;
|
|
first_name: string;
|
|
last_name: string;
|
|
street: string;
|
|
building: string;
|
|
phone_number: string;
|
|
country: string;
|
|
email: string;
|
|
floor: string;
|
|
state: string;
|
|
}
|
|
|
|
interface Customer {
|
|
first_name: string;
|
|
last_name: string;
|
|
email: string;
|
|
extras: IntentionExtras;
|
|
}
|
|
|
|
type IntentionExtras = { [key: string]: string | number | undefined };
|
|
|
|
export interface IntentionResult {
|
|
payment_keys: PaymentKeysItem[];
|
|
id: string;
|
|
intention_detail: IntentionDetail;
|
|
client_secret: string;
|
|
payment_methods: PaymentMethodsItem[];
|
|
special_reference: null;
|
|
extras: Extras;
|
|
confirmed: boolean;
|
|
status: string;
|
|
created: string;
|
|
card_detail: null;
|
|
object: string;
|
|
}
|
|
|
|
interface PaymentKeysItem {
|
|
integration: number;
|
|
key: string;
|
|
gateway_type: string;
|
|
iframe_id: null;
|
|
}
|
|
|
|
interface IntentionDetail {
|
|
amount: number;
|
|
items: ItemsItem[];
|
|
currency: string;
|
|
}
|
|
|
|
interface ItemsItem {
|
|
name: string;
|
|
amount: number;
|
|
description: string;
|
|
quantity: number;
|
|
}
|
|
|
|
interface PaymentMethodsItem {
|
|
integration_id: number;
|
|
alias: null;
|
|
name: null;
|
|
method_type: string;
|
|
currency: string;
|
|
live: boolean;
|
|
use_cvc_with_moto: boolean;
|
|
}
|
|
|
|
interface Extras {
|
|
creation_extras: IntentionExtras;
|
|
confirmation_extras: null;
|
|
}
|
|
|
|
export interface TransactionResult {
|
|
paymob_request_id: null;
|
|
intention: IntentionResult;
|
|
hmac: string;
|
|
transaction: Transaction;
|
|
}
|
|
|
|
interface Transaction {
|
|
amount_cents: number;
|
|
created_at: string;
|
|
currency: string;
|
|
error_occured: boolean;
|
|
has_parent_transaction: boolean;
|
|
id: number;
|
|
integration_id: number;
|
|
is_3d_secure: boolean;
|
|
is_auth: boolean;
|
|
is_capture: boolean;
|
|
is_refunded: boolean;
|
|
is_standalone_payment: boolean;
|
|
is_voided: boolean;
|
|
order: Order;
|
|
owner: number;
|
|
pending: boolean;
|
|
source_data: Source_data;
|
|
success: boolean;
|
|
receipt: string;
|
|
}
|
|
interface Order {
|
|
id: number;
|
|
}
|
|
interface Source_data {
|
|
pan: string;
|
|
sub_type: string;
|
|
type: string;
|
|
}
|