Sending mobile payments request


#1

I am having trouble using the send_mobile method. I used code from the documentation. It runs perfectly, with no errors but nothing happens.
Please help.


#2

Can you share , your code and or logs


#3
> from paynow import Paynow
> 
> paynow = Paynow(
>     'INTEGRATION_ID', 
>     'INTEGRATION_KEY',
>     'http://google.com', 
>     'http://google.com'
>     )
> 
> payment = paynow.create_payment('Order', 'test@example.com')
> 
> payment.add('Payment for stuff', 1)
> 
> response = paynow.send_mobile(payment, '0777777777', 'ecocash')
> 
> 
> if(response.success):
>     poll_url = response.poll_url
> 
>     print("Poll Url: ", poll_url)
> 
>     status = paynow.check_transaction_status(poll_url)
> 
>     time.sleep(30)
> 
>     print("Payment Status: ", status.status)

I am trying to use the above code in a mobile app that I am developing. I don’t even know where to begin.
I replaced intergration_id and key with my own, ran the code and it didn’t show any errors neither did it report anything to my Paynow account.

How exactly am I supposed to use that code?
The application is a selling platform for general goods.


#4

Never mind guys its now working. It must have been a network problem.


#5

when i use my newly created key and ID im getting an error

TypeError: Object of type InitResponse is not JSON serializable

.

But when i use a collegues credentials im getting prompts on mobile with no hustle.

is there a problem with my key and id or there is additional information that i am supposed to send for them to work well using the python SDK


#6

A newly created key and id is by default in test mode. This means you can only make transactions using testing numbers provided by paynow.
You have to request to be set to live in order to perform actual transactions, but for your request to be successful you have to make atleast one test transactions.


#7

Yeah that part i understand clearly thanks. In test mode i was hoping to get the prompts unless you are saying thats only possible when i request to be pointed to live.

So using the same keys i can do test runs and one of my process flows i made is a person can checkout via a confirmation link on web like the one below.

{
“success”: true,
“url”: “https://www.paynow.co.zw/Payment/ConfirmPayment/80031”
}

the other option was where one gets a USSD push for the MNO’S then the put their PIN and transaction complete. So on test this is where this second option is giving me and error when i use the Python SDK using my keys but working with my colleagues


#8

when in test mode USSD push notification not showing up for me also. I think it only works when you’re pointed live.


#9

Hie Did you find a solution for this. ?


#10

If your account is still in testing mode , you will not get a USSD prompt . The only numbers you can test with are detailed at this link


#11

Managed to Fake transactions but the responses seemed to respond with status.paid = False on the on

Success – 0771111111

. Non the less i do get email notifications of a Faked success
print(status.paid)
print(status.paynow_reference)
print(status.amount)
print(status.reference)

Result

False
8128031
2623.0
Order

{
“message”: false,
“paynow_reference”: “8129043”,
“amount”: 2623.0,
“order_reference”: “Order”
}

Is it the correct response i should get in test assuming that on Live a Successful payment will respond with status.paid = True?


#12

Works fine in live, haven’t had a single problem


#13

@root its not returning True in live mode, i have done all testing and it worked fine with the preconfigured numbers, i applied for Live mode and i got approved but
status.paid is returning False in live environment yet money has been deducted from my mobile wallet account


#14

Fixed, took all paynow PRs in consideration maybe it was my code or actual issue in the library, not sure now but im glad its working now😑


#15

Oh yea forgot to mention that you cant test mobile checkouts. For some reason the paynow server does not return a hash for the transaction.


#16

@chamunzira, @DonnC. Paynow returns different statuses depending on the state of the transaction e.g. ‘Awaiting Delivery’ in general terms means the transaction has been paid for by the client but if you are not a verified merchant and have not applied to be removed from the BuySafe list the money will remain held in PayNow coffers until you or the client confirm delivery of the goods or service. When you or the client confirms delivery, the status changes to ‘Delivered’ until the 24hr waiting period expires and then changes to ‘Paid’ afterwards waiting for the next settlement.

That said, you shouldn’t lookout for just the ‘Paid’ status in order to confirm that the client has paid successfully, also consider all the other statuses and their meaning and give your client the appropriate response.

You can get the full explanation in the API reference here https://developers.paynow.co.zw/docs/status_update.html


#17

Wow thank you for that, might have missed this in the docs somewhere. So best workaround is to rely on the Result Url ?


#18

Right about that Root


#19

what about integration of python with paypal any idea ??


#20

this is good…so how to i integrate with in-bucks using this send_mobile method