Save card details
In order to set up automatic payments, you must create a customer record in Stripe.
First, you must authorize Stripe to store your card details for the purpose of automatic payment.
elseif (empty($stripe_pm)) { ?>
Save card details
Please add the payment details you would like to save.
By adding payment details here, you grant consent for future automatic payments of invoices.
Manage saved payment methods
customers->retrievePaymentMethod(
$stripe_id,
$stripe_pm,
[]
);
} catch (Exception $e) {
$error = $e->getMessage();
error_log("Stripe payment error - encountered exception when fetching payment method info for $stripe_pm: $error");
logApp("Stripe", "error", "Exception when fetching payment method info for $stripe_pm: $error");
}
$card_name = nullable_htmlentities($payment_method->billing_details->name);
$card_brand = nullable_htmlentities($payment_method->card->display_brand);
$card_last4 = nullable_htmlentities($payment_method->card->last4);
$card_expires = nullable_htmlentities($payment_method->card->exp_month) . "/" . nullable_htmlentities($payment_method->card->exp_year);
?>