Skip to content

Commit

Permalink
Merge b397676 into eb1d0f1
Browse files Browse the repository at this point in the history
  • Loading branch information
begedin committed Jun 29, 2018
2 parents eb1d0f1 + b397676 commit 8f5bdde
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 38 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Latest

## 2.1.0

- *New Feature:* [Add support for object expansion - #393](https://github.com/code-corps/stripity_stripe/pull/393)
- credits to [@swelham](https://github.com/swelham
- see instructions in README.md
- Replace `user_id` in event with `account` field, as per updated stripe documentation - [#391](https://github.com/code-corps/stripity_stripe/pull/391)
- credits to [@erikreedstrom](https://github.com/erikreedstrom)
- Update officiall supported API version to 2018-05-21 - [#390]((https://github.com/code-corps/stripity_stripe/pull/390)
- credits to [@snewcomer](https://github.com/snewcomer)

## 2.0.1

- add some missing fields to `%Stripe.Plan{}` - [#380](https://github.com/code-corps/stripity_stripe/pull/380)
Expand Down
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,43 @@ use Mix.Config
config :stripity_stripe, api_key: "YOUR SECRET KEY"
```

## Note: Object Expansion

Some Stripe API endpoints support returning related objects via the object expansion query parameter. To take advantage of this feature, stripity_stripe accepts
a list of strings to be passed into `opts` under the `:expand` key indicating which objects should be expanded.

For example, calling `Charge.retrieve("ch_123")` would return a charge without expanding any objects.

```elixir
%Charge{
id: "ch_123",
balance_transaction: "txn_123",
...
}
```

However if we now include an expansion on the `balance_transaction` field using

```elixir
Charge.retrieve("ch_123", expand: ["balance_transaction"])
```

We will get the full object back as well.

```elixir
%Charge{
id: "ch_123",
balance_transaction: %BalanceTransaction{
id: "txn_123",
fee: 125,
...
},
...
}
```

For details on which objects can be expanded check out the [stripe object expansion](https://stripe.com/docs/api#expanding_objects) docs.

# Documentation for 1.x.x

<details><summary>Click to expand</summary>
Expand Down Expand Up @@ -210,43 +247,6 @@ Create a connect standalone account. Grab your development `client_id`. Put it i
</p>
</details>

# Object Expansion

Some Stripe API endpoints support returning related objects via the object expansion query parameter. To take advantage of this feature, stripity_stripe accepts
a list of strings to be passed into `opts` under the `:expand` key indicating which objects should be expanded.

For example, calling `Charge.retrieve("ch_123")` would return a charge without expanding any objects.

```elixir
%Charge{
id: "ch_123",
balance_transaction: "txn_123",
...
}
```

However if we now include an expansion on the `balance_transaction` field using

```elixir
Charge.retrieve("ch_123", expand: ["balance_transaction"])
```

We will get the full object back as well.

```elixir
%Charge{
id: "ch_123",
balance_transaction: %BalanceTransaction{
id: "txn_123",
fee: 125,
...
},
...
}
```

For details on which objects can be expanded check out the [stripe object expansion](https://stripe.com/docs/api#expanding_objects) docs.

# Contributing

Feedback, feature requests, and fixes are welcomed and encouraged. Please make appropriate use of [Issues](https://github.com/code-corps/stripity-stripe/issues) and [Pull Requests](https://github.com/code-corps/stripity-stripe/pulls). All code should have accompanying tests.
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule Stripe.Mixfile do
"coveralls.html": :test
],
test_coverage: [tool: ExCoveralls],
version: "2.0.1"
version: "2.1.0"
]
end

Expand Down

0 comments on commit 8f5bdde

Please sign in to comment.