Skip to content

537 add invoices#613

Merged
joshsmith merged 1 commit intodevelopfrom
537-add-invoices
Jan 5, 2017
Merged

537 add invoices#613
joshsmith merged 1 commit intodevelopfrom
537-add-invoices

Conversation

@begedin
Copy link
Contributor

@begedin begedin commented Jan 4, 2017

What's in this PR?

Work in progress for #537

TODO:

  • tests
  • implement adapter mapping
  • implement figuring out user from customer in adapter
  • implement tracking properties
  • write do_track method better

References

Fixes #537

@joshsmith
Copy link
Contributor

This is a little janky. I would prefer better ways of handling all the related resources, but I couldn't think of any. It works, though.

We also should probably write a better set of property tracking for invoices.

Copy link
Contributor Author

@begedin begedin left a comment

Choose a reason for hiding this comment

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

Generally looks good, just confused about the :amount field.

Also, I can't approve or request changes, since I'm the pull request author 👍

# Format is {:local_key, [:nesting, :of, :stripe, :keys]}
@stripe_mapping [
{:id_from_stripe, [:id]},
{:amount, [:amount]},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not seeing :amount in the API docs? Where do we get it from?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right. Idk how I got it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to change in stripity.

def create(invoice_id_from_stripe, customer_id_from_stripe) do
with account_id <- get_connect_account(customer_id_from_stripe),
{:ok, %Stripe.Invoice{} = invoice} <- @api.Invoice.retrieve(invoice_id_from_stripe, connect_account: account_id),
{:ok, params} <- StripeInvoiceAdapter.to_params(invoice)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some weird indentation issue here.

@joshsmith joshsmith merged commit 0816489 into develop Jan 5, 2017
@joshsmith joshsmith deleted the 537-add-invoices branch January 5, 2017 21:51
@joshsmith joshsmith added this to the Launch Donations milestone Jan 5, 2017
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.

2 participants