def test_refund_request(self, req_mock): req_class = Mock() req_class.executeRequest.return_value = None req_mock.return_value = req_class gate_client = GateClient('https://www.payment-api.com', 'AAAA-AAAA-AAAA-AAAA', '111') initial_data = {'init_transaction_id': 1, 'amount_to_refund': 100} result_data = gate_client.refund(initial_data) expected_data = initial_data expected_data['pwd'] = hashlib.sha1('111').hexdigest() expected_data['guid'] = 'AAAA-AAAA-AAAA-AAAA' expected_data['account_guid'] = 'AAAA-AAAA-AAAA-AAAA' req_class.executeRequest.assert_called_once_with('refund', expected_data)
def test_refund_request(self, req_mock): req_class = Mock() req_class.executeRequest.return_value = None req_mock.return_value = req_class gate_client = GateClient('https://www.payment-api.com', 'AAAA-AAAA-AAAA-AAAA', '111') initial_data = {'init_transaction_id': 1, 'amount_to_refund': 100, 'merchant_transaction_id': 'IDDQD-Payment-42DFSDF2d1', 'details': 'true' } result_data = gate_client.refund(initial_data) expected_data = initial_data expected_data['pwd'] = hashlib.sha1('111').hexdigest() expected_data['guid'] = 'AAAA-AAAA-AAAA-AAAA' expected_data['account_guid'] = 'AAAA-AAAA-AAAA-AAAA' req_class.executeRequest.assert_called_once_with('refund', expected_data)