Commit Graph

62 Commits

Author SHA1 Message Date
Tyler Jones
66a413cd38 [@types/stripe] Fixed StripeWebhookEvent.created to be a number
The data received by a webhook endpoint is an almost identical object to the [Event Object](https://stripe.com/docs/api#event_object-created).
2018-09-17 23:01:39 -07:00
Bradley Ayers
c7d547e221 fix(stripe): ISubscription.ended_at is nullable 2018-09-16 19:08:14 +10:00
Hunter Tunnicliff
3ff332729a Fix Stripe.customers.ICustomer.metadata (#28720)
The Stripe API always returns `ICustomer` objects with the `metadata` property as `IMetadata`. It is never `undefined`, as the current definition suggests.
2018-09-10 14:40:47 -07:00
Adam Roberts
948f3ce729 listTransactions additional aguments
Include additional optional arguments to listTransactions.

[limit](https://stripe.com/docs/api#balance_history-limit) and [payout](https://stripe.com/docs/api#balance_history-payout).
2018-09-04 15:51:51 +02:00
Mohamed Kamagate
9095eefdcc Stripe : Make tolerance an optional parameter 2018-08-28 08:43:56 -07:00
Mohamed Kamagate
80b0171ab7 Add tolerance parameter to WebHooks.contructEvent 2018-08-28 08:10:16 -07:00
Bradley Ayers
5cfb7b08b4 fix(stripe): customer.default_source can be null 2018-08-24 06:53:37 +10:00
Simon Schick
347bdf75c3 feat(stripe): add failure_reason for refunds (#27884) 2018-08-06 12:05:57 -07:00
Kevin Mircovich
3a7e4864a0 added trial_from_plan to ISubscriptionCustCreationOptions interface (#27820)
This property was added to the Stripe API on 2018-05-21

[API Change Log](https://stripe.com/docs/upgrades#2018-05-21)
[API Docs](https://stripe.com/docs/api#create_subscription-trial_from_plan)
2018-08-03 10:55:00 -07:00
Troy Zarger
171ff2c377 Added customers.ICustomerListOptions to accurately implement stripe-node (#27517) 2018-07-24 10:15:22 -07:00
Tyler Jones
8a4fefd543 Stripe card's cardholder name can be null (#27206)
See example response in https://stripe.com/docs/api#retrieve_card
2018-07-12 09:21:53 -07:00
Tyler Jones
d9bf730cb2 Update stripe Card's object to be typed with 'card' string literal (#27199)
This allows differentiating between a BankAccount and Card payment method
when using type unions, which are leveraged by the stripe typings.

See https://stripe.com/docs/api#card_object-object
2018-07-12 00:49:11 -07:00
Hugo Dozois
2d4997205e Add missing stripe.iinvoice fields (#27030)
- amount_paid, amount_remaining, billing, billing_reason, due_date, hosted_invoice_url, invoice_pdf, number
- added missing descriptions
- added `| null` to align with documentation
2018-07-05 10:00:11 -07:00
Hugo Dozois
4feaeec401 Fix issue where Stripe.plans.list would not support options (#26996)
- added active & product options
2018-07-03 09:23:23 -07:00
Linus Unnebäck
5ffc7c95b1 stripe: add missing properties to IPlan 2018-06-19 10:50:02 +01:00
Hunter Tunnicliff
8223535354 Added union type for Subscription to IInvoice.subscription 2018-06-14 14:59:50 -07:00
Mine Starks
68ad466898 Merge pull request #25780 from galtalmor/stripe
Fix stripe ICharge interface with missing fields and optional null values
2018-06-11 10:47:43 -07:00
Alex Plumb
0acfb18ec6 Add test for amount_returned 2018-05-29 10:53:10 -03:00
Alex Plumb
7018c3c6dc fix(add amount_returned to IOrder) 2018-05-28 15:14:35 -03:00
jonbretman
8eb8a46af9 fix(stripe): listSource should be listSources 2018-05-21 16:29:27 +01:00
Gal Talmor
5b1307fcc1 Fix stripe ICharge interface with missing fields and optional null values 2018-05-17 10:44:36 -07:00
Gal Talmor
d2a9d45da2 Fix stripe ICharge interface with missing fields and optional null values 2018-05-16 21:48:18 -07:00
Gal Talmor
06caab2123 Fix stripe ICharge interface with missing fields and optional null values 2018-05-14 17:11:48 -07:00
Gal Talmor
92c29516cf Fix stripe ICharge interface with missing fields and optional null values 2018-05-14 16:53:24 -07:00
Pras Velagapudi
2a75536304 [stripe] Fix typo in IProductCreationOptions. (#24796)
* [stripe] Fix typo in `IProductCreationOptions`.

The `IProductCreationOptions` interface mistakenly lists `attribute` instead of `attributes` as a property.

This does not not match [the API specification for product creation](https://stripe.com/docs/api#create_product), and attempting to actually populate this field results in: `Error: Received unknown parameter: attribute`.

Changing this value to `attributes` successfully allows `stripe.products.create()` calls to succeed in populating attributes.

* Added `attributes` to tests for product creation.
2018-04-09 10:23:54 -07:00
CodeAnimal
f52ee65b22 Add cancel_at_period_end option to sub update
https://stripe.com/docs/api#update_subscription-cancel_at_period_end
2018-03-29 00:56:19 +01:00
CodeAnimal
27c85093ad Add prorate option to subscription creation options
with tests
2018-03-28 20:54:12 +01:00
Armando Aguirre
93a288d1eb Merge pull request #23868 from bruun/stripe-irefund-status
Stripe: Add status property to IRefund definition
2018-03-08 16:24:30 -08:00
Benjamin Lichtman
a25f40cc9d Merge pull request #23869 from bruun/stripe-account-payout-schedule
Stripe: Rename remaining 'transfer*' attributes to payout
2018-03-02 16:51:40 -08:00
Thomas Bruun
70f98cf873 Fix incorrect definition for ITransfer createReversal 2018-03-02 15:38:49 +01:00
CodeAnimal
0525e27d3c Implement Plan/Product API changes on 2018-02-05
https://stripe.com/docs/upgrades#2018-02-05
https://stripe.com/docs/api#create_plan-product
https://stripe.com/docs/api#create_product-type
2018-03-01 13:23:14 +00:00
Thomas Bruun
2a39618c9c Stripe: Add status property to IRefund definition
As described in the Stripe documentation: https://stripe.com/docs/api/node\#refund_object
2018-02-28 22:07:29 +01:00
Thomas Bruun
e8cf3405c0 Stripe: Rename remaining 'transfer*' attributes to payout
07012f9160 did a great job of adding the Payouts types. This commit also rewords the existing attributes that used to be called transfer before the Transfer/Payout split (see https://stripe.com/docs/transfer-payout-split).
2018-02-28 22:05:44 +01:00
CodeAnimal
aaac896891 Add trial_period_days argument when creating subscription
With tests.

https://stripe.com/docs/api#create_subscription-trial_period_days
2018-02-28 10:00:33 +00:00
CodeAnimal
82bfcaea76 Add billing_cycle_anchor argument when creating/updating subscription
With tests.

https://stripe.com/docs/api#create_subscription-billing_cycle_anchor
https://stripe.com/docs/api#update_subscription-billing_cycle_anchor
2018-02-28 09:57:36 +00:00
CodeAnimal
331f58b3b8 Add days_until_due argument when creating/updating subscription
With tests.

https://stripe.com/docs/api#create_subscription-days_until_due
2018-02-28 09:54:40 +00:00
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Garth Kidd
06e989ba78 Revert version, per feedback from @linusu and @codeanimal
TODO: squash.
2018-02-08 11:37:13 +11:00
Garth Kidd
499d248746 Stripe card numbers are strings:
The Stripe API for Node documentation of [Create a card token][cct]
gives the example code:

```
var stripe = require("stripe")(
  "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
);

stripe.tokens.create({
  card: {
    "number": '4242424242424242',
    "exp_month": 12,
    "exp_year": 2019,
    "cvc": '123'
  }
}, function(err, token) {
  // asynchronously called
});
```

[cct]: https://stripe.com/docs/api/node#create_card_token

Relevant typings history:

* @borisyankov first added `StripeTokenData.number: number` in 2013-09

* @codeanimal substantially reworked the typings in 2016-04 with
`ISourceCreationOptions.number: string` but giving it the comment:

  > The card number, as a string without any separators.
2018-02-07 15:26:50 +11:00
Andy
bef4d2b27d Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
CodeAnimal
b3bc318cf2 Update Stripe package with missing subscription items properties (#23263)
* Abstract `billing` type into a type alias

* Add `items` property to Subscription interfaces, deprecate `plan`

* Add tests

* Complete tests

* Correct unit test
2018-01-30 11:20:05 -08:00
Adam
4ea855971c Fix trial_end type to allow special value 'now' (#23149)
* Fix trial_end type to allow special value 'now' which is mentioned in the docs.

* Updated trial_end type to be more specific and added type tests
2018-01-25 08:24:32 -08:00
CodeAnimal
ede9553e0c Update Stripe package (#23083)
* Update ICard#customer type def

Add `string` to `customer` type.

* Add pay options to Invoices#pay method

* Add tests

* Change IMetadata to a `type` equal to `any`

See tests as to the reasons why I believe it's useful for it to be
changed.

* Add proration creation options to SubscriptionItems

Plus tests.

Documentation:
https://stripe.com/docs/api#create_subscription_item

* Update IMetadata definition with tests

* Add IOptionsMetadata
2018-01-23 09:34:26 -08:00
CodeAnimal
7180b7d442 Update Stripe package to include subscription items (#23006)
* Add subscription items

Fix #22783

* Add subscriptionItem property and fix bugs

* Add tests

* Add billing attribute to subscriptions

https://stripe.com/docs/api#subscription_object
2018-01-18 12:40:09 -08:00
Kensuke Hoshikawa
034f4b7343 [stripe] Fix AccountCreation, TransferCreation, ChargeCreation options (#22534)
* fix create charge options

* fix transfer creation options

* fix account creation options

* add auther to me

* fix test

* v5.0
2018-01-02 12:42:48 -08:00
Kyle Kamperschroer
47fe8021a8 Stripe types bump minor version 2017-11-27 12:43:26 -06:00
Kyle Kamperschroer
2582252a0c Stripe types added expandable application fee to charge and expandable customer to subscription 2017-11-27 12:39:37 -06:00
Nathan Shively-Sanders
07012f9160 Merge pull request #21355 from brannon/master
[stripe] Add support for Stripe Payouts API
2017-11-14 09:18:40 -08:00
Daniel Rosenwasser
92971b9cf1 Merge pull request #21257 from starhoshi/master
[stripe] Add ephemeral keys
2017-11-12 00:50:49 -08:00
Daniel Rosenwasser
a75166d13b Merge pull request #21244 from lauvigne/master
types/stripe add amount body in stripe.charges.capture
2017-11-09 00:31:45 -08:00