使用php api从条纹对象中获取16位数的卡号?

时间:2018-03-15 08:55:02

标签: php stripe-payments

我希望在付款成功后从条纹对象存储16位数的卡号,并在下次付款后使用它。用户可以轻松选择卡号并要求cvc等...例如facebook支付系统。只是我想存储16位数代码而不是$card对象中的最后4位代码。这是获取最后4位数的对象。当我print_r($customer);它没有显示16个数字时。它只显示最后4个数字数组。

$card = $customer->sources->data[0];
$Stripe_card=$card->last4;

1 个答案:

答案 0 :(得分:1)

你做不到。该网站不提供有关该卡的所有信息,因为它是不必要的并且构成了诈骗的威胁。在API文档中,我们将找到共享信息的示例。

"source": {
"id": "card_1BLoXK2eZvKYlo2CUZoDPXh1",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_BjH5X2utr6sBXS",
"cvc_check": null,
"dynamic_last4": null,
"exp_month": 8,
"exp_year": 2019,
"fingerprint": "Xt5EWLLDS7FJjR1c",
"funding": "credit",
"last4": "4242",
"metadata": {
},
"name": null,
"tokenization_method": null
},