• Resolved badscooter1980

    (@badscooter1980)


    Hi,

    Is there any way to grab the last 4 digits and card brand in the view order page?

    It is working just fine in the Woocommerce payment methods section and these cards are setup to be used at checkout but the only result I get for payment method when viewing an order is “Debit/Credit Card”.

    What am I missing? Is there a simple solution to this?

    Many thanks

Viewing 1 replies (of 1 total)
  • Hi @badscooter1980

    I’m afraid that there isn’t a simple solution for that, but if you’re comfortable with coding, you can retrieve them from the Stripe API.

    The Card Object will throw a JSON file with that info, here’s a sample:

    "cvc_check": "pass",
      "dynamic_last4": null,
      "exp_month": 8,
      "exp_year": 2023,
      "fingerprint": "Xt5EWLLDS7FJjR1c",
      "funding": "credit",
      "last4": "4242",
      "metadata": {},
      "name": null,
      "tokenization_method": null

    You can check the Stripe API reference for the Card Object here:

    https://stripe.com/docs/api/cards/object

    On the other hand, if you’re not into coding, I can also recommend the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    My very best,

Viewing 1 replies (of 1 total)
  • The topic ‘Get last 4 digits and card brand – stuck!’ is closed to new replies.