Giter Club home page Giter Club logo

2checkout-python's People

Contributors

craigchristenson avatar gjedeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

2checkout-python's Issues

Failing tests

When running the tests, there are five tests failing:

test_1_auth (__main__.AuthorizationTest) ... FAIL
test_1_retrieve (__main__.CompanyTest) ... ok
test_1_create (__main__.ContactTest) ... ok
test_1_create (__main__.CouponTest) ... ok
test_2_find (__main__.CouponTest) ... ok
test_3_update (__main__.CouponTest) ... ok
test_4_delete (__main__.CouponTest) ... ok
test_1_check (__main__.NotificationTest) ... ok
test_1_create (__main__.OptionTest) ... ok
test_2_find (__main__.OptionTest) ... ok
test_3_update (__main__.OptionTest) ... ok
test_4_delete (__main__.OptionTest) ... ok
test_5_list (__main__.OptionTest) ... ok
test_1_check (__main__.PassbackTest) ... ok
test_1_pending (__main__.PaymentTest) ... FAIL
test_2_list (__main__.PaymentTest) ... ok
test_1_create (__main__.ProductTest) ... ok
test_2_find (__main__.ProductTest) ... ok
test_3_update (__main__.ProductTest) ... ok
test_4_delete (__main__.ProductTest) ... ok
test_5_list (__main__.ProductTest) ... ok
test_1_find_sale (__main__.SaleTest) ... ok
test_2_list_sale (__main__.SaleTest) ... ok
test_3_refund_sale (__main__.SaleTest) ... FAIL
test_4_refund_invoice (__main__.SaleTest) ... FAIL
test_5_refund_lineitem (__main__.SaleTest) ... FAIL
test_6_stop_sale (__main__.SaleTest) ... ok
test_7_comment (__main__.SaleTest) ... ok
test_7_stop_invoice (__main__.SaleTest) ... ok
test_8_ship (__main__.SaleTest) ... ok
test_9_reauth (__main__.SaleTest) ... ok

609 Error code

Hello everybody,
I have got issue, and i don't know how to solve it. When I click submit button in my form to authorize payments, i get "Payment Authorization Failed: Payment method is not supported. Please use a different payment method." error. This is 609 code. I have not ideas how to solve, because i think it is on 2checkout's side or i passed invalid params. Please correct me!
P.S. I've already read information from https://verifone.cloud/docs/2checkout/API-Integration/Legacy-API-versions/Legacy-2Checkout-API/Payment-API/Create-a-sale
Снимок экрана 2022-04-01 в 20 34 49

Allow simultaneous use of multiple API credentials and modes

There is a problem when the application must simultaneously use the API with a variety of sellers (with different private_key, seller_id, username, password) and modes (sandbox/production).

I'd suggest not directly using the Api object and class methods and instead passing an instance of an Api object (with proper instance methods) to the Charge, Company, Contact, Coupon, etc. class methods.

I can work in this enhancement if anyone cares to merge it, as we definitely need multiple of our clients have their own 2Checkout API keys.

The library doesn't work

After installation I get an ImportError:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vagrant/2checkout-python/twocheckout/__init__.py", line 1, in <module>
    from sale import Sale
ImportError: No module named 'sale'

The complete file structure is not correct if I look into __init__.py, because there are only python files in the twocheckout folder and no other folders like here:

from sale import Sale
from api_request import Api
from util import Util
from passback import Passback
from ins import Notification
from product import Product
from option import Option
from coupon import Coupon
from contact import Contact
from company import Company
from charge import Charge
from payment import Payment
from error import TwocheckoutError

So If I then cd 2checkout-python/twocheckout and do the import twocheckout from there it works, but then gives me errors in the further work process:
AttributeError: module 'twocheckout' has no attribute 'Api'

What should I do? I am using python3 and I have installed it as described here:
Or is this instruction wrong? Because there is no difference to the python2 instruction?

Please advise

UnicodeDecodeError in 3.x branch when handling response

The following seems to be fixed in master branch
File "/opt/odoo/11.0/env/lib/python3.6/site-packages/twocheckout/api_request.py", line 40,
in call
result = raw_data.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 1239: invalid
continuation byte

Suddenly getting json.decoder.JSONDecodeError

Suddenly getting this error during authorization request:

File "C:\Users\Nik\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Nik\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I'm using the exact same test code as before:

@blueprint.route('/order', methods=['POST'])
def order():
    # Setup credentials and environment
    twocheckout.Api.auth_credentials({
        'private_key': 'my-private-key',
        'seller_id': 'my-id'
    })
# Setup arguments for authorization request
args = {
    'merchantOrderId': '123',
    'token': request.form["token"],
    'currency': 'USD',
    'total': '1.00',
    'billingAddr': {
        'name': 'Testing Tester',
        'addrLine1': '123 Test St',
        'city': 'Columbus',
        'state': 'OH',
        'zipCode': '43123',
        'country': 'USA',
        'email': '[email protected]',
        'phoneNumber': '555-555-5555'
    }
}

# Make authorization request
try:
    result = twocheckout.Charge.authorize(args)
    return result.responseCode
except TwocheckoutError as error:
    return error.msg`

Anyone knows how to resolve it?

No module named 'sale'

I'm getting an error:

.........\site-packages\twocheckout\__init__.py", line 1, in <module>
from sale import Sale
ModuleNotFoundError: No module named 'sale'

Even if I remove sale reference from init.py file, just for testing, I'm getting a new error for the next line:

\venv\lib\site-packages\twocheckout\__init__.py", line 2, in <module>
from api_request import Api
ModuleNotFoundError: No module named 'api_request'

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.