<commit_before>

To install:

add to routes: 
```
mount PpLogin::Engine => "/pp_login"
```

for setup in an initializer file put in

```
PpLogin.setup do |config|
  config.id = "PayPal App ID"
  config.secret = "PayPal App secret"
  config.website_url = "website_URL" #just put your website URL here, just let the engine handle the rest.
  config.redirect_url = 'redirect_url' #put here where you want the engine to redirect to after it's gotten the access token/user_info, if left out it defaults to the website_url.
  config.mode = "sandbox" #or 'live'
  config.scope = 'scope' #not really needed as it defaults to 'openid email'
  config.token_store = :param # or:session, :cookie, :db, will default to :session if no value is supplied. How you want the engine to deal with the access token, see token store to understand the different options. 
  config.token_model = :model_name # if token_Store is set to :db then this is the name of the model to store it into.
  config.user_store = :param #same as token_store
  condif.user_model = :model_name #same as token_model
end
```

The helpers are:

.get_token_path = the path that paypal login will redirect to.
.refresh_token_path = the path you can use to refresh the access token (expects `:refresh_token` param).
.user_info_path = the path you can use to retreive user info (expects 
`:access_token` param)
.logout_path = the path you can use to logout the user with (expects 
`:refresh_token` param.

to use these helpers include `PpLogin::Helpers` within your application_controller.

user_info = will automaticly return the user info after having been re-directed from the engine

token = will automaticly return the token values after having been re-directed by from the engine
Token Store

There are several methods to deal with the token
:param, will return token values as a param in the URL bar `:token`/`:user`, it's pre-parsed to json. (not secure)
:session, will store token in session under `:token`/`:user`, it's pre-parsed to json.
:cookie, will store token in cookies under `:token`/`:user`,it's pre-parsed to json.
:db, will store token into DB model that you supply (not implemented yet)<commit_msg>Updates readme<commit_after>

To install and setup just follow the following:

add to routes: 
```
mount PpLogin::Engine => "/pp_login"
```

for setup in an initializer file put in

```
PpLogin.setup do |config|
  config.id = "PayPal App ID"
  config.secret = "PayPal App secret"
  config.website_url = "website_URL" #just put your website URL here, just let the engine handle the rest.
  config.redirect_url = 'redirect_url' #put here where you want the engine to redirect to after it's gotten the access token/user_info, if left out it defaults to the website_url.
  config.mode = "sandbox" #or 'live'
  config.scope = 'scope' #not really needed as it defaults to 'openid email'
  config.token_store = :param # or:session, :cookie, :db, will default to :session if no value is supplied. How you want the engine to deal with the access token, see token store to understand the different options. 
  config.token_model = :model_name # if token_Store is set to :db then this is the name of the model to store it into.
  config.user_store = :param #same as token_store
  condif.user_model = :model_name #same as token_model
end
```

The helpers are:

- get_token_path = the path that paypal login will redirect to.
- refresh_token_path = the path you can use to refresh the access token (expects `:refresh_token` param).
- user_info_path = the path you can use to retreive user info (expects 
`:access_token` param)
- logout_path = the path you can use to logout the user with (expects 
`:refresh_token` param.

to use these helpers include `PpLogin::Helpers` within your application_controller.

- user_info = will automaticly return the user info after having been re-directed from the engine

- token = will automaticly return the token values after having been re-directed by from the engine
Token Store

There are several methods to deal with the token
- :param, will return token values as a param in the URL bar `:token`/`:user`, it's pre-parsed to json. (not secure)
- :session, will store token in session under `:token`/`:user`, it's pre-parsed to json.
- :cookie, will store token in cookies under `:token`/`:user`,it's pre-parsed to json.
- :db, will store token into DB model that you supply (not implemented yet)
{'fraction_non_alphanumeric': 0.08009101251422071, 'fraction_numerical': 0.0, 'mean_word_length': 4.360975609756098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4344569', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1270, 'n_words': 616}