Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo Preventing API use #4

Open
sktzofrenic opened this issue Jul 5, 2019 · 2 comments
Open

Typo Preventing API use #4

sktzofrenic opened this issue Jul 5, 2019 · 2 comments

Comments

@sktzofrenic
Copy link

sktzofrenic commented Jul 5, 2019

I tried do a simple card charge transaction from the docs:

response = card.charge(10) \
    .with_currency('USD') \
    .with_address(address) \
    .execute()

Here is the response I received:

danwinsrx.globalpayments.api.entities.exceptions.GatewayException: Unexpected http status code [500]

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Sender</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text xml:lang="en">Unable to process request.  Message failed validation.  The element \'Header\' in namespace \'http://Hps.Exchange.PosGateway\' has invalid child element \'VersionNumber\' in namespace \'http://Hps.Exchange.PosGateway\'. List of possible elements expected: \'UniqueDeviceId, LicenseId, Password, SiteId, DeviceId, GPSCoordinates, ClerkID, CredentialToken, ClientTxnId, DeviceConfiguration, SiteTrace, PosReqDT, VersionNbr, UserName, x_global_transaction_id\' in namespace \'http://Hps.Exchange.PosGateway\'.  (line#1,pos#265)</soap:Text>
            </soap:Reason>
            <soap:Node>http://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway/PosGatewayService.asmx</soap:Node>
            <soap:Detail />
        </soap:Fault>
    </soap:Body>

Here is the issue:

        if self.version_number is not None:
            et.SubElement(header, 'VersionNumber').text = self.version_number  <----------- SHOULD BE 'VersionNbr'
        if client_transaction_id is not None:
            et.SubElement(header, 'ClientTxnId').text = client_transaction_id

et.SubElement(header, 'VersionNumber').text = self.version_number

@sktzofrenic sktzofrenic changed the title Type Preventing API use Typo Preventing API use Jul 5, 2019
@j3pic
Copy link

j3pic commented Nov 13, 2020

Looks like the problem is fixed in the latest version (the code says VersionNbr instead of VersionNumber), but I'm still getting the same HTTP status, except instead of an informative XML body, the response comes with a generic HTML body that contains no details about the error. I'm completely unable to diagnose the problem.

@sktzofrenic
Copy link
Author

I forked this repository and have my own working copy of it that I maintain. Unfortunately there really isn't any active development or maintenance being done here and the code base is a bit over engineered which may be contributing to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants