globalpayments / python-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
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
Hi,
My software verification process got failed due to not requesting for AVS and CVV verification. The review team explained the app is not requesting for CVV and AVS verification.
Actually I designed my app to first request for token from the card details collected.
Tokenization snippet
response=card.verify().with_currency('USD').with_address(address).with_request_multi_use_token(True).with_allow_duplicates(True).execute()
I can get token from response and I use the same token to Authorize the card and charge it.
Authorize and Charge snippet
authorize_response = card.authorize(total_total).with_currency("USD").with_address(address).execute() payment_response = Transaction.from_id(authorize_response.transaction_id).capture(total_total).execute()
On charge response I get response code 00 and status APPROVAL. Where I am missing AVS and CVV verification here. I could not find any documentation on this. Thank you.
Currently the example of how to set the expiry date for a card is shown as:
card.exp_month = '01'
card.exp_year = '2019'
However, the <expdate>
tag with the request sent to the API is being incorrectly set, so for the example above the <expdate>
would be set to 2020
.
The reason for this is the short_code
property against the CreditCardData
class:
@property
def short_expiry(self):
'''
The card's expiration date in `MMYY` format.
'''
month = str(self.exp_month).zfill(2)
year = str(self.exp_year).zfill(4)[:2]
return '{}{}'.format(month, year)
The year assignment selects the first 2 digits of the year not the last 2, it needs to be:
year = str(self.exp_year).zfill(4)[2:]
Hi there!
We wonder know if is there a way to implement MIT operations for recurrent payments with this SDK and if are there any samples that could guide us in this trip.
Thank you in advance,
Pere
@MSmedal , any help or guide on that will be apreciated!
If you're seeing the following error on any card/transaction requests;
File "/<removed>/lib/python3.8/site-packages/xmltodict.py", line 327, in parse
parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: out of memory: line 1, column 0
And have Expat >= 2.4.5
installed, then see martinblech/xmltodict#289 for some insight.
Hi,
Is there a reason why hosted_service.py is empty? I'm looking for the HostedService class.
Is this SDK capable of handling HPP funcionality described here: https://developer.globalpay.com/hpp/card-payments or this SDK is just not complete yet ? If that so, is there any intention to complete the missing funcionality?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.