My Ecocash API is adding more money on the request


#1

The challenge I am having is it keeps adding values when I try to test it in live
I have processed for a dollar but if I cancel and try again it will send 3 dollars or more
Please note the value I am sending over the API is fixed 1 dollar
but its like its saving that dollar then when I try again it will be 2 dollars
then 3 going up even if I try for another number.

Here is the code I am using
from paynow import Paynow
import time
from datetime import datetime
import uuid

class PayNowPayment():
paynow = Paynow(
‘1XXXXXXX’,
‘8bXXXXXXXX’,
https://tmmobilemechanics.co.za/’,
https://tmmobilemechanics.co.za/
)

def make_mobile_payment(self, email, phone_number, payment_method, movie, amount):
    try:
        paynow = self.paynow
        print("Now making mayment")

        # payment = paynow.create_payment( str(uuid.uuid4()).replace("-", "")[:12].upper() , email)
        email = email + "Test"
        payment = paynow.create_payment(str(uuid.uuid4()).replace("-", "")[:12].upper(), phone_number)
        payment.add(movie, amount)
        response = paynow.send_mobile(payment, phone_number , payment_method)
        time.sleep(30)
        print(f"Now response: {response}")
        trans_status = paynow.check_transaction_status(response.poll_url)
        print(f"Transaction {trans_status.status}")
        if trans_status.paid:
            return trans_status
        return trans_status
    except Exception as e:
        print(e)
        raise e
    
    
PayNowPayment.make_mobile_payment(email="panashe22lunga@gmail.com", 
							  phone_number="0776705860",
							  payment_method="ecocash",
							  movie="Avengers: Endgame",
							  amount=1)

#2

Good day @Proflamda

Kindly update to our latest Python Package

run pip install paynow --upgrade


#3

image

I am using teh latest one I guess. I have done another upgrade just now and its showing the same error
Its sending 4 dollars instead of just a dollar


#4

Kindly check if your environment , It might be referencing an old SDK