Skip to content

Commit

Permalink
Merge pull request #161 from praekeltfoundation/fix-submit-transactio…
Browse files Browse the repository at this point in the history
…n-body

Fix submit transaction body
  • Loading branch information
erikh360 authored Sep 12, 2023
2 parents 67fe154 + e279f49 commit 78f49d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rp_dtone/dtone_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_fixed_value_product(self, operator_id, value):

def submit_transaction(self, transaction_uuid, msisdn, product_id):
body = {
"external_id": transaction_uuid,
"external_id": str(transaction_uuid),
"product_id": product_id,
"auto_confirm": True,
"credit_party_identifier": {"mobile_number": msisdn},
Expand Down
6 changes: 4 additions & 2 deletions rp_dtone/tests/test_dtone_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import uuid

import responses
from django.test import TestCase
Expand Down Expand Up @@ -60,7 +61,8 @@ def test_submit_transaction(self):
status=200,
)

self.client.submit_transaction("transaction-uuid", "+27123", 123)
transaction_uuid = uuid.uuid4()
self.client.submit_transaction(transaction_uuid, "+27123", 123)

request = responses.calls[0].request
self.assertEqual(
Expand All @@ -71,7 +73,7 @@ def test_submit_transaction(self):
self.assertEqual(
json.loads(request.body),
{
"external_id": "transaction-uuid",
"external_id": str(transaction_uuid),
"product_id": 123,
"auto_confirm": True,
"credit_party_identifier": {"mobile_number": "+27123"},
Expand Down

0 comments on commit 78f49d7

Please sign in to comment.