Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates #1306

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v154
v157
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
require __DIR__ . '/lib/Service/Terminal/ConnectionTokenService.php';
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
require __DIR__ . '/lib/Service/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php';
require __DIR__ . '/lib/Service/TestHelpers/RefundService.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/TestClockService.php';
Expand Down
3 changes: 2 additions & 1 deletion lib/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
* @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
* @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.
* @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
* @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount.
* @property null|int $total_excluding_tax The integer amount in %s representing the total amount of the credit note, excluding tax, but including discounts.
* @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
* @property null|int $voided_at The time that the credit note was voided.
*/
Expand Down
3 changes: 2 additions & 1 deletion lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@
* @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice.
* @property null|string|\Stripe\Quote $quote The quote this invoice was generated from.
* @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice.
* @property null|\Stripe\StripeObject $rendering_options Options for invoice PDF rendering.
* @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance.
* @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement.
* @property null|string $status The status of the invoice, one of <code>draft</code>, <code>open</code>, <code>paid</code>, <code>uncollectible</code>, or <code>void</code>. <a href="https://stripe.com/docs/billing/invoices/workflow#workflow-overview">Learn more</a>
* @property \Stripe\StripeObject $status_transitions
* @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any.
* @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
* @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
* @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
* @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to.
* @property \Stripe\StripeObject $threshold_reason
Expand Down
24 changes: 24 additions & 0 deletions lib/Service/TestHelpers/CustomerService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\TestHelpers;

class CustomerService extends \Stripe\Service\AbstractService
{
/**
* Create an incoming testmode bank transfer.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
*/
public function fundCashBalance($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/customers/%s/fund_cash_balance', $id), $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/TestHelpers/TestHelpersServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Service factory class for API resources in the TestHelpers namespace.
*
* @property CustomerService $customers
* @property RefundService $refunds
* @property Terminal\TerminalServiceFactory $terminal
* @property TestClockService $testClocks
Expand All @@ -18,6 +19,7 @@ class TestHelpersServiceFactory extends \Stripe\Service\AbstractServiceFactory
* @var array<string, string>
*/
private static $classMap = [
'customers' => CustomerService::class,
'refunds' => RefundService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
'testClocks' => TestClockService::class,
Expand Down
2 changes: 1 addition & 1 deletion lib/Treasury/CreditReversal.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @property int $amount Amount (in cents) transferred.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property string $financial_account The FinancialAccount to reverse funds from.
* @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property string $network The rails used to reverse the funds.
Expand Down
2 changes: 1 addition & 1 deletion lib/Treasury/DebitReversal.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @property int $amount Amount (in cents) transferred.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property null|string $financial_account The FinancialAccount to reverse funds from.
* @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|\Stripe\StripeObject $linked_flows Other flows linked to a DebitReversal.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Expand Down
6 changes: 4 additions & 2 deletions lib/Treasury/InboundTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
namespace Stripe\Treasury;

/**
* Use InboundTransfers to add funds to your <a
* Use <a
* href="https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers">InboundTransfers</a>
* to add funds to your <a
* href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> via a
* PaymentMethod that is owned by you. The funds will be transferred via an ACH
* debit.
Expand All @@ -19,7 +21,7 @@
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|\Stripe\StripeObject $failure_details Details about this InboundTransfer's failure. Only set when status is <code>failed</code>.
* @property string $financial_account The FinancialAccount that received the funds.
* @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property \Stripe\StripeObject $linked_flows
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Expand Down
4 changes: 2 additions & 2 deletions lib/Treasury/OutboundPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* @property bool $cancelable Returns <code>true</code> if the object can be canceled, and <code>false</code> otherwise.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property null|string $customer ID of the customer to whom an OutboundPayment is sent.
* @property null|string $customer ID of the <a href="https://stripe.com/docs/api/customers">customer</a> to whom an OutboundPayment is sent.
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string $destination_payment_method The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using <code>destination_payment_method_data</code>.
* @property null|\Stripe\StripeObject $destination_payment_method_details Details about the PaymentMethod for an OutboundPayment.
* @property null|\Stripe\StripeObject $end_user_details Details about the end user.
* @property int $expected_arrival_date The date when funds are expected to arrive in the destination account.
* @property string $financial_account The FinancialAccount that funds were pulled from.
* @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundPayment. Only set when the status is <code>returned</code>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Treasury/OutboundTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @property \Stripe\StripeObject $destination_payment_method_details
* @property int $expected_arrival_date The date when funds are expected to arrive in the destination account.
* @property string $financial_account The FinancialAccount that funds were pulled from.
* @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundTransfer. Only set when the status is <code>returned</code>.
Expand Down
13 changes: 13 additions & 0 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,19 @@ public function testUpdateCashBalance()
static::assertInstanceOf(\Stripe\CashBalance::class, $result);
}

public function testFundCashBalanceCustomer()
{
$this->expectsRequest(
'post',
'/v1/test_helpers/customers/cus_123/fund_cash_balance'
);
$result = $this->client->testHelpers->customers->fundCashBalance(
'cus_123',
['amount' => 30, 'currency' => 'eur']
);
static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result);
}

public function testListCustomer()
{
$this->expectsRequest('get', '/v1/customers');
Expand Down