Giter Site home page Giter Site logo

Comments (4)

patvdleer avatar patvdleer commented on June 2, 2024

So if you leave the app name empty this will cause an error in the requests

class HTTPClient(object):
    def __init__(self, app_name, user_agent_suffix,
                 lib_version, force_request=None):
        # Check if requests already available, default to urllib
        self.user_agent = app_name + " " + user_agent_suffix + lib_version

from adyen-python-api-library.

AlexandrosMor avatar AlexandrosMor commented on June 2, 2024

Hello @patvdleer,

Indeed if the appname is empty cause error in the request. Is there a specific reason why the appname should be empty for you ?

kind regards,
Alexandros

from adyen-python-api-library.

patvdleer avatar patvdleer commented on June 2, 2024

No I was testing and the params of the function allowed it, why not require the param? The error InvalidHeader which this causes doesn't make it clear you need to set the app name.

The functions before accept empty param while there are actually required down the line.

This seems to be everywhere, take payment_methods for example, request should not be optional, what am I missing? why is this defaulted to an empty string?

class AdyenCheckoutApi(AdyenServiceBase):
    def __init__(self, client=""):
        super(AdyenCheckoutApi, self).__init__(client=client)
        self.service = "Checkout"

    def payment_methods(self, request="", **kwargs):
        action = "paymentMethods"
        if 'merchantAccount' in request:
            if request['merchantAccount'] == '':
                raise ValueError(
                    'merchantAccount must contain the merchant account'
                    ' when retrieving payment methods.')

        return self.client.call_checkout_api(request, action, **kwargs)

from adyen-python-api-library.

AlexandrosMor avatar AlexandrosMor commented on June 2, 2024

@patvdleer,
We created an internal issue and we are going to pick it up as soon as possible. For now you can pass a dummy app_name so you can continue with the integration.

regards,

from adyen-python-api-library.

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.