Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Allow deletion using struct #250

Closed
mjadczak opened this issue Aug 14, 2017 · 2 comments
Closed

[v2] Allow deletion using struct #250

mjadczak opened this issue Aug 14, 2017 · 2 comments

Comments

@mjadczak
Copy link
Contributor

It should be possible to use the delete functions with a Stripe struct, not just with the id itself. It's a simple change but will remove unexpected errors and is in line with how e.g. Ecto.Repo behaves.

@mjadczak
Copy link
Contributor Author

This probably falls under greater considerations of the public API in #248.

@begedin
Copy link
Contributor

begedin commented Aug 16, 2017

@mjadczak The logic makes sense, but it would be applicable to update as well, no?

mjadczak added a commit that referenced this issue Oct 15, 2017
Change tests to expect `{:ok, struct}` from `delete`
mjadczak added a commit that referenced this issue Oct 17, 2017
…nguages (#252)

* Add initial StripeMock code, which uses the [stripe_mock](https://github.com/stripe/stripe-mock) tool to make it available for tests

* Reimplement StripeMock using :exexec to make it more reliable

* Make various tweaks to harness
Test Stripe.Account

* Tweak Stripe.Account test

* Add tests for Stripe.Charge

* Update Travis dist (try to fix g++ out of date bug)

* Add stripe-mock grabbing to the Travis build

* Add stripe-mock grabbing to the Travis build

* Add tests for Stripe.ApplePayDomain

* Fix typo

* Move Stripe object tests into their own directory

* Add tests for Stripe.Coupon

* Add tests for Stripe.Customer
Tweak stripe-mock harness

* Add tests for Stripe.Invoice

* Add tests for Stripe.Plan

* Add tests for Stripe.Refund

* Add tests for Stripe.Subscription

* Move object modules into their own directory

* Recognise more Stripe objects

* Merge and finish @asummers' work asummers:remove-null-checks on removing Stripe.Changeset

* Disable "is saveable" tests until #248 resolves whether things actually should be saveable

* Allow deletion by struct and id (fix #250)
Change tests to expect `{:ok, struct}` from `delete`

* Allow invoices to be paid (see #126)

* Add :discount to Stripe.Subscription
Add Stripe.Subscription.delete_discount (see #126)

* Add check for missing fields in structs

* Remove Stripe resets, make tests async

* Make tests sync again until stripe/stripe-mock#10 is fixed

* Fixes terminology, removes redundant tests and allows async testing
"is saveable" tests removed (see #248)
stripe-mock bumped to 1.1.17, allowing async testing
terminology referring to functions corrected for style

* Fix missed function reference

* Move files in accordance with Stripe docs organisation

* Major commit with various organizational and internal changes

- Adds `Stripe.Error`, a unified struct for errors
- Moves the internal hackney request code into `Stripe.API`
- Turns `Stripe.Request` into a composable request struct
  providing a new internal API for requests
- Adds `Stripe.Entity`, a behaviour which allows object structs
  to modify the structure of the returned JSON
- Adds `Stripe.Balance` and `Stripe.BalanceTransaction`
- Adds tests for `Stripe.BalanceTransaction` as the first module
  to use the `Stripe.Request` API.

* Fix `defoverridable` call which broke compilation on Elixir 1.3

* Bring `Stripe.Balance` up to date with new API
Style tweak to `Stripe.BalanceTransaction`

* Bump API version to 2017-08-15

* Stop validating required or valid fields on client-side

* Add cast_path/3 to Stripe.Entity

* Guard Stripe.Entity casting functions against nils or missing keys

* Do not turn metadata keys to atoms

* Implement Stripe.Charge

* Implement Stripe.Refund

* Add log_deprecation functionality

* Log deprecations for old Charge functions

* Tag non-core Charge tests appropriately

* Mark Card as a Stripe.Entity

* Document Stripe.Entity

* Test Stripe.Entity

* Document Stripe.Request

* Tweak Travis matrix to test major Elixir and OTP versions, bump mix version to 2.0.0-beta.1

* Add initial StripeMock code, which uses the [stripe_mock](https://github.com/stripe/stripe-mock) tool to make it available for tests

* Reimplement StripeMock using :exexec to make it more reliable

* Make various tweaks to harness
Test Stripe.Account

* Tweak Stripe.Account test

* Add tests for Stripe.Charge

* Update Travis dist (try to fix g++ out of date bug)

* Add stripe-mock grabbing to the Travis build

* Add stripe-mock grabbing to the Travis build

* Add tests for Stripe.ApplePayDomain

* Fix typo

* Move Stripe object tests into their own directory

* Add tests for Stripe.Coupon

* Add tests for Stripe.Customer
Tweak stripe-mock harness

* Add tests for Stripe.Invoice

* Add tests for Stripe.Plan

* Add tests for Stripe.Refund

* Add tests for Stripe.Subscription

* Move object modules into their own directory

* Recognise more Stripe objects

* Merge and finish @asummers' work asummers:remove-null-checks on removing Stripe.Changeset

* Disable "is saveable" tests until #248 resolves whether things actually should be saveable

* Allow deletion by struct and id (fix #250)
Change tests to expect `{:ok, struct}` from `delete`

* Allow invoices to be paid (see #126)

* Add :discount to Stripe.Subscription
Add Stripe.Subscription.delete_discount (see #126)

* Add check for missing fields in structs

* Remove Stripe resets, make tests async

* Make tests sync again until stripe/stripe-mock#10 is fixed

* Fixes terminology, removes redundant tests and allows async testing
"is saveable" tests removed (see #248)
stripe-mock bumped to 1.1.17, allowing async testing
terminology referring to functions corrected for style

* Fix missed function reference

* Move files in accordance with Stripe docs organisation

* Major commit with various organizational and internal changes

- Adds `Stripe.Error`, a unified struct for errors
- Moves the internal hackney request code into `Stripe.API`
- Turns `Stripe.Request` into a composable request struct
  providing a new internal API for requests
- Adds `Stripe.Entity`, a behaviour which allows object structs
  to modify the structure of the returned JSON
- Adds `Stripe.Balance` and `Stripe.BalanceTransaction`
- Adds tests for `Stripe.BalanceTransaction` as the first module
  to use the `Stripe.Request` API.

* Fix `defoverridable` call which broke compilation on Elixir 1.3

* Bring `Stripe.Balance` up to date with new API
Style tweak to `Stripe.BalanceTransaction`

* Bump API version to 2017-08-15

* Stop validating required or valid fields on client-side

* Add cast_path/3 to Stripe.Entity

* Guard Stripe.Entity casting functions against nils or missing keys

* Do not turn metadata keys to atoms

* Implement Stripe.Charge

* Implement Stripe.Refund

* Add log_deprecation functionality

* Log deprecations for old Charge functions

* Tag non-core Charge tests appropriately

* Mark Card as a Stripe.Entity

* Document Stripe.Entity

* Test Stripe.Entity

* Document Stripe.Request

* Tweak Travis matrix to test major Elixir and OTP versions, bump mix version to 2.0.0-beta.1

* Exclude invalid Elixir / OTP version combination from Travis build

* Fix travis config exclusion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants