Beispiel #1
0
	def on_update(self):
		create_custom_pos_fields()
		create_payment_gateway('Mpesa-' + self.payment_gateway_name, settings='Mpesa Settings', controller=self.payment_gateway_name)
		call_hook_method('payment_gateway_enabled', gateway='Mpesa-' + self.payment_gateway_name, payment_channel="Phone")

		# required to fetch the bank account details from the payment gateway account
		frappe.db.commit()
		create_mode_of_payment('Mpesa-' + self.payment_gateway_name, payment_type="Phone")
Beispiel #2
0
 def test_creation_of_payment_gateway(self):
     mode_of_payment = create_mode_of_payment("Mpesa-_Test",
                                              payment_type="Phone")
     self.assertTrue(
         frappe.db.exists("Payment Gateway Account",
                          {"payment_gateway": "Mpesa-_Test"}))
     self.assertTrue(mode_of_payment.name)
     self.assertEqual(mode_of_payment.type, "Phone")