diff --git a/lib/Event.php b/lib/Event.php index ca394a19c..5804d21de 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -228,6 +228,11 @@ class Event extends ApiResource const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; const TAX_RATE_CREATED = 'tax_rate.created'; const TAX_RATE_UPDATED = 'tax_rate.updated'; + const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing'; + const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created'; + const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted'; + const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure'; + const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready'; const TOPUP_CANCELED = 'topup.canceled'; const TOPUP_CREATED = 'topup.created'; const TOPUP_FAILED = 'topup.failed'; diff --git a/lib/Refund.php b/lib/Refund.php index e452653e2..f8bfae6e4 100644 --- a/lib/Refund.php +++ b/lib/Refund.php @@ -57,4 +57,21 @@ class Refund extends ApiResource * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead */ const FAILURE_REASON = 'expired_or_canceled_card'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund the canceled refund + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } } diff --git a/lib/SKU.php b/lib/SKU.php index 16e42b1e1..09d6c85e5 100644 --- a/lib/SKU.php +++ b/lib/SKU.php @@ -14,9 +14,6 @@ * * Can also be used to manage inventory. * - * Related guide: Tax, Shipping, - * and Inventory. - * * @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 bool $active Whether the SKU is available for purchase. diff --git a/lib/Service/RefundService.php b/lib/Service/RefundService.php index cfbef54c5..772c0f6e3 100644 --- a/lib/Service/RefundService.php +++ b/lib/Service/RefundService.php @@ -24,6 +24,25 @@ public function all($params = null, $opts = null) return $this->requestCollection('get', '/v1/refunds', $params, $opts); } + /** + * Cancels a refund with a status of requires_action. + * + * Refunds in other states cannot be canceled, and only refunds for payment methods + * that require customer action will enter the requires_action state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts); + } + /** * Create a refund. * diff --git a/lib/TaxId.php b/lib/TaxId.php index b9ab44ac2..0d9e7e7a5 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -18,7 +18,7 @@ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer ID of the customer. * @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 string $type Type of the tax ID, one of ae_trn, au_abn, au_arn, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, gb_vat, ge_vat, hk_br, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, th_vat, tw_vat, ua_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $type Type of the tax ID, one of ae_trn, au_abn, au_arn, bg_uic, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, th_vat, tw_vat, ua_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. * @property null|\Stripe\StripeObject $verification Tax ID verification information. */ @@ -31,6 +31,7 @@ class TaxId extends ApiResource const TYPE_AE_TRN = 'ae_trn'; const TYPE_AU_ABN = 'au_abn'; const TYPE_AU_ARN = 'au_arn'; + const TYPE_BG_UIC = 'bg_uic'; const TYPE_BR_CNPJ = 'br_cnpj'; const TYPE_BR_CPF = 'br_cpf'; const TYPE_CA_BN = 'ca_bn'; @@ -46,6 +47,7 @@ class TaxId extends ApiResource const TYPE_GB_VAT = 'gb_vat'; const TYPE_GE_VAT = 'ge_vat'; const TYPE_HK_BR = 'hk_br'; + const TYPE_HU_TIN = 'hu_tin'; const TYPE_ID_NPWP = 'id_npwp'; const TYPE_IL_VAT = 'il_vat'; const TYPE_IN_GST = 'in_gst'; @@ -65,6 +67,7 @@ class TaxId extends ApiResource const TYPE_SA_VAT = 'sa_vat'; const TYPE_SG_GST = 'sg_gst'; const TYPE_SG_UEN = 'sg_uen'; + const TYPE_SI_TIN = 'si_tin'; const TYPE_TH_VAT = 'th_vat'; const TYPE_TW_VAT = 'tw_vat'; const TYPE_UA_VAT = 'ua_vat';