Skip to content

Commit

Permalink
Codegen for openapi v155
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stripe committed Jun 15, 2022
1 parent e56fc31 commit 18cfb16
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v154
v155
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
19 changes: 19 additions & 0 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ public function deleteDiscount($params = null, $opts = null)
return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FundingInstructions> list of CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions
*/
public static function allFundingInstructions($id, $params = null, $opts = null)
{
$url = static::resourceUrl($id) . '/funding_instructions';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
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
16 changes: 16 additions & 0 deletions lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ public function allBalanceTransactions($parentId, $params = null, $opts = null)
return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts);
}

/**
* Retrieve all applicable funding instructions for a customer cash balance.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Customer>
*/
public function allFundingInstructions($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/funding_instructions', $id), $params, $opts);
}

/**
* Returns a list of PaymentMethods for a given Customer.
*
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
8 changes: 8 additions & 0 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,14 @@ public function testUpdateCashBalance()
static::assertInstanceOf(\Stripe\CashBalance::class, $result);
}

public function testListFundingInstructionsCustomer()
{
$this->expectsRequest('get', '/v1/customers/cus_123/funding_instructions');
$result = $this->client->customers->allFundingInstructions('cus_123', []);
static::assertInstanceOf(\Stripe\Collection::class, $result);
static::assertInstanceOf(\Stripe\FundingInstructions::class, $result->data[0]);
}

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

0 comments on commit 18cfb16

Please sign in to comment.