Payment Intent
#
Payment Intent Resourceexport interface PaymentIntentResource<Metadata = MetadataType> { id: string; type: 'payment_intent'; attributes: { amount: number; currency: Currency; description?: string; statement_descriptor: string; status: PaymentIntentStatus; livemode: boolean; client_key: string; last_payment_error?: LastPaymentError; next_action?: NextAction; payment_method_allowed: ['card']; payments: PaymentResource[]; payment_method_options: PaymentMethodOptions; metadata: Metadata; };}
id *
stringtype *
stringPossible value(s):
payment_intent
attributes *
objectamount *
numbercurrency *
stringPossible value(s):
PHP
description
stringstatment_descriptor *
stringstatus *
stringPossible value(s):
awaiting_payment_method|
awaiting_next_action|
processing|
succeeded
livemode *
booleanclient_key *
stringlast_payment_error
objectpayment
stringfailed_code
PossibleErrorCodesfailed_message
stringfailed_method
stringnext_action
NextActionpayment_method_allowed *
string[]Possible value(s):
card
payments *
PaymentResource[]payment_method_options *
objectcard *
objectrequest_three_d_secure *
stringPossible value(s):
any|
automatic
metadata
MetaData#
Create Payment Intentcaution
Only works in the when using the secret key
CreatePaymentIntentParams): PaymentIntentResource#
paymongo.paymentIntent.create(Example
paymongo.paymentIntent.create({ data: { attributes: { amount: 10000, currency: 'PHP', payment_method_allowed: ['card'], }, },});
#
Create Payment Intent Paramsdata *
objectattributes
objectamount *
numberIn cents (P100 = 10000)
payment_method_allowed *
string[]Possible value(s):
card
curreny *
stringPossible value(s):
PHP
payment_method_options
objectcard
objectrequest_three_d_secure
stringPossible value(s):
any|
automatic
description
stringmetadata
Metadata#
Retrieve Payment IntentRetrievePaymentIntentParams): PaymentIntentResource#
paymongo.paymentIntent.retrieve(Example
paymongo.paymentIntent.retrieve({ client_key: 'pi_1JvFbEiRRnh2fsUE5nJ2F1z7_client_mpe6tJkgaX3pSoiYeSp1AbEU', id: 'pi_1JvFbEiRRnh2fsUE5nJ2F1z7',});
#
Retrieve Payment Intent Paramsid *
stringclient_key
stringRequired when using the public key
#
Attach Payment IntentAttachPaymentIntentParams): PaymentIntentResource#
paymongo.paymentIntent.attach(Example
paymongo.paymentIntent.attach({ id: 'pi_1JvFbEiRRnh2fsUE5nJ2F1z7', data: { attributes: { client_key: 'pi_1JvFbEiRRnh2fsUE5nJ2F1z7_client_mpe6tJkgaX3pSoiYeSp1AbEU', payment_method: 'pm_ajeDG2y6WgnrCXaamWFmPUw2', }, },});
#
Attach Payment Intent Paramsid *
stringID of the payment intent
data *
objectattributes *
objectpayment_method *
stringID of the payment method
client_key
stringRequired when using the public key
return_url
string