Add Stripe payment intents support and product subscription flag
Introduced functionality for handling Stripe payment intents, including creation, retrieval, and cancellation. Added a subscription_allowed flag to products for enabling subscription-specific operations. Integrated the necessary backend endpoints, object property updates, and route handling logic.
This commit is contained in:
@@ -22,6 +22,7 @@ class productsRoute
|
||||
'name' => (string)$product['name'],
|
||||
'description' => (string)$product['description'],
|
||||
'price' => (int)$product['price'],
|
||||
'subscription_allowed' => (boolean)$product['subscription_allowed'],
|
||||
'category' => (int)$product['category'],
|
||||
'piktogram' => (string)$product['piktogram'],
|
||||
'economic_product_id' => (int)$product['economic_product_id'],
|
||||
@@ -174,6 +175,9 @@ class productsRoute
|
||||
if (self::isParametersSet(['price'])) {
|
||||
$product->price->set($response->getRequestParameter('price'));
|
||||
}
|
||||
if (self::isParametersSet(['subscription_allowed'])) {
|
||||
$product->subscription_allowed->set($response->getRequestParameter('subscription_allowed') ? 1 : 0);
|
||||
}
|
||||
if (self::isParametersSet(['category'])) {
|
||||
$product->category->set($response->getRequestParameter('category') ?? '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user