PaymentMethod - Liquid Object Reference
On this page
Description
The PaymentMethod object is a card, bank account, or digital wallet a customer has saved with a payment provider. See saved payment methods for how customers save them.
current_customer.payment_methods lists the signed-in customer’s saved methods for the current store, with the default first. A method is listed only while the payment provider it is saved with is active.
Backed by
This drop renders the s_c__Payment_Method__c Salesforce object. A theme writes it as payment_method.
Attributes
| Attribute | Type | Description |
|---|---|---|
account_type |
String | Returns the bank account type: checking or savings |
bank_identifier_type |
String | Returns the type of bank routing identifier |
bank_name |
String | Returns the name of the bank |
card_brand |
String | Returns the card brand, such as Visa or Mastercard |
display_name |
String | Returns the nickname if the customer set one. Otherwise returns a label built from the type and details, such as the card brand and last four digits |
expires_at |
String | Returns the expiry date of the saved payment method (ISO 8601), or nil if none is stored |
funding_type |
String | Returns the card funding type: credit, debit, or prepaid |
id |
String | Returns the unique id for this PaymentMethod |
is_default? |
Boolean | Returns true if this is the customer’s default payment method |
last_four |
String | Returns the last four digits of the card or account |
nickname |
String | Returns the nickname the customer set for this payment method |
payment_provider |
PaymentProvider | Returns the PaymentProvider this payment method is saved with |
type |
String | Returns the payment method type: card, bank_account, or digital_wallet |
wallet_type |
String | Returns the digital wallet type: apple_pay, google_pay, or paypal |
Example
List the signed-in customer’s saved payment methods and mark the default:
```liquid
{%- if current_customer %}
-
{%- for method in current_customer.payment_methods %}
- {{ method.display_name }} {%- if method.expires_at %} (expires {{ method.expires_at | date: "%m/%Y" }}){% endif %} {%- if method.is_default? %} Default{% endif %} {%- endfor %}
{%- endif %} ```
Available on
- Contact - Liquid Object Reference —
default_payment_method,payment_methods
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.