-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abruf von Punkten nicht möglich #1
Comments
Ich habe das gleiche Problem seit ein paar Tagen. "pull-right" zum xpath in Zeile 171 hinzuzufügen bringt einen zwar weiter, löst das Problem aber noch nicht ganz - dann findet er in Zeile 208 die pointRangeForm nicht... |
Hallo @uwe-schwarz und @philwo , ich kann das Problem bei mir nicht reproduzieren. Danke, |
Das sollte das komplette Log sein. |
Habt ihr schon meine Version hier ausgetestet?? @philwo - kannst du diese Version bitte testen? Danke... |
Hi @uwe-schwarz, danke für die Bereitstellung des Logfiles. Ich tippe ganz stark, dass die neue Pre-Release Version 1.1 (https://github.com/jgoldhammer/moneymoney-payback/releases/tag/v1.1) dein Problem lösen wird. Danke, |
Die neue Version ist online: Bitte um Rückmeldung- danke! |
Das ging schnell, nun scheitert es aber an der nächsten Stelle: Payback-Punkte.lua:208: bad argument #1 to 'request' (string expected, got no value) |
Hi @jgoldhammer - vielen Dank für die neue Version! Ich habe den gleichen Fehler wie @uwe-schwarz: Brauchst du ein Logfile, oder kannst du das bei dir so reproduzieren? |
Hallo @philwo, hallo @uwe-schwarz , ich kann mir den Fehler bisher nicht erklären. Bitte schreibt mir außerdem die URL vom Browser, wenn ihr eingeloggt seid... Im Logfile ist das leider nicht drin... Danke, |
Im Browser (sowohl Safari als auch Chrome) ist das bei mir wie vorher (also ohne das pull-right und auch mit dem pointRangeForm), ich kann später mal versuchen MoneyMoney dazu zu überreden einen mitmproxy zu benutzen und dann kann ich dir mehr Infos geben. Die URL ist bei mir auch "https://www.payback.de/pb/punktekonto/id/13598/". |
So wie das für mich aussieht funktioniert der Login nicht. Erster Request: curl -H 'host:www.payback.de' -H 'Connection:keep-alive' -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17' -H 'Referer:https://www.payback.de/pb/authenticate/id/713416/#loginSecureTab' -H 'Accept-Language:de-de' -H 'Accept-Encoding:gzip, deflate' 'https://www.payback.de/pb/authenticate/id/713416/' Zweiter Request: curl -H 'host:www.payback.de' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Origin:https://www.payback.de' -H 'Cookie:JSESSIONID=xxx; plg_sec=xxx; pd_cookie=''; notepad=x; __utma=x; __utmb=x; __utmc=x; __utmt=x; __utmv=x; __utmz=x; ga=x; gat=x; BIGipServerpool_pbde_prod_www=xxx' -H 'Content-Length:200' -H 'Connection:keep-alive' -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17' -H 'Referer:https://www.payback.de/pb/authenticate/id/713416/#loginSecureTab' -H 'Accept-Language:de-de' -H 'Accept-Encoding:gzip, deflate' -X POST 'https://www.payback.de/pb/ww/authenticate.password.action' --data-binary 'model.alias=xxx&password=xxx&__checkbox_usePermLogin=true&usePermLogin=true&token=xxx&did=xxx&page_id=xxx&language=&cid=xxx&secToken=' Kannst du damit was anfangen oder soll ich dir mehr zur Verfügung stellen? |
Ich habe gerade mal mein Passwort geändert und die Kontenliste in MoneyMoney neu abgefragt, da kommt folgende Fehlermeldung: Payback-Punkte.lua: expected string for 'account.accountNumber' |
Hallo Uwe, VG, |
Hallo zusammen, ein kurzer Zwischenstand nach Debugging mit mitmproxy und der Webseite im Chrome:
Ich versuche jetzt herauszufinden,wie die Cookies erzeugt werden- z.B. UserID1 - das Cookie wird nicht vom Server gesetzt, jedenfalls sehe ich das in den Responses nicht. Gleichzeitig finde ich aber keinen clientseitigen Code zum Erzeugen der UserID1... Habt ihr noch Ideen, wie ich das herausbekomme? BTW, Payback schützt seine User nicht gegen Session Fixation (https://de.wikipedia.org/wiki/Session_Fixation)- die JSESSIONID wird beim Einloggen nicht erneuert... |
Die UserID1 wird über einen Request zu https://mpm.payback.de/js?wp_id=XXX generiert und wird scheinbar auch fürs Advertising benutzt... |
Gibt es hierzu was neues, @jgoldhammer? |
Jetzt ja. Zumindest bei mir funktioniert es plötzlich wieder. |
Wow, bei mir leider nicht... payback.lua:236: attempt to concatenate a nil value |
Ich war auch ganz überrascht. Hatte die Extension die ganze Zeit bei mir drin gelassen, und plötzlich kamen heute die ganzen fehlenden Umsätze rein. Ich hatte damals auch (erfolglos) probiert, die Extension wieder zum laufen zu bringen, daher bin ich mir gerade nicht mehr sicher, ob bei mir nun noch Änderungen von mir drin sind, oder ob ich die wieder zurückgesetzt hatte. Ich habe hier diese Version: -- ---------------------------------------------------------------------------------------------------------------------
--
-- MoneyMoney Web Banking Extension
-- http://moneymoney-app.com/api/webbanking
--
--
-- The MIT License (MIT)
--
-- Copyright (c) 2012-2015 MRH applications GmbH
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
-- ---------------------------------------------------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------------------------------------------
--
-- Get portfolio of Payback online account.
--
-- ATTENTION: This extension requires MoneyMoney version 2.2.2 or higher
--
-- ---------------------------------------------------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------------------------------------------
-- Common MoneyMoney extension informations
-- ---------------------------------------------------------------------------------------------------------------------
WebBanking {
version = 1.1,
country = "de",
url = "https://www.payback.de/pb/authenticate/id/713416/",
services = {"Payback-Punkte"},
description = string.format(MM.localizeText("Get points of %s"), "Payback account")
}
-- ---------------------------------------------------------------------------------------------------------------------
-- Helper functions
-- ---------------------------------------------------------------------------------------------------------------------
local function strToAmount(str)
-- Helper function for converting localized amount strings to Lua numbers.
print("raw value: ".. str)
local convertedValue = string.gsub(string.gsub(string.gsub(str, " .+", ""), "%.", ""), ",", ".")
print("converted value " .. convertedValue)
return convertedValue
end
-- ---------------------------------------------------------------------------------------------------------------------
local function strToAmountWithDefault(str, defaultValue)
-- Helper function for converting localized amount strings to Lua numbers with a default value.
local value = strToAmount(str)
if value == nil or value == "" then
value = defaultValue
end
return value
end
-- ---------------------------------------------------------------------------------------------------------------------
local function strToDate(str)
-- Helper function for converting localized date strings to timestamps.
local d, m, y = string.match(str, "(%d%d)%.(%d%d)%.(%d%d%d%d)")
if d and m and y then
return os.time { year = y, month = m, day = d, hour = 0, min = 0, sec = 0 }
end
end
-- ---------------------------------------------------------------------------------------------------------------------
local function printElementWithPrefix(prefix, element)
-- Helper function for debugging HTML elements with a prtinable prefix
if element:children():length() >= 1 then
element:children():each(function(index, element2)
local newPrefix = prefix .. "-" .. index
print(newPrefix .. "=" .. element2:text())
printElementWithPrefix(newPrefix, element2)
end)
end
end
-- ---------------------------------------------------------------------------------------------------------------------
local function strToFullDate (str)
-- Helper function for converting localized date strings to timestamps.
local d, m, y = string.match(str, "(%d%d).(%d%d).(%d%d%d%d)")
return os.time{year=y, month=m, day=d}
end
local function printElement(element)
-- Helper function for debugging HTML elements
printElementWithPrefix('0', element)
end
-- ---------------------------------------------------------------------------------------------------------------------
-- The following variables are used to save state.
-- ---------------------------------------------------------------------------------------------------------------------
local connection
local overview_html
-- ---------------------------------------------------------------------------------------------------------------------
--
-- MoneyMoney API Extension
--
-- @see: http://moneymoney-app.com/api/webbanking/
--
-- ---------------------------------------------------------------------------------------------------------------------
function SupportsBank(protocol, bankCode)
-- Using artificial bankcode to identify the DWS Investments group.
return bankCode == "Payback-Punkte" and protocol == ProtocolWebBanking
end
-- ---------------------------------------------------------------------------------------------------------------------
function InitializeSession(protocol, bankCode, username, customer, password)
print("InitializeSession with " .. protocol .. " connecting " .. url .. "with ".. username)
MM.printStatus("Start to login...")
-- Create HTTPS connection object.
connection = Connection()
connection.language = "de-de"
-- Fetch login page.
local loginPage = HTML(connection:get(url))
-- Fill in login credentials.
loginPage:xpath("//*[@id='aliasInputSecure']"):attr("value", username)
loginPage:xpath("//*[@id='passwordInput']"):attr("value", password)
MM.printStatus("parameters filled in ");
-- Submit login form.
local request = connection:request(loginPage:xpath("//input[@id='loginSubmitButtonSecure']"):click())
MM.printStatus("request " ..request)
overview_html = HTML(request)
-- Check for failed login.
local failure = overview_html:xpath("//*[@id='errorNotification']")
if failure:length() > 0 then
print("Login failed. Reason: " .. failure:xpath("//*p[@class='MsoNormal']"))
MM.printStatus("Login failed...");
return LoginFailed
end
MM.printStatus("Login success- go to correct paypack page ");
-- hard coded point url ...
overview_html = HTML(connection:get("https://www.payback.de/pb/punktekonto/id/13598/"))
print("Session initialization completed successfully.")
MM.printStatus("Login successfull...")
return nil
end
-- ---------------------------------------------------------------------------------------------------------------------
function ListAccounts(knownAccounts)
local accountNumber = overview_html:xpath("//p[text()='Kundennummer:']/span"):text();
-- Supports only one account
local account = {
owner = overview_html:xpath("//*/p[@class='welcome-msg']/strong"):text(),
name = "Paypack Punkte Konto (" .. accountNumber .. ")",
accountNumber = accountNumber,
portfolio = false,
currency = "EUR",
type = AccountTypeUnknown
}
return { account }
end
-- ---------------------------------------------------------------------------------------------------------------------
function RefreshAccount(account, since)
local transactions = {}
-- the datefields can be filled directly
overview_html:xpath("//input[@id='date1']"):attr("value", os.date("%d.%m.%Y", since))
overview_html:xpath("//input[@id='date2']"):attr("value", os.date("%d.%m.%Y"))
MM.printStatus("Fill in date ranges")
print("Submitting transaction search form for " .. account.accountNumber)
overview_html = HTML(connection:request(overview_html:xpath("//form[@id='pointRangeForm']"):submit()))
-- Get paypack points from text next to select box
local balance = overview_html:xpath("//span[@id='serverPoints']"):text()
-- eleminate the dot in the point number and divide it with 100 to get the euro equivalent
balance = string.gsub(balance,"%.","")/100
MM.printStatus("balance " .. balance)
local firstPage =true;
repeat
local noMorePages = true;
-- Check if the HTML table with transactions exists.
if overview_html:xpath("//table[@class='mypoints']/tbody/tr[1]/td[1]"):length() > 0 then
-- Extract transactions.
overview_html:xpath("//table[@class='mypoints']/tbody/tr[position()>0]"):each(function (index, row)
local columns = row:children()
local transaction = {
valueDate = strToFullDate(columns:get(1):text()),
bookingDate = strToFullDate(columns:get(1):text()),
name = columns:get(2):text(),
purpose = columns:get(3):text() .. " : " .. columns:get(4):text(), true,
currency = "EUR",
amount = strToAmount(columns:get(4):text(), true)/100
}
table.insert(transactions, transaction)
end)
local linkCounter
if firstPage then
linkCounter = 1
else
linkCounter = 2
end
local nextPageLink = overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]");
-- check website for more pages to extract transactions for
if nextPageLink:length()> 0 then
local link = overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]")
overview_html = HTML(connection:request(overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]"):click()))
noMorePages = false;
firstPage=false;
MM.printStatus("Getting more transactions...")
end
end
until (noMorePages);
-- Return balance and array of transactions.
return {balance=balance, transactions=transactions, securities=nil}
end
-- ---------------------------------------------------------------------------------------------------------------------
function EndSession()
-- Submit logout form.
local logout_html = HTML(connection:request(overview_html:xpath("//a[@id='pbLogin']"):click()))
print("Logged out successfully!")
end
-- SIGNATURE: MCwCFEi7zhrUhPNbur7MrkmyRnKlNOyLAhQae47rAv1jHMPSfjiORltSOUXyAg== |
Habe MoneyMoney in der Version 2.2.17 (284) Beta. |
Funktioniert weiterhin. Ich musste nun allerdings den Logout-Aufruf auskommentieren. Da wird umgeleitet zu Nach Auskommentieren funktioniert es aber wieder, es wird dann halt nicht korrekt ausgeloggt. Ist aber die Frage, ob das überhaupt notwendig ist. |
Logout-Funktion funktioniert bei mir wieder und auch der Abruf mit Version 2.1 |
Fehler: Payback-Punkte.lua:171: bad argument #1 to 'request' (string expected, got no value)
Scheinbar bekommt er den div mit "secondary-nav tracking-event-module" nun als "secondary-nav pull-right tracking-event-module" zurück, vermutlich weil irgendwo die mobile Seite ausgewählt wird. Ich kann es leider nicht weiter debuggen, da ich keine Version mit deaktivierbarer Signaturprüfung habe.
The text was updated successfully, but these errors were encountered: