Skip to content

Commit cd846d5

Browse files
authored
fix servicios (#269)
* fix transaction type * test topup and payment labels
1 parent a85de7d commit cd846d5

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

arcusd/daemon/tasks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ def topup(
2020
currency: str = 'MXN',
2121
name_on_account: Optional[str] = None,
2222
):
23+
biller_id = get_biller_id(service_provider_code)
2324
execute_op(
2425
request_id,
25-
OperationType.topup,
26+
OperationType.topup
27+
if biller_id in arcusd.arcusactions.TOPUP_BILLERS
28+
else OperationType.payment,
2629
arcusd.arcusactions.bill_payments,
27-
get_biller_id(service_provider_code),
30+
biller_id,
2831
phone_number,
2932
amount,
3033
currency,

env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARCUSD_CALLBACK_API_KEY=ABCDEFGHI
1111
ARCUSD_CALLBACK_SECRET=JKLMNOPQRS
1212
ARCUSD_SENTRY_DSN=https://3@sentry.io/1
1313
ARCUSD_WORKERS=0
14-
TOPUP_BILLERS=20,30,40
14+
TOPUP_BILLERS=13599,13597,13603
1515
NEW_RELIC_LICENSE_KEY=foo
1616
MULTIDICT_NO_EXTENSIONS=1
1717
ARCUSD_PROD=false

tests/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_successful_invoice_with_name_on_account(send_op_result):
169169
assert send_op_result.called
170170
op_info = send_op_result.call_args[0][0]
171171
assert op_info.request_id == request_id
172-
assert op_info.tran_type == OperationType.topup
172+
assert op_info.tran_type == OperationType.payment
173173
assert op_info.status == OperationStatus.success
174174
assert op_info.operation.amount == 35000
175175
assert op_info.operation.currency == 'MXN'

0 commit comments

Comments
 (0)