• Dear Jeremy and colleagues:

    Following our upgrade to Leaky Paywall 4.15.8, we are unable to retrieve the credit card information from Stripe (brand, last4, exp_month, exp_year) on the customer account page.

    Does this feature work on your end? Thank you for any input.

    Here is the code in the Shortcodes.php file:

    $subscriber_id = get_user_meta($user->ID, ‘_issuem_leaky_paywall_’ . $mode . ‘_subscriber_id’ . $site, true);

    $secret_key = (‘test’ === $mode) ? $settings[‘test_secret_key’] : $settings[‘live_secret_key’];

    if ($secret_key) {

    leaky_paywall_initialize_stripe_api();

    $cu = \Stripe\Customer::retrieve(
    [“id” => $subscriber_id]
    );

    if (isset($cu->default_source->brand)) {

    $payment_form .= ‘<p>Method<br>’ . $cu->default_source->brand . ‘ ending in ‘ . $cu->default_source->last4 . ‘ that expires ‘ . $cu->default_source->exp_month . ‘/’ . $cu->default_source->exp_year . ‘</p>’;
    }

    • This topic was modified 4 years, 1 month ago by pjkarlsen.
    • This topic was modified 4 years, 1 month ago by pjkarlsen.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Showing last 4 digits of Stripe credit card’ is closed to new replies.