Payment
Payment Resource#
export interface PaymentResource { id: string; type: 'payment'; attributes: { access_url?: string; amount: number; balance_transaction_id: string; billing?: Billing; currency: Currency; description?: string; disputed: boolean; external_reference_number?: string;
// On Fail failed_code?: ErrorSubCode; failed_message?: string;
fee: number; foreign_fee: number;
livemode: boolean; net_amount: number; origin: string; payment_intent_id?: string; payout?: number;
source: PaymentSource;
statement_descriptor: string; status: PaymentStatus;
tax_amount?: number;
refunds: any[]; taxes: any[];
available_at: number; created_at: number; paid_at: number; updated_at: number; };}id *
stringtype *
stringPossible value(s):
payment
attributes *
objectaccess_url
stringamount *
numberIn cents (P100 = 10000).
Minimum amount is 10000
balance_transaction_id *
stringbilling
Billingcurrency *
stringPossible value(s):
PHP
description
stringdisputed *
booleanfailed_code
ErrorSubCodefailed_message
stringlivemode *
booleannet_amount *
numberIn cents
P100 = 10000
origin *
stringpayment_intent_id
stringpayout
numberIn cents
P100 = 10000
source *
PaymentSourcestatement_descriptor *
stringstatus
stringPossible value(s):
pending|
paid|
failed
tax_amount
numberIn cents
P100 = 10000
refund *
any[]taxes *
any[]available_at *
numbercreated_at *
numberpaid_at *
numberupdated_at *
numberCreate Payment#
caution
Only works in the when using the secret key
paymongo.payment.create(CreatePaymentParams): PaymentResource#
Example
paymongo.payment.create({ data: { attributes: { amount: 10000, currency: 'PHP', source: { id: 'tok_X925Gje9FzRxfZCiBzNaSCbE', type: 'source' }, }, },});Create Payment Params#
data *
objectattributes *
objectamount *
numberIn cents
P100 = 10000
description
stringcurrenct *
stringPossible value(s):
PHP
statement_descriptor
stringsource *
objectid *
stringtype *
stringPossible value(s):
source
Retrieve Payment#
caution
Only works in the when using the secret key
paymongo.payment.retrieve(RetrievePaymentParams): PaymentResource#
Example
paymongo.payment.retrieve({ id: 'pay_a1nn2DXxeooJ9JqQfj7ytxfe',});Retrieve Payment Params#
id *
stringList Payments#
caution
Only works in the when using the secret key
paymongo.payment.list(ListPaymentParams): PaymentResource[]#
Example
paymongo.payment.list({});List Payment Params#
before
stringa resource ID that defines your place in the list. For example, if you make a request and receive 20 resources, starting with some_resource_id, your subsequent call can include before=some_resource_id in order to fetch the previous page of the list.
after
stringa resource ID that defines your place in the list. For example, if you make a list request and receive 20 resources, ending with some_resource_id, your subsequent call can include after=some_resource_id in order to fetch the next page of the list.
limit
stringLimit of resources to return. Default: 20