From 6684fb22bc47359c3ea084d69a0eaf59d117f3b2 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Thu, 7 Apr 2022 09:46:55 -0700 Subject: [PATCH] Codegen for openapi fc5a2b9 --- lib/Checkout/Session.php | 2 +- lib/PaymentIntent.php | 17 +++++++++++++++++ lib/Service/PaymentIntentService.php | 20 ++++++++++++++++++++ lib/Service/Terminal/ReaderService.php | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index c3fbaae373..aa8b34011e 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -64,7 +64,7 @@ * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. * @property \Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. - * @property null|string $url The URL to the Checkout Session. + * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. */ class Session extends \Stripe\ApiResource { diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index bf46ad33a5..c184d2a05a 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -75,6 +75,23 @@ class PaymentIntent extends ApiResource const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; const STATUS_SUCCEEDED = 'succeeded'; + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the applied payment intent + */ + public function applyCustomerBalance($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/apply_customer_balance'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php index f69eaab0ae..8016546576 100644 --- a/lib/Service/PaymentIntentService.php +++ b/lib/Service/PaymentIntentService.php @@ -21,6 +21,26 @@ public function all($params = null, $opts = null) return $this->requestCollection('get', '/v1/payment_intents', $params, $opts); } + /** + * Manually reconcile the remaining amount for a customer_balance PaymentIntent. + * + * This can be used when the cash balance for a + * customer in manual reconciliation mode received funds. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function applyCustomerBalance($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/apply_customer_balance', $id), $params, $opts); + } + /** * A PaymentIntent object can be canceled when it is in one of these statuses: * requires_payment_method, requires_capture, diff --git a/lib/Service/Terminal/ReaderService.php b/lib/Service/Terminal/ReaderService.php index 2a97fa36a6..ae85559504 100644 --- a/lib/Service/Terminal/ReaderService.php +++ b/lib/Service/Terminal/ReaderService.php @@ -117,7 +117,7 @@ public function retrieve($id, $params = null, $opts = null) } /** - * Sets reader display. + * Sets reader display to show cart details. * * @param string $id * @param null|array $params