From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- .../stripe-php/lib/Service/CouponService.php | 208 ++++++++++----------- 1 file changed, 104 insertions(+), 104 deletions(-) (limited to 'vendor/stripe/stripe-php/lib/Service/CouponService.php') diff --git a/vendor/stripe/stripe-php/lib/Service/CouponService.php b/vendor/stripe/stripe-php/lib/Service/CouponService.php index 82a880f..d6090da 100644 --- a/vendor/stripe/stripe-php/lib/Service/CouponService.php +++ b/vendor/stripe/stripe-php/lib/Service/CouponService.php @@ -1,104 +1,104 @@ -requestCollection('get', '/v1/coupons', $params, $opts); - } - - /** - * You can create coupons easily via the coupon management page of the - * Stripe dashboard. Coupon creation is also accessible via the API if you need to - * create coupons on the fly. - * - * A coupon has either a percent_off or an amount_off and - * currency. If you set an amount_off, that amount will - * be subtracted from any invoice’s subtotal. For example, an invoice with a - * subtotal of 100 will have a final total of - * 0 if a coupon with an amount_off of - * 200 is applied to it and an invoice with a subtotal of - * 300 will have a final total of 100 if - * a coupon with an amount_off of 200 is applied to - * it. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/coupons', $params, $opts); - } - - /** - * You can delete coupons via the coupon management page of the - * Stripe dashboard. However, deleting a coupon does not affect any customers who - * have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Retrieves the coupon with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Updates the metadata of a coupon. Other coupon details (currency, duration, - * amount_off) are, by design, not editable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/coupons', $params, $opts); + } + + /** + * You can create coupons easily via the coupon management page of the + * Stripe dashboard. Coupon creation is also accessible via the API if you need to + * create coupons on the fly. + * + * A coupon has either a percent_off or an amount_off and + * currency. If you set an amount_off, that amount will + * be subtracted from any invoice’s subtotal. For example, an invoice with a + * subtotal of 100 will have a final total of + * 0 if a coupon with an amount_off of + * 200 is applied to it and an invoice with a subtotal of + * 300 will have a final total of 100 if + * a coupon with an amount_off of 200 is applied to + * it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/coupons', $params, $opts); + } + + /** + * You can delete coupons via the coupon management page of the + * Stripe dashboard. However, deleting a coupon does not affect any customers who + * have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Retrieves the coupon with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a coupon. Other coupon details (currency, duration, + * amount_off) are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } +} -- cgit v1.2.3