File: //proc/self/root/home/awaldron/_accomods/apidev.accomods.com/v1/order.php
<?php
//**********************************************************************************************************//
// Method: POST
// Endpoint: order/intent
// Params:
function post_v1_order_intent( $args, $body, $uid, $is_admin, $db ) {
// This is your real test secret API key.
\Stripe\Stripe::setApiKey('sk_test_51Ga16AC8Y1Uu9EV3C5CbDeZcJIV9dD50WoSpb8pZhTLanqrhKIPqAssX5p6vES4tyPDEBkfkfOR7HBhbq8GFvnGV00bUmqCcQk');
header('Content-Type: application/json');
try {
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => 3995,
'currency' => 'usd',
]);
$output = [
'clientSecret' => $paymentIntent->client_secret,
];
echo json_encode($output);
} catch (Error $e) {
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}
exit;
}