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

Checkout Session retrieval and missing attributes #532

Merged
merged 5 commits into from
Sep 1, 2019
Merged

Checkout Session retrieval and missing attributes #532

merged 5 commits into from
Sep 1, 2019

Conversation

nbw
Copy link
Contributor

@nbw nbw commented Aug 19, 2019

Summary

There are a number of attributes on the Sessions object that are missing. This PR adds any missing attributes mentioned in Stripe's docs.

There is also a retrieve endpoint that has since been added.

Tests

Added one test for Stripe.session.retrieve/2 following a pattern from subscriptions_test.exs.

Note

When I used the retrieve endpoint in my own project I had to add the header:

Stripe-Version : 2019-05-16; checkout_sessions_beta=v1

Edit: looks like that's already passed: https://github.com/code-corps/stripity_stripe/blob/1510f7c384cd3b3f40939d28a15a5bcdfe300aed/lib/stripe/api.ex#L19

@nbw nbw changed the title Checkout Session retrieval and missing params Checkout Session retrieval and missing attributes Aug 19, 2019
@snewcomer
Copy link
Collaborator

@nbw Mind rebasing with master? Also stripe api version will be configurable in 2.5!

Copy link
Collaborator

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are some welcome additions! Thank you!

@@ -66,13 +67,37 @@ defmodule Stripe.Session do
@type t :: %__MODULE__{
:id => Stripe.id(),
:object => String.t(),
:livemode => boolean()
:cancel_url => boolean(),
:billing_address_collection => String.t(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind alpha ordering this?

Copy link
Contributor Author

@nbw nbw Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Sorry, I followed the order in Stripe's docs. I sorted everything past object.

commit

:customer_email => String.t(),
:display_items => list(line_item),
:livemode => boolean(),
:locale => boolean(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@nbw nbw Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Commit

:payment_intent => String.t(),
:payment_method_types => list(String.t()),
:submit_type => String.t(),
:subscription => String.t(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r/String.t()/Stripe.id() | Stripe.Subscription.t() | nil,

Copy link
Contributor Author

@nbw nbw Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:display_items => list(line_item),
:livemode => boolean(),
:locale => boolean(),
:payment_intent => String.t(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r/String.t()/Stripe.id() | Stripe.PaymentIntent.t() | nil,

Copy link
Contributor Author

@nbw nbw Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:cancel_url => boolean(),
:billing_address_collection => String.t(),
:client_reference_id => String.t(),
:customer => String.t(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r/String.t()/Stripe.id() | Stripe.Customer.t() | nil

Copy link
Contributor Author

@nbw nbw Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 88.287% when pulling dda2d3f on nbw:feature/sessions into caa2d8d on code-corps:master.

@nbw
Copy link
Contributor Author

nbw commented Aug 27, 2019

@snewcomer

Thanks.

I rebased and implemented the requested changes.

@snewcomer
Copy link
Collaborator

Lovely. thank you for the detailed commits!

@snewcomer snewcomer merged commit 7589f8b into beam-community:master Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants