Skip to content

Commit

Permalink
Merge fe501e3 into 918d772
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Apr 3, 2020
2 parents 918d772 + fe501e3 commit 9071391
Show file tree
Hide file tree
Showing 23 changed files with 237 additions and 201 deletions.
36 changes: 18 additions & 18 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ public function deauthorize($clientId = null, $opts = null)
return OAuth::deauthorize($params, $opts);
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection the list of persons
*/
public function persons($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/persons';
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$obj = Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down Expand Up @@ -336,24 +354,6 @@ public static function createLoginLink($id, $params = null, $opts = null)

const PATH_PERSONS = '/persons';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection the list of persons
*/
public function persons($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/persons';
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$obj = Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param string $id the ID of the account on which to retrieve the persons
* @param null|array $params
Expand Down
24 changes: 15 additions & 9 deletions lib/ApplicationFeeRefund.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
namespace Stripe;

/**
* Class ApplicationFeeRefund.
* <code>Application Fee Refund</code> objects allow you to refund an application
* fee that has previously been created but not yet refunded. Funds will be
* refunded to the Stripe account from which the fee was originally collected.
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $balance_transaction
* @property int $created
* @property string $currency
* @property string $fee
* @property \Stripe\StripeObject $metadata
* Related guide: <a
* href="https://stripe.com/docs/connect/destination-charges#refunding-app-fee">Refunding
* Application Fees</a>.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount, in %s.
* @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance.
* @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 string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded.
* @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
class ApplicationFeeRefund extends ApiResource
{
Expand Down
8 changes: 7 additions & 1 deletion lib/BitcoinTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
namespace Stripe;

/**
* Class BitcoinTransaction.
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount The amount of <code>currency</code> that the transaction was converted to in real-time.
* @property int $bitcoin_amount The amount of bitcoin contained in the transaction.
* @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://stripe.com/docs/currencies">ISO code for the currency</a> to which this transaction was converted.
* @property string $receiver The receiver to which this transaction was sent.
*/
class BitcoinTransaction extends ApiResource
{
Expand Down
23 changes: 11 additions & 12 deletions lib/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
namespace Stripe;

/**
* Class Capability.
* This is an object representing a capability for a Stripe account.
*
* @property string $id
* @property string $object
* @property string $account
* @property bool $requested
* @property int $requested_at
* Related guide: <a
* href="https://stripe.com/docs/connect/capabilities-overview">Capabilities
* Overview</a>.
*
* @property string $id The identifier for the capability.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string|\Stripe\Account $account The account for which the capability enables functionality.
* @property bool $requested Whether the capability has been requested.
* @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch.
* @property \Stripe\StripeObject $requirements
* @property string $status
* @property string $status The status of the capability. Can be <code>active</code>, <code>inactive</code>, <code>pending</code>, or <code>unrequested</code>.
*/
class Capability extends ApiResource
{
const OBJECT_NAME = 'capability';

use ApiOperations\Update;

/**
* Possible string representations of a capability's status.
*
* @see https://stripe.com/docs/api/capabilities/object#capability_object-status
*/
const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_PENDING = 'pending';
Expand Down
2 changes: 1 addition & 1 deletion lib/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
* @property int $exp_month Two-digit number representing the card's expiration month.
* @property int $exp_year Four-digit number representing the card's expiration year.
* @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example.
* @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers whove signed up with you are using the same card number,for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
* @property string $funding Card funding type. Can be <code>credit</code>, <code>debit</code>, <code>prepaid</code>, or <code>unknown</code>.
* @property string $last4 The last four digits of the card.
* @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Expand Down
2 changes: 1 addition & 1 deletion lib/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or <a href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in charge currency</a>. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
* @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or <a href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in charge currency</a>. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
* @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
* @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge.
* @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
Expand Down
28 changes: 13 additions & 15 deletions lib/CreditNoteLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
namespace Stripe;

/**
* Class InvoiceLineItem.
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $description
* @property int $discount_amount
* @property string $invoice_line_item
* @property bool $livemode
* @property int $quantity
* @property array $tax_amounts
* @property array $tax_rates
* @property string $type
* @property null|int $unit_amount
* @property null|string $unit_amount_decimal
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount The integer amount in <strong>%s</strong> representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
* @property null|string $description Description of the item being credited.
* @property int $discount_amount The integer amount in <strong>%s</strong> representing the discount being credited for this line item.
* @property string $invoice_line_item ID of the invoice line item being credited
* @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 null|int $quantity The number of units of product being credited.
* @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
* @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item.
* @property string $type The type of the credit note line item, one of <code>invoice_line_item</code> or <code>custom_line_item</code>. When the type is <code>invoice_line_item</code> there is an additional <code>invoice_line_item</code> property on the resource the value of which is the id of the credited line item on the invoice.
* @property null|int $unit_amount The cost of each unit of product being credited.
* @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
*/
class CreditNoteLineItem extends ApiResource
{
Expand Down
45 changes: 25 additions & 20 deletions lib/CustomerBalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@
namespace Stripe;

/**
* Class CustomerBalanceTransaction.
* Each customer has a <a
* href="https://stripe.com/docs/api/customers/object#customer_object-balance"><code>balance</code></a>
* value, which denotes a debit or credit that's automatically applied to their
* next invoice upon finalization. You may modify the value directly by using the
* <a href="https://stripe.com/docs/api/customers/update">update customer API</a>,
* or by creating a Customer Balance Transaction, which increments or decrements
* the customer's <code>balance</code> by the specified <code>amount</code>.
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $credit_note
* @property int $created
* @property string $currency
* @property string $customer
* @property string $description
* @property int $ending_balance
* @property string $invoice
* @property bool $livemode
* @property \Stripe\StripeObject $metadata
* @property string $type
* Related guide: <a
* href="https://stripe.com/docs/billing/customer/balance">Customer Balance</a> to
* learn more.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's <code>balance</code>.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction.
* @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|\Stripe\Customer $customer The ID of the customer the transaction belongs to.
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property int $ending_balance The customer's <code>balance</code> after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
* @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction.
* @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 null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property string $type Transaction type: <code>adjustment</code>, <code>applied_to_invoice</code>, <code>credit_note</code>, <code>initial</code>, <code>invoice_too_large</code>, <code>invoice_too_small</code>, <code>unspent_receiver_credit</code>, or <code>unapplied_from_invoice</code>. See the <a href="https://stripe.com/docs/billing/customer/balance#types">Customer Balance page</a> to learn more about transaction types.
*/
class CustomerBalanceTransaction extends ApiResource
{
const OBJECT_NAME = 'customer_balance_transaction';

/**
* Possible string representations of a balance transaction's type.
*
* @see https://stripe.com/docs/api/customers/customer_balance_transaction_object#customer_balance_transaction_object-type
*/
const TYPE_ADJUSTEMENT = 'adjustment';
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
const TYPE_CREDIT_NOTE = 'credit_note';
const TYPE_INITIAL = 'initial';
Expand Down
37 changes: 18 additions & 19 deletions lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@
namespace Stripe;

/**
* Class InvoiceLineItem.
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $currency
* @property string $description
* @property bool $discountable
* @property string $invoice_item
* @property bool $livemode
* @property \Stripe\StripeObject $metadata
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount The amount, in %s.
* @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 $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property bool $discountable If true, discounts will apply to this line item. Always false for prorations.
* @property string $invoice_item The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated with this line item if any.
* @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 key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with <code>type=subscription</code> this will reflect the metadata of the subscription that caused the line item to be created.
* @property \Stripe\StripeObject $period
* @property \Stripe\Plan $plan
* @property bool $proration
* @property int $quantity
* @property string $subscription
* @property string $subscription_item
* @property array $tax_amounts
* @property array $tax_rates
* @property string $type
* @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration.
* @property bool $proration Whether this is a proration.
* @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration.
* @property null|string $subscription The subscription that the invoice item pertains to, if any.
* @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription.
* @property null|\Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
* @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item.
* @property string $type A string identifying the type of the source of this line item, either an <code>invoiceitem</code> or a <code>subscription</code>.
* @property bool $unified_proration For prorations this indicates whether Stripe automatically grouped multiple related debit and credit line items into a single combined line item.
*/
class InvoiceLineItem extends ApiResource
{
Expand Down

0 comments on commit 9071391

Please sign in to comment.