This commit introduces a comprehensive Stripe module with support for managing customers, products, prices, and payment links. It also includes endpoint routes, helpers, and database updates to support Stripe operations, such as creating and retrieving entities or handling payment workflows. Additionally, a stripe module was integrated into existing routes and objects to enable seamless interaction with Stripe APIs.
38 lines
638 B
PHP
38 lines
638 B
PHP
<?php
|
|
|
|
namespace traits;
|
|
|
|
use classes\stripe;
|
|
use Exception;
|
|
use Stripe\StripeClient;
|
|
|
|
trait stripe_endpoint_t
|
|
{
|
|
/**
|
|
* Stripe
|
|
* @var stripe $stripe
|
|
*/
|
|
protected stripe $stripe;
|
|
|
|
/**
|
|
* Get the Stripe client
|
|
* @return StripeClient
|
|
* @throws Exception
|
|
*/
|
|
public function getClient(): StripeClient
|
|
{
|
|
return $this->Stripe()->getClient();
|
|
}
|
|
|
|
/**
|
|
* Get the stripe class
|
|
* @return stripe
|
|
*/
|
|
public function Stripe(): stripe
|
|
{
|
|
if (!isset($this->stripe)) {
|
|
$this->stripe = new stripe();
|
|
}
|
|
return $this->stripe;
|
|
}
|
|
} |