Integrate Stripe API using php

Integrate Stripe API using php

Integrate Stripe API using php

If you need to integrate the Stripe API into your PHP project, then follow this tutorial, which can create/edit/update/delete charges, customers, subscriptions, plans, payments, cards, and many more. Just simply follow this step, and you can get your API working.

Step 1)

NOTE* : For this API integration, you need to enable the below modules in your Apache or live server.

  • curl, although you can use your own non-cURL client if you prefer
  • json
  • mbstring (Multibyte String)

Download the library from the official Stripe website and upload this Stripe demo library to your project.

Step 2)

Now make one test.php file to create a customer in Stripe using the API in PHP and include the below code in that file and save the file.

require_once('strip-demo/vendor/autoload.php');
$stripe = new \Stripe\StripeClient(<ENTER STRIPE KEY HERE>);
$customer = $stripe->customers->create('description' => '<CUSTOMER DESCRIPTION>','email' => "<CUSTOMER EMAIL ADDRESS>",'name' => "<CUSTOMER NAME>",
]);
$id=$customer->id;
print_r($customer); //get response from stripe when customer created in stripe
            
    $stripe = new \Stripe\StripeClient(<ENTER STRIPE KEY HERE>);
    $option = array("object" => 'card', "number" => "<CUSTOMER CARD NUMBER>","exp_month" => "CUSTOMER CARD MONTH","exp_year" => "<CUSTOMER CARD YEAR>","cvc" => "<CUSTOMER CARD CVV>");
    $card = $stripe->customers->createSource(
        $id,['source' => $option]);
        print_r($card_id); //get response from stripe when card created in stripe for specific user

    $data = $stripe->charges->create([
               'amount' => "1.00",
               'customer' => $id,
               'currency' => 'usd',
               'description' => 'Total Subscription Charges',
   ]);

print_r($data); //get response from stripe when charges created in stripe for specific user

Step 3)

Finally, run this test.php file in your system; it will send the data to your Stripe. For more API, visit this link: https://stripe.com/docs/api

4 responses

4 thoughts on “Integrate Stripe API using php”

  1. craybet_pbon

    Been playing on Craybet for about six weeks or so and figured I’d share some thoughts since there isn’t much discussion about this place around here. Signed up after seeing an ad and registration was like 90 seconds. Minimum deposit is ten bucks which is normal for US-facing sites. I grabbed a sign-up bonus — 100% up to $500 and 50 free spins on Gates of Olympus. Playthrough requirements were 35x and that is kinda average but I’ve dealt with worse.

    The game library is honestly pretty solid. There’s games from Pragmatic Play, NetEnt, plus Big Time Gaming — meaning Book of Dead, Starburst, the usual heavy hitters. I’d guess maybe 1500-2000 slots when you add it all up. Live dealer stuff is powered by Evolution and it’s smooth — tried baccarat and Crazy Time with real dealers and it worked great.

    One thing that kinda bugged me was payout speed. I used Visa and it took about 48 hours the first time. After that though things sped up. They accept credit cards, e-wallets like Skrill and Neteller, and BTC so that covers most bases. You can look at their current offers at Craybet to see for yourself.

    Using Craybet on mobile was surprisingly good. No dedicated app — the browser version loads fast and all the games load no problem. Played Book of Dead in bed and didn’t notice any problems.

    Support at Craybet is okay — they have live chat that actually connects in under five minutes when I’ve used it. Reached out once about a pending withdrawal and they sorted it within hours. I think they’re Curacao licensed which is standard for platforms like this. Wouldn’t say it’s perfect — the bonus wagering could be lower — but as a daily player it does the job for me.

  2. craybet_ipon

    So I’ve been using Craybet for about two months now and wanted to share my experience since there isn’t much discussion about it around here. I signed up on a whim and signing up literally took two minutes. Min deposit was ten bucks which is pretty standard. I grabbed a sign-up bonus — matched my first deposit 100% up to 500 plus fifty free spins on Gates of Olympus. Wagering was 35x which isn’t amazing but I’ve dealt with worse.

    The game library is bigger than I expected. There’s titles from Pragmatic Play, NetEnt, plus Big Time Gaming — so like Gates of Olympus, Starburst, all the popular ones. I’d guess maybe 1500-2000 slots including table games. Live dealer stuff is powered by Evolution which is quality — tried baccarat and Crazy Time with actual croupiers and it worked great.

    One thing that kinda bugged me was how long cashouts take. Withdrew via Skrill and waited like a day and a half the first time. Once you’re verified though it was faster. They accept credit cards, e-wallets like Skrill and Neteller, and BTC so that covers pretty much everything you’d want. You can check out what they’ve got going on over at CrayBet to see for yourself.

    Mobile experience on Craybet on mobile is actually smooth. There’s no app to download though the mobile site runs well and all the games load without issues. I played some slots in bed and no problems.

    Customer service on Craybet is alright — they have live chat that actually connects pretty quick usually. Had to ask about a pending withdrawal and got it fixed within hours. Licensing is operating under a Curacao license and that’s what most offshore casinos. Wouldn’t say it’s perfect — the bonus wagering could be lower — but overall I’m still using it.

  3. craybet_wnon

    Been using Craybet for roughly two months now and thought I’d throw out some thoughts because there’s not many posts about this place in this forum. I signed up randomly one night and signing up took maybe 90 seconds. Starting deposit was $10 and that’s about what you’d expect. I grabbed a welcome bonus — 100 percent match to $500 plus fifty free spins on Sweet Bonanza. Playthrough requirements were 35x which isn’t amazing but I’ve dealt with worse.

    Their slots catalog is decent honestly. You’ll find titles from Pragmatic Play, Evolution, and Microgaming — so like Book of Dead, Starburst, all the popular ones. Probably close to 2000 games total if you count everything. The live dealer section is powered by Evolution which is legit — played some baccarat and Crazy Time with real dealers and zero lag issues.

    Now the one thing that kinda bugged me was how long cashouts take. Withdrew via Bitcoin and it took about 48 hours the first time. After that though it dropped to like 24 hours. They accept credit cards, Skrill, Neteller, Bitcoin which covers pretty much everything you’d want. I’d look at the full bonus details over at CrayBet to see for yourself.

    Using Craybet on mobile was surprisingly good. I didn’t find a native app though the mobile site loads fast and all the games load no problem. I played some slots on my commute and didn’t notice any performance issues.

    Support at Craybet has been alright — live chat that gets you a person within a few minutes most times. Reached out once about my verification docs and they sorted it pretty quickly. Not sure about operating under a Curacao license and that’s what most US-friendly sites. Wouldn’t say it’s perfect — promo codes seem rare — but overall I’m still using it.

Leave a Reply

Your email address will not be published. Required fields are marked *