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

Update to the upstream v2.10.0 #19

Open
wants to merge 57 commits into
base: jalexander/v2.8.0
Choose a base branch
from

Conversation

jalexander
Copy link

This PR updates our stripity_stripe fork to v2.10.0. This is part of an effort to bring our forked version of the library closer to the latest upstream version of the library.

This matches all of the changes from upstream, except I added the properties back in that we are still using in massdriver.

Testing this locally by installing the commit ID from this PR.

cblage and others added 30 commits November 20, 2024 14:39
Deprecated tax information for Customers have been removed.
The deprecated tax_info and tax_info_verification fields on the Customer object are now removed in favor of tax_ids.
The deprecated tax_info parameter on the Customer create and update methods are removed in favor of tax_id_data.
For more information, view the migration guide.
As one [might see](https://stackoverflow.com/questions/60941305/stripity-stripe-module-not-found), the recommendation to use `"~> 2.0.0"` which effectively bumps the version to `"2.0.1"` is not great :)
It is possible to use the Stripe API without providing these keys. They
are optional so we flag them as such to keep dialyzer happy.

The Stripe docs indicate that only 'items' is required:

  https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
Using the `@deprecated` tag marked all usages of `Stripe.Subscription.delete/2` and `Stripe.Subscription.delete/3` as deprecated, whereas only those receiving `%{at_period_end: true}` should be deprecated.

This PR fixes the unnecessary deprecation warning.
…fields, and add support for some missing objects (beam-community#602)

* Remove /issuing/card_details endpoint interactions

The endpoint /issuing/card_details has been removed from the Stripe API.
These details can be found at /issuing/cards/retrieve with the appropriate
'expand' parameters.

* Remove Issuing Disputes

Since Issuing Disputes are no longer available in the Stripe API, remove
the issuing disputes module and references to issuing disputes in
issuing transaction.

* add support for Stripe Mandate core resource

* add support for File Link core resource

* update core resources structs

* add converter support for order_item, usage_record

* remove deprecated fields from, add missing fields to issuing objects

* add support for Credit Note Line Items, Customer Balance Transactions

* remove deprecated fields, add 'threshold reason', alphabetize struct fields

* add support for usage_record_summary object

* remove incorrect field from recipient fixture for test warning

* fix typespecs for struct and update/4

* list login_link as supported object

* fix typespec for list/3

* fix typespecs, struct fields for subscriptions objects

* add missing struct fields to connect objects

* adjust typespec to match library style, add missing struct fields

* add missing 'deleted' field to stripe objects

* update stripe-mock version

* ignore coverage reports in /cover

* fix to actually test Stripe.Relay.Product module

* add prices api

Co-authored-by: Ianko Leite <[email protected]>
Co-authored-by: ianko <[email protected]>
* added terminal endpoints with tests

* updated comments

* fix args for create reader
…m-community#592)

* changed params for subscription to accept default payment method

* added optional id to allow for upgrading and downgrading
* add price to subscriptions

* add price to subscriptions

* run format
Stripe allows creating refunds off of payment intents.  Currently, the
typespec for creating refunds forces us to only send in a charge to
refund.  Update the typespecs to allow for either charges or payment
intents.
…munity#612)

according to https://stripe.com/docs/api/events/object , `data.previous_attributes` is "sent along only with *.updated events"
* VERSION BUMP 2.9.0

* CHANGELOG
Cancel subscription endpoint supports `invoice_now` and `prorate`
parameters (https://stripe.com/docs/api/subscriptions/cancel).
Include cancel_at_period_end parameter in Subscription.create function.
Looks like Stripe moved the page. I think this it the correct one
Allow confirming a payment intent using a payment method. This appears
to be the newest way of confirming a payment, deprecating the source
field.

I believe it's best to leave both options in for backwards compatibility

https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-payment_method
John-Goff and others added 22 commits November 20, 2024 14:59
…community#631)

* Add optional default tax rates to subscription typespecs

* Add optional default tax rates to invoice typespecs as well
Stripe’s API support the off_session parameter, so the typespec should
include it too.

https://stripe.com/docs/api/invoices/pay
* Add promotion codes

* Update API spec and fix failing tests

* Add promotion_code to subscription create

* Add code and active to PromotionCode.list

* Sort attributes

* :id is not a possible creation parameter
…ty#645)

The API supports the `source_type` parameter when creating a transfer,
but the type restrictions don't currently list it. This causes a warning
in Dialyzer when passing the `source_type` parameter.

https://stripe.com/docs/api/transfers/create
…munity#644)

This is supported by the Stripe API, but was missing from the typespec.
* Add credit note preview

* mix format
When `expand: ["invoice_settings.default_payment_method"]` is used with `Stripe.Customer.retrieve/2`, the typespec is incorrect.
* Add api key support  for Oauth token

* Allow docker setup for  stripe-mock

* Support express accounts authorize_url
…eam-community#662)

It's invalid to pass the `customer` key as both part of the URL (which
this function does) *and* in the body. Doing so leads to a Stripe
error:

```
iex(1)> Stripe.CustomerBalanceTransaction.create("cus_JO4D6sa5xl4Uk7", %{amount: -100, currency: "USD", customer: "cus_JO4D6sa5x
l4Uk7"})
{:error,
 %Stripe.Error{
   code: :invalid_request_error,
   extra: %{
     http_status: 400,
     param: :customer,
     raw_error: %{
       "message" => "A parameter provided in the URL (customer) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
       "param" => "customer",
       "type" => "invalid_request_error"
     }
   },
   message: "A parameter provided in the URL (customer) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
   request_id: nil,
   source: :stripe,
   user_message: nil
 }}
```

Whereas passing it as the first (required) positional argument works
fine:

```
iex(2)> Stripe.CustomerBalanceTransaction.create("cus_JO4D6sa5xl4Uk7", %{amount: -100, currency: "USD"})
{:ok,
 %Stripe.CustomerBalanceTransaction{
   amount: -100,
   created: 1619635421,
   credit_note: nil,
   currency: "usd",
   customer: "cus_JO4D6sa5xl4Uk7",
   description: nil,
   ending_balance: -100,
   id: "cbtxn_1IlIMLFvgMYR2X5ykmdTnR5H",
   invoice: nil,
   livemode: false,
   metadata: %{},
   object: "customer_balance_transaction",
   type: "adjustment"
 }}
```
* add capability module to groups

* add capability to supported objects

* add list of capability module and test

* add retrieve capability by id

* add update capability

* update module docs

* update spec to be consistant with others
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

Successfully merging this pull request may close these issues.