#gamersor
1 messages · Page 1 of 1 (latest)
We are unfamiliar with PayPal integration. If you wish to accept payment with Checkout Session (Stripe hosted payment page), you may refer to the guide here: https://stripe.com/docs/checkout/quickstart?lang=php
I dont understand that code ;/
Where I need to add code?
@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.
if you're asking how to integrate Stripe, as mentioned you may refer to the guide here: https://stripe.com/docs/checkout/quickstart?lang=php
Yes i want to support Paypal and Stripe
But I dont understand what code I need to add that I can support stripe
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
see the links above, and try them out, download the sample code and projects etc. Is there a specific part you're stuck on?
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';
I would start by doing a fresh project and getting that basic Stripe integration working so you understand it, and then later think about integrating your existing projects together.