#dheeraj_44691

1 messages · Page 1 of 1 (latest)

native cobaltBOT
candid remnant
#

hi! did you have a question?

strong sedge
#

yes

#

I want card token but api is not running

candid remnant
#

what guide are you following to build the code that is generating this error?

strong sedge
#

$stripe = new \Stripe\StripeClient('sk_test_51Ng8nGFHg4FKe0LChiuMqru5GjWZESzJFKvAoZSJw2LTkIfScUnxvt4AaFLL9006IgLtTNv');
$token = $stripe->tokens->create([
'card' => [
'number' => '4242424242424242',
'exp_month' => 8,
'exp_year' => 2024,
'cvc' => '456',]
]);

#

Uncaught (Status 402) (Request req_IrKNvFpyzgBDxe) Sending credit card numbers directly to the Stripe API is generally unsafe. We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing. To enable raw card data APIs in test mode, see https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

candid remnant
#

yep, as the error message says, you are not allowed to pass a raw card number to the API.