#gamersor

1 messages · Page 1 of 1 (latest)

fickle auroraBOT
light obsidian
fickle auroraBOT
strange loom
weary flume
#

@strange loom unfortuantely I have no idea what you're asking, you seem to be showing us code that uses Paypal's SDKs and APIs, which we know nothing about on this Discord for Stripe dev, they're entirely different companies and products.

strange loom
#

But I dont understand what code I need to add that I can support stripe

weary flume
#

nobody is going to do the work of re-writing your existing code for you but if you try something specific and have trouble with it we coud clarify things

weary flume
strange loom
# weary flume see the links above, and try them out, download the sample code and projects etc...

Do I need to add this code in to my existing code?

<?php

require_once '../vendor/autoload.php';
require_once '../secrets.php';

\Stripe\Stripe::setApiKey($stripeSecretKey);
header('Content-Type: application/json');

$YOUR_DOMAIN = 'http://localhost:4242';

$checkout_session = \Stripe\Checkout\Session::create([
  'line_items' => [[
    # Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
    'price' => '{{PRICE_ID}}',
    'quantity' => 1,
  ]],
  'mode' => 'payment',
  'success_url' => $YOUR_DOMAIN . '/success.html',
  'cancel_url' => $YOUR_DOMAIN . '/cancel.html',
  'automatic_tax' => [
    'enabled' => true,
  ],
]);

header("HTTP/1.1 303 See Other");
header("Location: " . $checkout_session->url);
#

Where I can find this file?

require_once '../vendor/autoload.php';
require_once '../secrets.php';

weary flume