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

feat: Implemented routes for creation & charging(invoice) through PayPal #6296

Merged
merged 5 commits into from Aug 16, 2019

Conversation

mrsaicharan1
Copy link
Member

@mrsaicharan1 mrsaicharan1 commented Aug 3, 2019

Fixes #6245

https://drive.google.com/file/d/14Je8183BW4wgToQJCihp7C_k0MScbBjA/view?usp=sharing

Short description of what this resolves:

Implements create payment & charge routes for authorization of event invoice payments.
Related FE PR:fossasia/open-event-frontend#3351

Changes proposed in this pull request:

  • Added Charge Route
  • Implemented create paypal payment route
  • Creating an invoice, updation of amount and status

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
@auto-label auto-label bot added the feature label Aug 3, 2019
@mrsaicharan1 mrsaicharan1 force-pushed the paypal-invoice branch 2 times, most recently from c2449ea to fec1d40 Compare August 3, 2019 07:24
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Outdated Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Show resolved Hide resolved
app/api/event_invoices.py Outdated Show resolved Hide resolved
@mrsaicharan1 mrsaicharan1 force-pushed the paypal-invoice branch 2 times, most recently from 37c18d6 to 14a4223 Compare August 3, 2019 07:28
@codecov
Copy link

codecov bot commented Aug 3, 2019

Codecov Report

❗ No coverage uploaded for pull request base (development@ba3f0dc). Click here to learn what that means.
The diff coverage is 28.94%.

Impacted file tree graph

@@              Coverage Diff               @@
##             development    #6296   +/-   ##
==============================================
  Coverage               ?   65.33%           
==============================================
  Files                  ?      287           
  Lines                  ?    14765           
  Branches               ?        0           
==============================================
  Hits                   ?     9646           
  Misses                 ?     5119           
  Partials               ?        0
Impacted Files Coverage Δ
app/api/event_invoices.py 50% <28.94%> (ø)

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 ba3f0dc...538e981. Read the comment docs.

event_invoice.status = 'completed'
event_invoice.transaction_id = paypal_payment_id
event_invoice.completed_at = datetime.utcnow()
save_to_db(event_invoice)

Choose a reason for hiding this comment

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

undefined name 'save_to_db'

app/api/event_invoices.py Outdated Show resolved Hide resolved
event_invoice = safe_query(db, EventInvoice, 'identifier', invoice_identifier, 'identifier')
# save the paypal payment_id with the order
event_invoice.paypal_token = paypal_payment_id
save_to_db(event_invoice)

Choose a reason for hiding this comment

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

undefined name 'save_to_db'

app/api/event_invoices.py Outdated Show resolved Hide resolved
app/api/event_invoices.py Outdated Show resolved Hide resolved
app/api/event_invoices.py Outdated Show resolved Hide resolved
uds5501
uds5501 previously approved these changes Aug 14, 2019
Copy link
Contributor

@uds5501 uds5501 left a comment

Choose a reason for hiding this comment

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

Please see if 'save_to_db' error is resolved, otherwise workflow looks Okay to me

@fossasia fossasia deleted a comment Aug 14, 2019
@fossasia fossasia deleted a comment Aug 15, 2019
@mrsaicharan1
Copy link
Member Author

mrsaicharan1 commented Aug 15, 2019

@uds5501 Yes, I've resolved the error. Travis timed out previously. Please review now.
@iamareebjamal @shreyanshdwivedi

@fossasia fossasia deleted a comment Aug 15, 2019
@mrsaicharan1
Copy link
Member Author

@iamareebjamal I've tested this properly. This is ready for a review.

@iamareebjamal iamareebjamal changed the title feat: Implemented routes for creation & charging(invoice) feat: Implemented routes for creation & charging(invoice) through PayPal Aug 16, 2019
@uds5501 uds5501 merged commit 79ff3e5 into fossasia:development Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Route for PayPal authorisation[Event Invoices]
5 participants