08-16-2023 07:22 AM
Hey faugermire1. I was frustrated with this issue as well. With the age of the package, I decided to just use requests to make the calls. Fundamentally they are using requests.post of an xml object. I am using constants.SANDBOX to get the dev environment url and constants.PRODUCTION to get the production environment url. With the url I'm making a call to requests.post. I'm using a json object instead of xml for readability and so I could test with the Live API call json objects.
Ex:
def get_portal_token(self, amount, profile, line_items):
if Config.get('PAYMENT_PORTAL', 'dev'):
url = constants.SANDBOX
else:
url = constants.PRODUCTION
r = requests.post(url, json={
"getHostedPaymentPageRequest": {
"merchantAuthentication": self.get_merchant_auth(),
"transactionRequest": self.get_transaction_request(amount, profile, line_items),
"hostedPaymentSettings": {
"setting": self.get_portal_settings()
}
}
})
return json.loads(r.text[1:])
08-18-2023 11:15 AM
Hey there,
I totally get where you're coming from! It looks like you're running into a snag with the 'authorizenet' Python package because of some changes in Python versions, right? The error you're facing is because of this 'pyxb' thing which sadly doesn't play well with newer Python versions. The good news is, there's this cool fix-up package called 'PyXB-X' that's designed to work with the latest Python versions. You can easily swap out the old 'pyxb' with 'PyXB-X' and get your app back on track. Hope that helps!
Was this response better or worse?
Better
Worse
Same
08-19-2023 11:48 PM - edited 08-19-2023 11:49 PM
@ericfc wrote:
Hey there,
I totally get where you're coming from! It looks like you're running into a snag with the 'authorizenet' Python package because of some changes in Python versions, right? The error you're facing is because of this 'pyxb' thing which sadly doesn't play well with newer Python versions. The good news is, there's this cool fix-up package called 'PyXB-X' that's designed to work with the latest Python versions. You can easily swap out the old 'pyxb' with 'PyXB-X' and get your app back on track. Hope that helps!
Was this response better or worse?
Better
Worse
Same
I hope my this reply is very helpful to you.
08-20-2023 11:15 PM - edited 08-20-2023 11:21 PM