def validate(self): gateway = AfricasTalkingGateway(self.APP_USERNAME, self.API_KEY) try: # Initiate the request with the transacitonId that was returned # by the charge request. If there are no exceptions, that means # the transaction was completed successfully gateway.bankPaymentCheckoutValidation( transactionId_ = 'ATPid_14963d9d924c7f200421a47d4f79e94c', otp_ = "1234" ) print 'The transaction was completed successfully' except AfricasTalkingGatewayException, e: print 'Encountered an error while sending: %s' % str(e)