GithubHelp home page GithubHelp logo

Comments (10)

drewisme avatar drewisme commented on July 20, 2024

Can you provide some more details?

  • What is the full response from AuthNet?
  • Can you share the code that is throwing the error with credentials masked?

from authorizesauce.

wongyikfei avatar wongyikfei commented on July 20, 2024

The error I'm getting is "<urlopen error [Errno 54] Connection reset by peer>"

traceback:

Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Library/Python/2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Python/2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Python/2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/myfolder/apis.py", line 1768, in api_submit
cc, address=cc_address, email=email).capture(deposit_price)
File "/Library/Python/2.7/site-packages/authorize/client.py", line 131, in capture
amount, self.credit_card, self.address, self.email)
File "/Library/Python/2.7/site-packages/authorize/apis/transaction.py", line 136, in capture
return self._make_call(params)
File "/Library/Python/2.7/site-packages/authorize/apis/transaction.py", line 84, in _make_call
raise AuthorizeConnectionError(e)
AuthorizeConnectionError: <urlopen error [Errno 54] Connection reset by peer>

The code:

  client = authorize.AuthorizeClient(
      app.config['AUTHORIZE_NET_ACCOUNT'],
      app.config['AUTHORIZE_NET_KEY'])

  cc = authorize.CreditCard(credit_card_num, validate_year, validate_month,
                            secure_code, credit_card_holder)
  cc_address = authorize.Address(street=street_address,
                                 city=city,
                                 state=state,
                                 zip_code=zip_code)
  transaction = client.card(
      cc, address=cc_address, email=email).capture(deposit_price)

I keep receiving connection error from the above code, only in sandbox condition, for the production it works fine.

from authorizesauce.

drewisme avatar drewisme commented on July 20, 2024

It doesn't look like the client is in sandbox mode. Can you try the following?
client = authorize.AuthorizeClient( app.config['AUTHORIZE_NET_ACCOUNT'], app.config['AUTHORIZE_NET_KEY'], debug=True)

from authorizesauce.

wongyikfei avatar wongyikfei commented on July 20, 2024

I tried both, with and without <debug=True>, both return the same result

from authorizesauce.

wongyikfei avatar wongyikfei commented on July 20, 2024

The debug code worked just fine for over an year. The problem suddenly appears when we upgrade authorizeSauce from 4.1 to 5.0.

from authorizesauce.

drewisme avatar drewisme commented on July 20, 2024

Can you print "self.url" and "params" before line 79 in "/Library/Python/2.7/site-packages/authorize/apis/transaction.py"? I can try to reproduce the issue.

from authorizesauce.

wongyikfei avatar wongyikfei commented on July 20, 2024

self.url: https://test.authorize.net/gateway/transact.dll

params: x_login=6f6qM7F3&x_zip=47906&x_card_num=6011000000000012&x_amount=2000.00&x_card_code=321&x_tran_key=3Ln22J6Y4Laa47s7&x_city=West+Lafayette&x_country=US&x_version=3.1&x_state=IN&x_first_name=asd&x_address=210+W+Wood+St%2C+Apt+4&x_exp_date=07-2022&x_email=wongyikfei%40gmail.com&x_delim_data=TRUE&x_delim_char=%3B&x_type=AUTH_CAPTURE&x_test_request=FALSE

from authorizesauce.

drewisme avatar drewisme commented on July 20, 2024

I tested this in Python 2.7.13 and Python 3.4.2 with no issues. Here's the response as expected:
1;1;1;This transaction has been approved.;D4YVGJ;Y;40004993314;;;2000.00;CC;auth_capture;;asd;;;210 W Wood St, Apt 4;West Lafayette;IN;47906;US;;;[email protected];;;;;;;;;;;;;;F7EDD54EC4625B881C6F1373E2A0C4F1;P;2;;;;;;;;;;;XXXX0012;Discover;;;;;;;;;;;;;;;;;

Seems like you might have a connection issue with "https://test.authorize.net/". Do you have any manual overrides for this domain?

from authorizesauce.

drewisme avatar drewisme commented on July 20, 2024

This may provide some insight:
https://community.developer.authorize.net/t5/Integration-and-Testing/AIM-Transactions-with-Java-SDK-SSL-TLS-issue/td-p/13114

from authorizesauce.

wongyikfei avatar wongyikfei commented on July 20, 2024

I believe that I did not have any manual overrides for the domain, but I think I start to figure out what's going wrong here.

I'm using Python 2.7.10, it returned the error. But when I tried 2.7.11 in my virtual environment, the code has run successfully. It seems that It might be something related to python version.

EDIT: My windows machine passed the test, but my Mac machine still reporting the same error no matter which version I'm using. So weird... still investigating

from authorizesauce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.