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

Adds trace id to Stripe.Payout #9

Merged
merged 4 commits into from
Mar 21, 2024
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
6 changes: 4 additions & 2 deletions lib/stripe/core_resources/payout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ defmodule Stripe.Payout do
source_type: String.t(),
statement_descriptor: String.t() | nil,
status: String.t(),
type: String.t()
type: String.t(),
trace_id: map() | nil
}

defstruct [
Expand All @@ -53,7 +54,8 @@ defmodule Stripe.Payout do
:source_type,
:statement_descriptor,
:status,
:type
:type,
:trace_id
]

@plural_endpoint "payouts"
Expand Down
8 changes: 4 additions & 4 deletions test/stripe/core_resources/payout_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ defmodule Stripe.PayoutTest do
use Stripe.StripeCase, async: true

describe "create/2" do
test "creates a card for a customer" do
test "creates a payout with the card source_type" do
params = %{amount: 100, currency: "USD", source_type: "card"}
assert {:ok, %Stripe.Payout{}} = Stripe.Payout.create(params)
assert_stripe_requested(:post, "/v1/payouts")
end
end

describe "retrieve/2" do
test "retrieves a card" do
test "retrieves a payout" do
assert {:ok, %Stripe.Payout{}} = Stripe.Payout.retrieve("py_123")
assert_stripe_requested(:get, "/v1/payouts/py_123")
end
end

describe "update/2" do
test "updates a card" do
test "updates a payout" do
assert {:ok, %Stripe.Payout{}} = Stripe.Payout.update("py_123", %{metadata: %{foo: "bar"}})
assert_stripe_requested(:post, "/v1/payouts/py_123")
end
end

describe "list/2" do
test "lists all cards" do
test "lists all payouts" do
assert {:ok, %Stripe.List{data: payouts}} = Stripe.Payout.list()
assert_stripe_requested(:get, "/v1/payouts")
assert is_list(payouts)
Expand Down
Loading