Skip to content

Commit

Permalink
add fees param to instant conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Moiseanu committed Feb 28, 2024
1 parent 101b014 commit d0cdcc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mangopay/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class InstantConversion(BaseModel):
credited_wallet = ForeignKeyField(Wallet, api_name='CreditedWalletId', required=True)
debited_funds = MoneyField(api_name='DebitedFunds', required=True)
credited_funds = MoneyField(api_name='CreditedFunds', required=True)
fees = MoneyField(api_name="Fees", required=True)
conversion_rate = ConversionRateField(api_name='ConversionRate')
type = CharField(api_name='Type', choices=constants.TRANSACTION_TYPE_CHOICES, default=None)
nature = CharField(api_name='Nature', choices=constants.NATURE_CHOICES, default=None)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_instant_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ def test_create_instant_conversion(self):
instant_conversion.debited_wallet = BaseTestLive.create_new_wallet_with_money()
instant_conversion.credited_funds = credited_funds
instant_conversion.debited_funds = debited_funds
instant_conversion.fees = Money(amount=9, currency='EUR')
instant_conversion.tag = "instant conversion test"

instant_conversion_response = instant_conversion.create_instant_conversion()

self.assertIsNotNone(instant_conversion_response)
self.assertIsNotNone(instant_conversion_response['debited_funds'].amount)
self.assertIsNotNone(instant_conversion_response['credited_funds'].amount)
self.assertIsNotNone(instant_conversion_response['fees'].amount)
self.assertEqual(instant_conversion_response['status'], 'SUCCEEDED')

def test_get_instant_conversion(self):
Expand Down

0 comments on commit d0cdcc1

Please sign in to comment.