#eztaxi-paymentinfo
1 messages · Page 1 of 1 (latest)
can you share a bit more on how you are integrating with Stripe now?
Are you using plugins, or you are directly integrating with Stripe using Stripe Checkout or Stripe Element?
Hi thank you for quick reply, I'm using PHP using 'create-stripe-session.php'
`<?php
require 'vendor/autoload.php';
\Stripe\Stripe::setApiKey('sk_test_');
header('Content-Type: application/json');
$YOUR_DOMAIN = 'https://myezadmin.com/tickets/public';
$price_id = $_POST['price_id'];
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
# TODO: replace this with the price of the product you want to sell
'price' => $price_id,
'adjustable_quantity' => [
'enabled' => true,
'minimum' => 1,
'maximum' => 10,
],
'quantity' => 1,
]],
'payment_method_types' => [
'card',
],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/success.php?orderid='.$checkout_session,
'cancel_url' => $YOUR_DOMAIN . '/cancel.html',
]);
header("HTTP/1.1 303 See Other");
header("Location: " . $checkout_session->url);`
I need to generate a unique ticket number based on order amount, quantity and receipt number
any idea?
Let me check.
there are several ways
- the recommended way: listen to
checkout.session.completedwebhook event you can take a look at how to build a webhook https://stripe.com/docs/webhooks/build
basically Stripe will send a callback to you when the checkout session successfully completed
you create a webhook handler, listen to the callback event which contains the checkout session, can you can get all the information there which could be used for generate a unique ticket number