Skip to content

[BUG] Receipt Merchant Data Not Saving #39

@petermcd

Description

@petermcd

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

Metadata

Metadata

Assignees

Labels

ReceiptBugs related to the Receipt endpointbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions