Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
58d12f7a
Commit
58d12f7a
authored
Dec 12, 2017
by
Nastuzzi Samy
Browse files
Merge branch 'release/v0.11.4' into develop
parents
dfe214d3
1a9ba500
Changes
3
Hide whitespace changes
Inline
Side-by-side
PayUTC 0.11.
3
.apk
→
PayUTC 0.11.
4
.apk
View file @
58d12f7a
No preview for this file type
app/src/main/AndroidManifest.xml
View file @
58d12f7a
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"fr.utc.simde.jessy"
android:versionCode=
"3
6
"
android:versionName=
"0.11.
3
"
>
android:versionCode=
"3
7
"
android:versionName=
"0.11.
4
"
>
<uses-permission
android:name=
"android.permission.NFC"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
...
...
app/src/main/java/fr/utc/simde/jessy/QRCodeReaderActivity.java
View file @
58d12f7a
...
...
@@ -51,9 +51,10 @@ public class QRCodeReaderActivity extends BaseActivity implements ZXingScannerVi
protected
List
<
String
>
apiName
;
protected
List
<
String
>
apiUrl
;
protected
List
<
Class
>
apiResponseClass
;
protected
List
<
Boolean
>
apiNeedKey
;
protected
List
<
Boolean
>
apiNeedGinger
;
protected
List
<
Class
>
apiResponseClass
;
protected
Object
apiResponse
;
@Override
public
void
onCreate
(
final
Bundle
savedInstanceState
)
{
...
...
@@ -71,11 +72,6 @@ public class QRCodeReaderActivity extends BaseActivity implements ZXingScannerVi
add
(
"https://www.lacomutc.fr/qr/"
+
sharedPreferences
.
getString
(
"key_"
+
apiName
.
get
(
1
),
"no_key"
)
+
"/"
);
}};
this
.
apiResponseClass
=
new
ArrayList
<
Class
>()
{{
add
(
BottomatikResponse
.
class
);
add
(
ComedmusResponse
.
class
);
}};
this
.
apiNeedKey
=
new
ArrayList
<
Boolean
>()
{{
add
(
true
);
add
(
false
);
...
...
@@ -86,6 +82,10 @@ public class QRCodeReaderActivity extends BaseActivity implements ZXingScannerVi
add
(
false
);
}};
this
.
apiResponseClass
=
new
ArrayList
<
Class
>()
{{
add
(
BottomatikResponse
.
class
);
add
(
ComedmusResponse
.
class
);
}};
this
.
scannerView
=
new
ZXingScannerView
(
QRCodeReaderActivity
.
this
)
{
@Override
protected
IViewFinder
createViewFinderView
(
Context
context
)
{
...
...
@@ -194,7 +194,6 @@ public class QRCodeReaderActivity extends BaseActivity implements ZXingScannerVi
});
API
api
=
new
API
(
QRCodeReaderActivity
.
this
,
apiName
.
get
(
apiIndex
),
apiUrl
.
get
(
apiIndex
));
APIResponse
apiResponse
=
null
;
if
(
apiNeedKey
.
get
(
apiIndex
))
api
.
setKey
(
sharedPreferences
.
getString
(
"key_"
+
apiName
.
get
(
apiIndex
),
""
));
...
...
@@ -203,12 +202,12 @@ public class QRCodeReaderActivity extends BaseActivity implements ZXingScannerVi
api
.
getInfosFromId
(
qrCodeResponse
.
getId
());
Thread
.
sleep
(
100
);
apiResponse
=
(
APIResponse
)
new
ObjectMapper
().
readValue
(
api
.
getRequest
().
getResponse
(),
apiResponseClass
.
get
(
apiIndex
));
apiResponse
=
new
ObjectMapper
().
readValue
(
api
.
getRequest
().
getResponse
(),
apiResponseClass
.
get
(
apiIndex
));
if
(
nemopaySession
.
getFoundationId
()
!=
-
1
&&
apiResponse
.
getFoundationId
()
!=
null
&&
apiResponse
.
getFoundationId
()
!=
nemopaySession
.
getFoundationId
())
if
(
nemopaySession
.
getFoundationId
()
!=
-
1
&&
((
APIResponse
)
apiResponse
)
.
getFoundationId
()
!=
null
&&
((
APIResponse
)
apiResponse
)
.
getFoundationId
()
!=
nemopaySession
.
getFoundationId
())
throw
new
Exception
(
getString
(
R
.
string
.
can_not_sell_other_foundation
));
if
(
apiResponse
.
isValidated
())
if
(
((
APIResponse
)
apiResponse
)
.
isValidated
())
throw
new
Exception
(
getString
(
R
.
string
.
already_validated
));
if
(
api
.
getRequest
().
getJSONResponse
().
has
(
"type"
)
&&
api
.
getRequest
().
getJSONResponse
().
get
(
"type"
).
textValue
().
equals
(
"error"
)
&&
api
.
getRequest
().
getJSONResponse
().
has
(
"message"
))
...
...
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