【发布时间】:2014-02-24 22:23:30
【问题描述】:
我有以下代码使用 Stripe 处理用户信用卡上的费用。
// Create the charge on Stripe's servers - this will charge the user's card
try {
$charge = Stripe_Charge::create(array(
"amount" => $grandTotal, // amount in cents, again
"currency" => "usd",
"card" => $token,
"description" => "Candy Kingdom Order")
);
} catch(Stripe_CardError $e) {
// The card has been declined
}
现在我希望能够显示在订单确认页面上使用的卡的最后 4 位数字。但我想以一种不存储完整卡号的方式进行操作。只是最后 4 个。我不确定如何检索此信息,如果可能的话。请帮忙?
【问题讨论】:
-
您不知道如何提取任何数据
-
substr($cardNumber, -4);
标签: php stripe-payments