Skip to content

consumer_key and consumer_secret need to be renamed #2

@wwmwabini

Description

@wwmwabini

Using the same name for the consumer_key and consumer_secret variables throws an error of UnboundLocalError: local variable 'consumer_key' referenced before assignment.

Renaming the global variables as follows and replacing them inside the get_access_token() and _access_token() functions fixes the issue


consumerkey = 'xxxxxxx'
consumersecret = 'yyyy'

...


def get_access_token():
    consumer_key = consumerkey
    consumer_secret = consumersecret
    endpoint = 'https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions