<?php
require_once('vendor/autoload.php');
include_once './vendor/stripe/stripe-php/lib/Stripe.php';
//secret key
\Stripe\Stripe::setApiKey("APY_key");
$token = $_POST['stripe-token'];
$customer = \Stripe\Customer::create([
"description" => "customer for carsharing",
"source" => $token // obtained with Stripe.js
]);
$customer->sources->create(["source" => "tok_visa"]);
how can save a card with type of card is dynamic??
source -> tok_visa
put every card in visa type.
Comments
Post a Comment