forked from Wavyzz/dolibarr
NEW Upgrade Stripe library to 6.43.1
This commit is contained in:
63
htdocs/includes/stripe/stripe-php/lib/Order.php
Normal file
63
htdocs/includes/stripe/stripe-php/lib/Order.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $amount_returned
|
||||
* @property string $application
|
||||
* @property int $application_fee
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $email
|
||||
* @property string $external_coupon_code
|
||||
* @property OrderItem[] $items
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property Collection $returns
|
||||
* @property string $selected_shipping_method
|
||||
* @property mixed $shipping
|
||||
* @property array $shipping_methods
|
||||
* @property string $status
|
||||
* @property mixed $status_transitions
|
||||
* @property int $updated
|
||||
* @property string $upstream_id
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Order extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "order";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @return Order The paid order.
|
||||
*/
|
||||
public function pay($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/pay';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return OrderReturn The newly created return.
|
||||
*/
|
||||
public function returnOrder($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/returns';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
return Util\Util::convertToStripeObject($response, $opts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user