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

Cleanup README #783

Merged
merged 2 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An Elixir library for working with [Stripe](https://stripe.com/).

## 2.x.x status

[![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/stripity_stripe) [![Inline docs](http://inch-ci.org/github/beam-community/stripe-elixir.svg?branch=master)](http://inch-ci.org/github/beam-community/stripe-elixir?branch=master) [![Coverage Status](https://coveralls.io/repos/github/beam-community/stripe-elixir/badge.svg?branch=master)](https://coveralls.io/github/beam-community/stripe-elixir?branch=master)
[![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/stripity_stripe) [![Inline docs](http://inch-ci.org/github/beam-community/stripity_stripe.svg?branch=master)](http://inch-ci.org/github/beam-community/stripity_stripe?branch=master) [![Coverage Status](https://coveralls.io/repos/github/beam-community/stripity_stripe/badge.svg?branch=master)](https://coveralls.io/github/beam-community/stripity_stripe?branch=master)

# Which version should I use?

Expand Down Expand Up @@ -38,7 +38,7 @@ Install the dependency by version:
Or by commit reference:

```elixir
{:stripity_stripe, git: "https://github.com/code-corps/stripity_stripe", ref: "8c091d4278d29a917bacef7bb2f0606317fcc025"}
{:stripity_stripe, git: "https://github.com/beam-community/stripity_stripe", ref: "017d7ecdb5aeadccc03986c02396791079178ba2"}
```

Next, add to your applications:
Expand Down Expand Up @@ -409,7 +409,3 @@ Why another Stripe Library? Currently there are a number of them in the Elixir w
- function calls that returned a standard `{:ok, result}` or `{:error, message}` response

As I began digging things up with these other libraries it became rather apparent that I was not only tweaking the API, but also ripping out a lot of the existing code... and that usually means I should probably do my own thing. So I did.

## Update

As of October 18th, Rob has graciously handed over the reins to the teams at [Code Corps](https://www.codecorps.org/) and [Strumber](https://strumber.com/). To address the concerns Rob mentioned above and update the high level api to work with all of the Stripe API Endpoints, they have since worked to release stripity_stripe 2.0, which is now the actively developed line of releases.
6 changes: 5 additions & 1 deletion lib/stripe/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,11 @@ defmodule Stripe.API do
end

defp handle_response({:ok, status, headers, body}) when status >= 300 and status <= 599 do
request_id = headers |> List.keyfind("Request-Id", 0)
request_id =
Enum.find_value(headers, fn
{"Request-Id", request_id} -> request_id
_header -> nil
end)

error =
case json_library().decode(body) do
Expand Down
4 changes: 4 additions & 0 deletions test/stripe/api_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ defmodule Stripe.APITest do
Stripe.API.request(%{}, :get, "/", %{}, [])
end

test "request_id is a string" do
{:error, %Stripe.Error{request_id: "req_123"}} = Stripe.API.request(%{}, :get, "/", %{}, [])
end

test "oauth_request works" do
verify_on_exit!()

Expand Down