Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
177
Issues
177
List
Boards
Labels
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
032f3130
Commit
032f3130
authored
Mar 06, 2020
by
Edouard Lambert
Committed by
Vincent A
Mar 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[swile] rename lunchr to swile
parent
a060c8c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
modules/swile/__init__.py
modules/swile/__init__.py
+2
-2
modules/swile/browser.py
modules/swile/browser.py
+8
-8
modules/swile/module.py
modules/swile/module.py
+6
-6
No files found.
modules/
lunchr
/__init__.py
→
modules/
swile
/__init__.py
View file @
032f3130
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
.module
import
Lunchr
Module
from
.module
import
Swile
Module
__all__
=
[
'
Lunchr
Module'
]
__all__
=
[
'
Swile
Module'
]
modules/
lunchr
/browser.py
→
modules/
swile
/browser.py
View file @
032f3130
...
@@ -34,13 +34,13 @@ from weboob.browser.browsers import APIBrowser
...
@@ -34,13 +34,13 @@ from weboob.browser.browsers import APIBrowser
from
weboob.capabilities.bank
import
Account
,
Transaction
from
weboob.capabilities.bank
import
Account
,
Transaction
class
Lunchr
Browser
(
APIBrowser
):
class
Swile
Browser
(
APIBrowser
):
BASEURL
=
'https://
api.lunchr.fr
'
BASEURL
=
'https://
customer-api.swile.co
'
def
__init__
(
self
,
login
,
password
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
login
,
password
,
*
args
,
**
kwargs
):
"""
LunchrBrowser needs login and password to fetch Lunchr
API"""
"""
SwileBrowser needs login and password to fetch Swile
API"""
super
(
Lunchr
Browser
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
Swile
Browser
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
# self.session.headers are the HTTP headers for
Lunchr
API requests
# self.session.headers are the HTTP headers for
Swile
API requests
self
.
session
.
headers
[
'x-api-key'
]
=
'644a4ef497286a229aaf8205c2dc12a9086310a8'
self
.
session
.
headers
[
'x-api-key'
]
=
'644a4ef497286a229aaf8205c2dc12a9086310a8'
self
.
session
.
headers
[
'x-lunchr-app-version'
]
=
'b6c6ca66c79ca059222779fe8f1ac98c8485b9f0'
self
.
session
.
headers
[
'x-lunchr-app-version'
]
=
'b6c6ca66c79ca059222779fe8f1ac98c8485b9f0'
self
.
session
.
headers
[
'x-lunchr-platform'
]
=
'web'
self
.
session
.
headers
[
'x-lunchr-platform'
]
=
'web'
...
@@ -53,7 +53,7 @@ class LunchrBrowser(APIBrowser):
...
@@ -53,7 +53,7 @@ class LunchrBrowser(APIBrowser):
}
}
def
_auth
(
self
):
def
_auth
(
self
):
"""Authenticate to
Lunchr
API using self.credentials.
"""Authenticate to
Swile
API using self.credentials.
If authentication succeeds, authorization header is set in self.headers
If authentication succeeds, authorization header is set in self.headers
and response's json payload is returned unwrapped into dictionary.
and response's json payload is returned unwrapped into dictionary.
"""
"""
...
@@ -74,7 +74,7 @@ class LunchrBrowser(APIBrowser):
...
@@ -74,7 +74,7 @@ class LunchrBrowser(APIBrowser):
account
=
Account
(
id
=
Dict
(
'id'
)(
json
))
account
=
Account
(
id
=
Dict
(
'id'
)(
json
))
account
.
number
=
account
.
id
account
.
number
=
account
.
id
# weboob.capabilities.bank.BaseAccount
# weboob.capabilities.bank.BaseAccount
account
.
bank_name
=
'
Lunchr
'
account
.
bank_name
=
'
Swile
'
account
.
type
=
Account
.
TYPE_CHECKING
account
.
type
=
Account
.
TYPE_CHECKING
...
@@ -139,7 +139,7 @@ class LunchrBrowser(APIBrowser):
...
@@ -139,7 +139,7 @@ class LunchrBrowser(APIBrowser):
transaction
.
rdate
=
DateTime
(
Dict
(
'created_at'
))(
payment
)
transaction
.
rdate
=
DateTime
(
Dict
(
'created_at'
))(
payment
)
types
=
{
types
=
{
'ORDER'
:
Transaction
.
TYPE_CARD
,
# order on
lunchr
website
'ORDER'
:
Transaction
.
TYPE_CARD
,
# order on
swile
website
'LUNCHR_CARD_PAYMENT'
:
Transaction
.
TYPE_CARD
,
# pay in shop
'LUNCHR_CARD_PAYMENT'
:
Transaction
.
TYPE_CARD
,
# pay in shop
'MEAL_VOUCHER_CREDIT'
:
Transaction
.
TYPE_DEPOSIT
,
'MEAL_VOUCHER_CREDIT'
:
Transaction
.
TYPE_DEPOSIT
,
# type can be null for refunds
# type can be null for refunds
...
...
modules/
lunchr
/module.py
→
modules/
swile
/module.py
View file @
032f3130
...
@@ -23,20 +23,20 @@ from weboob.tools.backend import Module, BackendConfig
...
@@ -23,20 +23,20 @@ from weboob.tools.backend import Module, BackendConfig
from
weboob.tools.value
import
ValueBackendPassword
from
weboob.tools.value
import
ValueBackendPassword
from
weboob.capabilities.bank
import
CapBank
from
weboob.capabilities.bank
import
CapBank
from
.browser
import
Lunchr
Browser
from
.browser
import
Swile
Browser
__all__
=
[
'
Lunchr
Module'
]
__all__
=
[
'
Swile
Module'
]
class
Lunchr
Module
(
Module
,
CapBank
):
class
Swile
Module
(
Module
,
CapBank
):
NAME
=
'
lunchr
'
NAME
=
'
swile
'
DESCRIPTION
=
'
Lunchr
'
DESCRIPTION
=
'
Swile
'
MAINTAINER
=
'Roger Philibert'
MAINTAINER
=
'Roger Philibert'
EMAIL
=
'roger.philibert@gmail.com'
EMAIL
=
'roger.philibert@gmail.com'
LICENSE
=
'LGPLv3+'
LICENSE
=
'LGPLv3+'
VERSION
=
'2.1'
VERSION
=
'2.1'
BROWSER
=
Lunchr
Browser
BROWSER
=
Swile
Browser
CONFIG
=
BackendConfig
(
CONFIG
=
BackendConfig
(
ValueBackendPassword
(
'login'
,
label
=
'E-mail'
,
masked
=
False
),
ValueBackendPassword
(
'login'
,
label
=
'E-mail'
,
masked
=
False
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment