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 |
---|---|
| City of the billing address information |
| Country of the billing address information. Possible values are |
| Line1 of the billing address information |
| Line2 of the billing address information |
| Postal Code of the billing address information |
| State of the billing address information |
| E-mail address of the billing information. |
| Name of the billing information. |
| 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 |
---|---|
| The last 4 digits of the credit card. |
| Expiry month of the credit card. |
| 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.