petermcd / petermcd/monzo-api

[BUG] Receipt Merchant Data Not Saving

Open
#39 0 comments 0 reactions 1 assignee View on GitHub

@petermcd is already working on this.

Since Aug 7, 2022.

bug Receipt
Dominant language
Python
Stars
36
Forks
7
Avg merge
4m
Merged PRs (30d)
2

Description

Describe the bug
Merchant data not added when details entered

To Reproduce

from monzo.handlers.filesystem import FileSystem
from monzo.endpoints.receipt import Receipt, ReceiptItem
from monzo.authentication import Authentication

EXTERNAL_ID = 'ABC123'
TRANSACTION_ID = 'REPLACE WITH REAL ID'

handler = FileSystem(file='monzo.json')
creds = handler.fetch()
redirect_url = ''
auth = Authentication(
    access_token=creds['access_token'],
    access_token_expiry=creds['expiry'],
    client_id=creds['client_id'],
    client_secret=creds['client_secret'],
    redirect_url=redirect_url,
    refresh_token=creds['refresh_token'],
)
auth.register_callback_handler(handler=handler)

item = ReceiptItem(
    description = 'test',
    amount= 1234,
    currency = 'GBP',
    tax=123
)

receipt = Receipt(
    auth = auth,
    transaction_id = TRANSACTION_ID,
    external_id = EXTERNAL_ID,
    transaction_total = 1234,
    transaction_currency = 'GBP',
    items=[item]
)

receipt.add_tax(description='some dummy description', amount=12334, currency='USD')

receipt.add_merchant(name='test123', online=True)

Receipt.create(auth=auth, receipt=receipt)
rec = Receipt.fetch(auth=auth, external_id=EXTERNAL_ID)
print(rec)

Expected behavior
Merchant data to show in the Monzo app and to be returned with a fetch

Environment (please complete the following information):

  • Package Version = 0.1.1
  • Python version = 3.8

Additional context
N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.