This commit is contained in:
GME 2019-04-16 22:22:40 +02:00
parent f9801997f5
commit 05be4ff1b8
5 changed files with 53 additions and 46 deletions

View file

@ -94,7 +94,7 @@ public class QrCodeScannerActivity extends AppCompatActivity {
Intent scannedQrIntent = new Intent(QrCodeScannerActivity.this, ApprovePayementActivity.class);
scannedQrIntent.putExtra("VALUE",intentData);
scannedQrIntent.putExtra("USER_HASH",user_hash);
scannedQrIntent.putExtra("USER_PDW",user_password);
scannedQrIntent.putExtra("USER_PWD",user_password);
scannedQrIntent.putExtra("WALLET_HASH",wallet_hash);
scannedQrIntent.putExtra("SESSION_ID",session_id);
QrCodeScannerActivity.this.startActivity(scannedQrIntent);

View file

@ -2,8 +2,8 @@ package monnethic.mobile.restApi;
public class Config {
//BASE
//static private String BASE_URL = "http://37.187.101.44:10053/";
static private String BASE_URL = "http://10.0.2.2:10053/";
static private String BASE_URL = "http://37.187.101.44:10053/";
//static private String BASE_URL = "http://10.0.2.2:10053/";
//static private String BASE_URL = "http://localhost:10053/";
static private String BASE_URL_USER = BASE_URL+"api/rest/user/";
static private String BASE_URL_TRANSACTION = BASE_URL+"api/rest/transaction/";

View file

@ -69,6 +69,7 @@ public class ApprovePayementActivity extends AppCompatActivity {
public void sendTransaction(){
SendingTransaction sendingTransaction = new SendingTransaction(user_hash,user_password,wallet_hash,wallet_dest,amount,"gonette");
try {
String transaction_hash = new TransactionTask().execute(sendingTransaction).get();
if(transaction_hash!=null){
Toast.makeText(this, "transaction id : "+transaction_hash, Toast.LENGTH_LONG).show();
@ -85,6 +86,7 @@ public class ApprovePayementActivity extends AppCompatActivity {
@Override
protected String doInBackground(SendingTransaction... sendingTransactions) {
try{
TransactionApiHandler transactionApiHandler = new TransactionApiHandler();
return transactionApiHandler.doTransaction(sendingTransactions[0]);
}catch (Exception e){

View file

@ -1,71 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="monnethic.mobile.transaction.ApprovePayementActivity">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textViewAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="61dp"
android:layout_marginTop="284dp"
android:text="AMOUNT :" />
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textViewDestAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/textViewAmount"
android:layout_alignParentTop="true"
android:layout_marginStart="1dp"
android:layout_marginTop="188dp"
android:layout_marginTop="150dp"
android:text="TO :" />
<TextView
android:id="@+id/destAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textViewDestAddress"
android:layout_marginStart="-27dp"
android:layout_marginTop="9dp"
android:layout_toEndOf="@+id/textViewDestAddress" />
android:layout_marginTop="15dp" />
<TextView
android:id="@+id/textViewAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text="AMOUNT :" />
<TextView
android:id="@+id/amountApprove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/textViewAmount"
android:layout_alignParentBottom="true"
android:layout_marginBottom="235dp" />
android:layout_marginTop="15dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="40dp">
<Button
android:id="@+id/buttonCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="79dp"
android:layout_marginBottom="111dp"
android:layout_alignParentTop="true"
android:layout_marginStart="70dp"
android:text="CANCEL" />
<Button
android:id="@+id/buttonValidate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/buttonCancel"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="81dp"
android:layout_marginBottom="-1dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="69dp"
android:text="VALIDATE" />
</RelativeLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View file

@ -36,7 +36,7 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="20dp"
android:text="Adresse :"
android:text="Address:"
app:layout_constraintBottom_toTopOf="@+id/textViewAmount"
app:layout_constraintEnd_toStartOf="@+id/textViewAdresseDisplay"
app:layout_constraintHorizontal_bias="1.0"
@ -59,7 +59,7 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="140dp"
android:text="Montant :"
android:text="Amount:"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textViewAmountDisplay"
app:layout_constraintHorizontal_bias="1.0"