A PaymentMethod
resource describes which payment method was used to fulfill a payment. It is used with a PaymentIntent
to collect payments.
A PaymentMethod Resource
{
"data": {
"id": "pm_ajeDG2y6WgnrCXaamWFmPUw2",
"type": "payment_method",
"attributes": {
"billing": {
"address": {
"city": "Taguig",
"country": "PH",
"line1": "Unit 3308, High St South Corp Plaza",
"line2": "26th Street & 11th Avenue",
"postal_code": "1634",
"state": "Metro Manila"
},
"email": "[email protected]",
"name": "Juan Dela Cruz",
"phone": "63288881111"
},
"details": {
"last4": "4242",
"exp_month": 1,
"exp_year": 24
},
"livemode": false,
"type": "card",
"metadata": {
"sample": "123"
},
"created_at": 1586097138,
"updated_at": 1586097138
}
}
}
id string
Unique ID of the resource.
type string
Represents the resource type. Value is always payment_method
.
billing dictionary
Attribute | Description |
---|---|
address.city string | City of the billing address information |
address.country string | Country of the billing address information. Possible values are ISO 3166-1 alpha-2 codes or two-letter country codes. . |
address.line1 string | Line1 of the billing address information |
address.line2 string | Line2 of the billing address information |
address.postal_code string | Postal Code of the billing address information |
address.state string | State of the billing address information |
email string | E-mail address of the billing information. |
name string | Name of the billing information. |
phone string | Phone of the billing information. |
details dictionary
The attributes of details
vary based on the type of payment method. The example below is for card
payment method.
Attribute | Description |
---|---|
last4 string | The last 4 digits of the credit card. |
exp_month integer | Expiry month of the credit card. |
exp_year integer | Expiry year of the credit card. |
livemode boolean
The value is true
if the resource exists in live mode or the value is false
if the resource exists in test mode.
attributes.type string
The type of payment method. The possible values are card
and paymaya
for now.
metadata dictionary
A set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the object in a structured format. Only string values are accepted.
created_at timestamp
The timestamp when the payment method has been created.
updated_at timestamp
The timestamp when the payment method has been updated.