Showing last 4 digits of Stripe credit card
-
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>’;
}The page I need help with: [log in to see the link]
- The topic ‘Showing last 4 digits of Stripe credit card’ is closed to new replies.