Send mobile amount incorrect


#1

After copying exactly what’s in my documentation, when the pop up arrives on the phone the amount appearing is different from the amount in the code. Sometimes its 1000, sometimes its 2000 or 3000

	payment = paynow.create_payment('Testing', 'test@example.com')

    payment.add('Premium', 1000)

    response = paynow.send_mobile(payment, '0773416346', 'ecocash')

#2

Hi there, please send the poll URLs for all the attempts that you did if you can, or any that you can send through.


#3

okay let me do so

  1. Amount - 1000
    https://www.paynow.co.zw/Interface/CheckPayment/?guid=4cb00b2a-fd73-4fdd-b123-81cebd111590

  2. Amount - 2000

https://www.paynow.co.zw/Interface/CheckPayment/?guid=762f6803-d8f5-48e8-85f2-e23720e17ead

  1. Amount - 3000

https://www.paynow.co.zw/Interface/CheckPayment/?guid=7829a598-d9c0-404a-8050-7492fae5e23b


#4

I’m using django.
I’ve noted that after my server refreshes it goes back to 1000


#5

Hi there, I am unable to reproduce this issue from my end. It might be related to the specific integration. I will send you a direct message with details for further assistance. Anyone else who might arrive here from somewhere (on earth or otherwise :stuck_out_tongue_winking_eye:) with the same issue please feel free to reply so that we try helping you using other more feature-rich and private communication methods.


#6

Hi i am facing the same problem. How did you solve this?


#7

I found a “solution” I do not know if it is the right way to go about it but I realized that the incorrect payment amounts were multiples of the correct payment amount (i.e. correct payment amount * the number of times a like transaction has been made). Hence, 1000 the 1st time, 2000 the 2nd time, and so on, like it was charging for the current transaction and the previous ones. This is because they are being stored in the items variable of the payment object.

My fix was to add this line before calling the create_payment method:

payment.items=[]

like this

payment = paynow.create_payment('Testing', 'test@example.com')

# clearing the items list
payment.items=[]

payment.add('Premium', 1000)

response = paynow.send_mobile(payment, '0773416346', 'ecocash')

Here is the link to the Payment class.
I hope this helps :wink:


#8

Brilliant stuff here


#9

Thank you very much chief. :handshake:🏾