def test_send_money_pesalink_bank(self): from jenga.send_money.pesalink.bank import SendMoney, Recipient, Transaction transaction_ref = get_jenga_ref() send_money = SendMoney( sender=self.sender, recipient=Recipient( full_name="Tom Doe", account_number="8323524545", bank_code="01", country_code="KE", phone_number="0722000000" ), transaction=Transaction( transaction_reference=transaction_ref, amount=self.amount, currency_code="KES", description="Remitance to pesalink bank" ), credentials=self.credentials, ) response = send_money.get_response() status = response.get("status") error_message = f"PESALINK BANK Error \n {json.dumps(response, indent=2)}" \ f"\n{json.dumps(send_money.get_payload(), indent=2)}" self.assertEqual(status, "SUCCESS", error_message)
def test_send_money_equity(self): from jenga.send_money.equity import SendMoney, Recipient, Transaction transaction_ref = get_jenga_ref() send_money = SendMoney( sender=self.sender, recipient=Recipient( full_name="Tom Doe", account_number="0060161911111", country_code="KE" ), transaction=Transaction( transaction_reference=transaction_ref, amount=self.amount, currency_code="KES", description="Remitance to equity bank account" ), credentials=self.credentials, ) response = send_money.get_response() status = response.get("status") error_message = f"EQUITY Error \n {json.dumps(response, indent=2)}" self.assertEqual(status, "SUCCESS", error_message)
def test_send_money_rtgs(self): from jenga.send_money.rtgs import SendMoney, Recipient, Transaction transaction_ref = get_jenga_ref() send_money = SendMoney( sender=self.sender, recipient=Recipient( full_name="Jonh Doe", bank_code="01", account_number="1276805594", country_code="KE", ), transaction=Transaction( transaction_reference=transaction_ref, amount=self.amount, currency_code="KES", description="Remittance to rtgs" ), credentials=self.credentials, ) response = send_money.get_response() status = response.get("status") error_message = f"RTGS Error \n {json.dumps(response, indent=2)}" self.assertEqual(status, "SUCCESS", error_message)
def test_send_money_mobile(self): from jenga.send_money.mobile import SendMoney, Recipient, Transaction transaction_ref = get_jenga_ref() send_money = SendMoney( sender=self.sender, recipient=Recipient( full_name="Jonh Doe", phone_number="0797792447", wallet="Mpesa", country_code="KE" ), transaction=Transaction( transaction_reference=transaction_ref, amount=self.amount, currency_code="KES", description="Remitance to mobile phone" ), credentials=self.credentials, ) response = send_money.get_response() status = response.get("status") error_message = f"MOBILE Error \n {json.dumps(response, indent=2)}" self.assertEqual(status, "SUCCESS", error_message)
def test_send_money_swift(self): from jenga.send_money.swift import SendMoney, Recipient, Transaction transaction_ref = get_jenga_ref() send_money = SendMoney( sender=self.sender, recipient=Recipient( full_name="Jonh Doe", swift_code="KCBLKENX017", account_number="1276805594", country_code="KE", address="19010-00501 Nairobi, Kenya" ), transaction=Transaction( transaction_reference=transaction_ref, amount=self.amount, currency_code="USD", description="Remitance to swift" ), credentials=self.credentials, ) response = send_money.get_response() status = response.get("status") error_message = f"SWIFT Error \n {json.dumps(response, indent=2)}" self.assertEqual(status, "SUCCESS", error_message)
def test_get_ref(self): self.assertEqual(len(get_jenga_ref()), 12)