diff --git a/.travis.yml b/.travis.yml
index 608e18611..46c8a7535 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,7 +37,7 @@ matrix:
env:
global:
- - STRIPE_MOCK_VERSION=0.95.0
+ - STRIPE_MOCK_VERSION=0.98.0
cache:
directories:
- $HOME/.composer/cache/files
diff --git a/lib/BankAccount.php b/lib/BankAccount.php
index 729b400be..40eca41c5 100644
--- a/lib/BankAccount.php
+++ b/lib/BankAccount.php
@@ -23,6 +23,7 @@
* @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with.
* @property null|string $account_holder_name The name of the person or business that owns the bank account.
* @property null|string $account_holder_type The type of entity that holds the account. This can be either individual
or company
.
+ * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method
when creating a payout.
* @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO
).
* @property string $country Two-letter ISO code representing the country the bank account is located in.
* @property string $currency Three-letter ISO code for the currency paid out to the bank account.
diff --git a/lib/Card.php b/lib/Card.php
index 8f9614497..d3e85bf9a 100644
--- a/lib/Card.php
+++ b/lib/Card.php
@@ -23,7 +23,7 @@
* @property null|string $address_state State/County/Province/Region.
* @property null|string $address_zip ZIP or postal code.
* @property null|string $address_zip_check If address_zip
was provided, results of the check: pass
, fail
, unavailable
, or unchecked
.
- * @property null|string[] $available_payout_methods A set of available payout methods for this card. Will be either ["standard"]
or ["standard", "instant"]
. Only values from this set should be passed as the method
when creating a transfer.
+ * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method
when creating a payout.
* @property string $brand Card brand. Can be American Express
, Diners Club
, Discover
, JCB
, MasterCard
, UnionPay
, Visa
, or Unknown
.
* @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
* @property null|string $currency
diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php
index 0feb134e9..91d45dc67 100644
--- a/lib/Checkout/Session.php
+++ b/lib/Checkout/Session.php
@@ -40,6 +40,7 @@
* @property null|string $mode The mode of the Checkout Session, one of payment
, setup
, or subscription
.
* @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment
mode.
* @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
+ * @property string $payment_status The payment status of the Checkout Session, one of paid
, unpaid
, or no_payment_required
. You can use this value to decide when to fulfill your customer's order.
* @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup
mode.
* @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session.
* @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
@@ -60,6 +61,10 @@ class Session extends \Stripe\ApiResource
const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
+ const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required';
+ const PAYMENT_STATUS_PAID = 'paid';
+ const PAYMENT_STATUS_UNPAID = 'unpaid';
+
const SUBMIT_TYPE_AUTO = 'auto';
const SUBMIT_TYPE_BOOK = 'book';
const SUBMIT_TYPE_DONATE = 'donate';
diff --git a/lib/Issuing/Dispute.php b/lib/Issuing/Dispute.php
index 46459195d..5f24864b4 100644
--- a/lib/Issuing/Dispute.php
+++ b/lib/Issuing/Dispute.php
@@ -15,8 +15,14 @@
*
* @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 Disputed amount. Usually the amount of the disputed_transaction
, but can differ (usually because of currency fluctuation).
* @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute.
+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
+ * @property string $currency The currency the disputed_transaction
was made in.
+ * @property \Stripe\StripeObject $evidence
* @property bool $livemode Has the value true
if the object exists in live mode or the value false
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.
+ * @property string $status Current status of the dispute.
* @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed.
*/
class Dispute extends \Stripe\ApiResource
@@ -27,4 +33,21 @@ class Dispute extends \Stripe\ApiResource
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
+
+ /**
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return Dispute the submited dispute
+ */
+ public function submit($params = null, $opts = null)
+ {
+ $url = $this->instanceUrl() . '/submit';
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
+ $this->refreshFrom($response, $opts);
+
+ return $this;
+ }
}
diff --git a/lib/Issuing/Transaction.php b/lib/Issuing/Transaction.php
index 43df4d0f9..3c44d7ec1 100644
--- a/lib/Issuing/Transaction.php
+++ b/lib/Issuing/Transaction.php
@@ -24,6 +24,7 @@
* @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
+ * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute.
* @property bool $livemode Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
* @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency
and in the smallest currency unit. It will be different from amount
if the merchant is taking payment in a different currency.
* @property string $merchant_currency The currency with which the merchant is taking payment.
diff --git a/lib/Reporting/ReportRun.php b/lib/Reporting/ReportRun.php
index b52fe1436..458cbed6c 100644
--- a/lib/Reporting/ReportRun.php
+++ b/lib/Reporting/ReportRun.php
@@ -22,7 +22,7 @@
* @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed
).
* @property bool $livemode Always true
: reports can only be run on live-mode data.
* @property \Stripe\StripeObject $parameters
- * @property string $report_type The ID of the report type to run, such as "balance.summary.1"
.
+ * @property string $report_type The ID of the report type to run, such as "balance.summary.1"
.
* @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded
).
* @property string $status Status of this report run. This will be pending
when the run is initially created. When the run finishes, this will be set to succeeded
and the result
field will be populated. Rarely, we may encounter an error, at which point this will be set to failed
and the error
field will be populated.
* @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded
). Measured in seconds since the Unix epoch.
diff --git a/lib/Service/Issuing/DisputeService.php b/lib/Service/Issuing/DisputeService.php
index bd2f6e3eb..ab5df5f3e 100644
--- a/lib/Service/Issuing/DisputeService.php
+++ b/lib/Service/Issuing/DisputeService.php
@@ -58,6 +58,26 @@ public function retrieve($id, $params = null, $opts = null)
return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
}
+ /**
+ * Submits an Issuing Dispute
to the card network. Stripe validates
+ * that all evidence fields required for the dispute’s reason are present. For more
+ * details, see Dispute
+ * reasons and evidence.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Issuing\Dispute
+ */
+ public function submit($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts);
+ }
+
/**
* Updates the specified Issuing Dispute
object by setting the values
* of the parameters passed. Any parameters not provided will be left unchanged.
diff --git a/tests/Stripe/Issuing/DisputeTest.php b/tests/Stripe/Issuing/DisputeTest.php
index f5e48dc26..f520e118d 100644
--- a/tests/Stripe/Issuing/DisputeTest.php
+++ b/tests/Stripe/Issuing/DisputeTest.php
@@ -14,7 +14,9 @@ final class DisputeTest extends \PHPUnit\Framework\TestCase
public function testIsCreatable()
{
- $params = [];
+ $params = [
+ 'transaction' => 'ipi_123',
+ ];
$this->expectsRequest(
'post',
@@ -56,4 +58,15 @@ public function testIsUpdatable()
$resource = Dispute::update(self::TEST_RESOURCE_ID, []);
static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $resource);
}
+
+ public function testIsSubmittable()
+ {
+ $resource = Dispute::retrieve(self::TEST_RESOURCE_ID);
+ $this->expectsRequest(
+ 'post',
+ '/v1/issuing/disputes/' . self::TEST_RESOURCE_ID . '/submit'
+ );
+ $resource->submit();
+ static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $resource);
+ }
}
diff --git a/tests/Stripe/Service/Issuing/DisputeServiceTest.php b/tests/Stripe/Service/Issuing/DisputeServiceTest.php
index 83f3a693d..a2c4e122f 100644
--- a/tests/Stripe/Service/Issuing/DisputeServiceTest.php
+++ b/tests/Stripe/Service/Issuing/DisputeServiceTest.php
@@ -40,7 +40,9 @@ public function testAll()
public function testCreate()
{
- $params = [];
+ $params = [
+ 'transaction' => 'ipi_123',
+ ];
$this->expectsRequest(
'post',
@@ -73,4 +75,17 @@ public function testUpdate()
]);
static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $resource);
}
+
+ public function testSubmit()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/issuing/disputes/' . self::TEST_RESOURCE_ID . '/submit',
+ ['metadata' => ['key' => 'value']]
+ );
+ $resource = $this->service->submit(self::TEST_RESOURCE_ID, [
+ 'metadata' => ['key' => 'value'],
+ ]);
+ static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $resource);
+ }
}
diff --git a/tests/Stripe/Service/SubscriptionScheduleServiceTest.php b/tests/Stripe/Service/SubscriptionScheduleServiceTest.php
index 055d4bf67..c5304eec3 100644
--- a/tests/Stripe/Service/SubscriptionScheduleServiceTest.php
+++ b/tests/Stripe/Service/SubscriptionScheduleServiceTest.php
@@ -58,8 +58,8 @@ public function testCreate()
$resource = $this->service->create([
'phases' => [
[
- 'plans' => [
- ['plan' => 'plan_123', 'quantity' => 2],
+ 'items' => [
+ ['price' => 'price_123', 'quantity' => 2],
],
],
],
diff --git a/tests/Stripe/SubscriptionScheduleTest.php b/tests/Stripe/SubscriptionScheduleTest.php
index accccd3a3..cdde8c769 100644
--- a/tests/Stripe/SubscriptionScheduleTest.php
+++ b/tests/Stripe/SubscriptionScheduleTest.php
@@ -43,8 +43,8 @@ public function testIsCreatable()
$resource = SubscriptionSchedule::create([
'phases' => [
[
- 'plans' => [
- ['plan' => 'plan_123', 'quantity' => 2],
+ 'items' => [
+ ['price' => 'price_123', 'quantity' => 2],
],
],
],