pinax-stripe-light icon indicating copy to clipboard operation
pinax-stripe-light copied to clipboard

Create invoice item

Open Paul424 opened this issue 7 years ago • 9 comments

What's this PR do?

Support the new "billing" feature so you can add payment method "send invoice".

Any background context you want to provide?

These changes are required to support ACH, but even if you are not in US/USD then you can still build it yourself using the newly added functions. So for instance on invoice.created you send the invoice to the customer and when billling is set to send_invoice you close the invoice. Then when payment is send; you open the invoice and set it paid (or forgive).

What ticket or issue # does this fix?

Closes #428

Definition of Done (check if considered and/or addressed):

  • [ ] Are all backwards incompatible changes documented in this PR?
  • [ ] Have all new dependencies been documented in this PR?
  • [n ] Has the appropriate documentation been updated (if applicable)?
  • [ n] Have you written tests to prove this change works (if applicable)?

Paul424 avatar Oct 23 '17 14:10 Paul424

Codecov Report

Merging #436 into master will decrease coverage by 1.82%. The diff coverage is 43.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
- Coverage    99.4%   97.57%   -1.83%     
==========================================
  Files          34       34              
  Lines        1682     1735      +53     
  Branches      144      152       +8     
==========================================
+ Hits         1672     1693      +21     
- Misses          5       33      +28     
- Partials        5        9       +4
Flag Coverage Δ
#py27dj110 97.57% <43.85%> (-1.83%) :arrow_down:
#py27dj111 97.57% <43.85%> (-1.83%) :arrow_down:
#py27dj18 97.57% <43.85%> (-1.83%) :arrow_down:
#py34dj110 97.57% <43.85%> (-1.83%) :arrow_down:
#py34dj111 97.57% <43.85%> (-1.83%) :arrow_down:
#py34dj18 97.57% <43.85%> (-1.83%) :arrow_down:
#py34dj20 97.57% <43.85%> (-1.83%) :arrow_down:
#py35dj110 97.57% <43.85%> (-1.83%) :arrow_down:
#py35dj111 97.57% <43.85%> (-1.83%) :arrow_down:
#py35dj18 97.57% <43.85%> (-1.83%) :arrow_down:
#py35dj20 97.57% <43.85%> (-1.83%) :arrow_down:
#py36dj111 97.57% <43.85%> (-1.83%) :arrow_down:
#py36dj20 97.57% <43.85%> (-1.83%) :arrow_down:
#py36dj20psql 97.57% <43.85%> (-1.83%) :arrow_down:
Impacted Files Coverage Δ
pinax/stripe/webhooks.py 100% <100%> (ø) :arrow_up:
pinax/stripe/models.py 100% <100%> (ø) :arrow_up:
pinax/stripe/actions/invoices.py 72.91% <18.75%> (-27.09%) :arrow_down:
pinax/stripe/actions/subscriptions.py 91.17% <33.33%> (-8.83%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1b67b87...04a6d1c. Read the comment docs.

codecov[bot] avatar Oct 30 '17 11:10 codecov[bot]

Codecov Report

Merging #436 into master will decrease coverage by 0.67%. The diff coverage is 76.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
- Coverage    99.4%   98.73%   -0.68%     
==========================================
  Files          33       33              
  Lines        1838     1891      +53     
  Branches      168      176       +8     
==========================================
+ Hits         1827     1867      +40     
- Misses          5       10       +5     
- Partials        6       14       +8
Flag Coverage Δ
#py27dj110 98.41% <76.78%> (-0.67%) :arrow_down:
#py27dj111 98.41% <76.78%> (-0.67%) :arrow_down:
#py27dj18 98.67% <76.78%> (-0.67%) :arrow_down:
#py34dj110 98.41% <76.78%> (-0.67%) :arrow_down:
#py34dj111 98.41% <76.78%> (-0.67%) :arrow_down:
#py34dj18 98.67% <76.78%> (-0.67%) :arrow_down:
#py34dj20 98.41% <76.78%> (-0.67%) :arrow_down:
#py35dj110 98.41% <76.78%> (-0.67%) :arrow_down:
#py35dj111 98.41% <76.78%> (-0.67%) :arrow_down:
#py35dj18 98.67% <76.78%> (-0.67%) :arrow_down:
#py35dj20 98.41% <76.78%> (-0.67%) :arrow_down:
#py36dj111 98.41% <76.78%> (-0.67%) :arrow_down:
#py36dj20 98.41% <76.78%> (-0.67%) :arrow_down:
#py36dj20psql 98.41% <76.78%> (-0.67%) :arrow_down:
Impacted Files Coverage Δ
pinax/stripe/webhooks.py 99.08% <100%> (ø) :arrow_up:
pinax/stripe/models.py 100% <100%> (ø) :arrow_up:
pinax/stripe/actions/subscriptions.py 91.3% <33.33%> (-8.7%) :arrow_down:
pinax/stripe/actions/invoices.py 92.7% <78.12%> (-7.3%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4013376...2e9b3ef. Read the comment docs.

codecov[bot] avatar Oct 30 '17 11:10 codecov[bot]

Thanks for the updates.

Do you think you can add some tests for all the new actions?

paltman avatar Oct 30 '17 14:10 paltman

Yes, i know tests are lacking; i noticed coverage was slightly lower. Let me try to work on this...

Paul

On 30-10-17 15:25, Patrick Altman wrote:

Thanks for the updates.

Do you think you can add some tests for all the new actions?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pinax/pinax-stripe/pull/436#issuecomment-340459949, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVaNtwJDa1s8rGuHG2pL1mPjpJOE29Yks5sxdxqgaJpZM4QC5Wm.

Paul424 avatar Oct 30 '17 14:10 Paul424

Please give me an update when this pull is scheduled to be merged to master; i rather fix/merge a branch once ;-)

Paul424 avatar Nov 06 '17 21:11 Paul424

Please don't merge yet, i still need to deploy first to process some "fix" migrations, then i need to undo these to revert back to the original migrations from master....

I have had/and still have a considerable amount of work on fixing migrations; i like to propose to not change existing migrations on master any more, just leave them as they are after they are delivered and use the build in squash function to simplify the migration path when required.

Paul424 avatar Dec 06 '17 21:12 Paul424

Ok, i finished the migrations; should now be identical to the master branch + my additions. I the current status sufficient for merge?

Paul424 avatar Dec 07 '17 22:12 Paul424

76.78% of diff hit

You should add more tests probably. (Haven't looked at the diff again)

blueyed avatar Dec 07 '17 23:12 blueyed

FYI - we need this functionality as well. I noticed that there is possibly something missing as well from this implementation: pinax.stripe.actions.sources.sync_payment_source_from_stripe_data doesn't currently handle the data in the sources section of a payload, e.g.:

  "sources": {
    "object": "list",
    "data": [
      {
        "id": "src_xxxxxxxxxxxxxxx",
        "object": "source",
        "amount": null,
        "client_secret": "src_client_secretxxxxxxxxxxxxxxxx",
        "created": 1519071007,
        "currency": "usd",
        "customer": "cus_xxxxxxxxxxxxxxxxx",
        "flow": "receiver",
        "livemode": false,
        "metadata": {},
        "owner": {
          "address": null,
          "email": "[email protected]",
          "name": null,
          "phone": null,
          "verified_address": null,
          "verified_email": null,
          "verified_name": null,
          "verified_phone": null
        },
        "receiver": {
          "address": "110000000-test_d07ad7f50925",
          "amount_charged": 0,
          "amount_received": 0,
          "amount_returned": 0,
          "refund_attributes_method": "email",
          "refund_attributes_status": "missing"
        },
        "statement_descriptor": null,
        "status": "pending",
        "type": "ach_credit_transfer",
        "usage": "reusable",
        "ach_credit_transfer": {
          "account_number": "test_d07ad7f50925",
          "bank_name": "TEST BANK",
          "fingerprint": "IHEifPhUMGT3wIdZ",
          "routing_number": "110000000",
          "swift_code": "TSTEZ122"
        }
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/v1/customers/cus_xxxxxxxxxxxxxxx/sources"
  },

fredpalmer avatar Feb 19 '18 20:02 fredpalmer