diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 20d3c46..ad57f64 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index 9c64e11..2638743 100644 Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ diff --git a/app/build.gradle b/app/build.gradle index 9d1cf90..4d5d7aa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,8 +22,8 @@ android { applicationId "ch.pizzaleu.android" minSdkVersion 16 targetSdkVersion 28 - versionCode 5 // play store'daki version --> canlı: 0 - dahili test: 4 - versionName "1.04" // play store'daki version --> canlı: 0.00 - dahili test: 1.03 + versionCode 7 // play store'daki version --> canlı: 0 - dahili test: 6 + versionName "1.06" // play store'daki version --> canlı: 0.00 - dahili test: 1.05 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true manifestPlaceholders = [ diff --git a/app/release/output.json b/app/release/output.json index 3bacde5..235e6b3cf 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.03","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":6,"versionName":"1.05","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/ch/pizzaleu/android/api/ApiEndPoints.java b/app/src/main/java/ch/pizzaleu/android/api/ApiEndPoints.java index 9e5f062..7e074a7 100644 --- a/app/src/main/java/ch/pizzaleu/android/api/ApiEndPoints.java +++ b/app/src/main/java/ch/pizzaleu/android/api/ApiEndPoints.java @@ -48,7 +48,7 @@ public class ApiEndPoints { public static final String API_CREATE_BRAINTREE_PAYMENT = PREFIX + "checkBrainTreePayment" + SUFFIX + "&token="; public static final String API_REPEAT_ORDER = PREFIX + "reOrder" + SUFFIX + "&token="; public static final String API_CHECK_ORDER_PRICE = PREFIX + "checkOrderPrice" + SUFFIX + "&token="; - public static final String API_CREATE_BRAINTREE_PAYMENT_TOKEN = PREFIX + "createBraintreePaymentToken" + SUFFIX + "&token="; + public static final String API_CREATE_BRAINTREE_PAYMENT_TOKEN = PREFIX + "createPaymentToken" + SUFFIX + "&token="; public static final String API_GET_DATATRANS_INFO = PREFIX + "getDatatransInfo" + SUFFIX + "&token="; public static final String API_CREATE_DATATRANS_PAYMENT = PREFIX + "checkDatatransPayment" + SUFFIX + "&token="; diff --git a/app/src/main/java/ch/pizzaleu/android/fragment/createOrder/CreateOrderSummaryFragment.java b/app/src/main/java/ch/pizzaleu/android/fragment/createOrder/CreateOrderSummaryFragment.java index 27c904a..ddccf80 100644 --- a/app/src/main/java/ch/pizzaleu/android/fragment/createOrder/CreateOrderSummaryFragment.java +++ b/app/src/main/java/ch/pizzaleu/android/fragment/createOrder/CreateOrderSummaryFragment.java @@ -967,46 +967,52 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment implemen } @Override - public void paymentProcessStateChanged(PaymentProcessAndroid datatransPaymentProcess) { - switch (datatransPaymentProcess.getState()) { + public void paymentProcessStateChanged(final PaymentProcessAndroid datatransPaymentProcess) { + BaseActivity.currentActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + switch (datatransPaymentProcess.getState()) { - case STARTED: - createOrderActivity.setPaymentLayoutVisibility(true); - break; + case STARTED: + createOrderActivity.setPaymentLayoutVisibility(true); + break; - case NOT_STARTED: - createOrderActivity.setPaymentLayoutVisibility(false); - break; + case NOT_STARTED: + createOrderActivity.setPaymentLayoutVisibility(false); + break; - case COMPLETED: - createOrderActivity.setPaymentLayoutVisibility(false); - String transcationId = datatransPaymentProcess.getTransactionId(); - String paymentMethodName = datatransPaymentProcess.getPaymentMethodType().getName(); - AliasPaymentMethod aliasPaymentMethod = datatransPaymentProcess.getAliasPaymentMethod(); - if (aliasPaymentMethod != null) { - String json = aliasPaymentMethod.toJson(); - Log.i("dgyef", "vryf"); - // serialize and securely store aliasPaymentMethod for reuse + case COMPLETED: + createOrderActivity.setPaymentLayoutVisibility(false); + String transcationId = datatransPaymentProcess.getTransactionId(); + String paymentMethodName = datatransPaymentProcess.getPaymentMethodType().getName(); + AliasPaymentMethod aliasPaymentMethod = datatransPaymentProcess.getAliasPaymentMethod(); + if (aliasPaymentMethod != null) { + String json = aliasPaymentMethod.toJson(); + Log.i("dgyef", "vryf"); + // serialize and securely store aliasPaymentMethod for reuse + } + createDatatransPayment(transcationId, paymentMethodName); + DialogHelper.showAlertDialog(BaseActivity.currentActivity, "Your payment successed.\nTransaction Id: " + transcationId); + break; + case CANCELED: + createOrderActivity.setPaymentLayoutVisibility(false); + DialogHelper.showAlertDialog(BaseActivity.currentActivity, paymentCanceledText); + break; + case ERROR: + createOrderActivity.setPaymentLayoutVisibility(false); + Exception e = datatransPaymentProcess.getException(); + if (e instanceof BusinessException) { + BusinessException be = (BusinessException)e; + int errorCode = be.getErrorCode();// Datatrans error code if needed + // display some error message + } else { + // unexpected technical exception, either fatal TechnicalException or // javax.net.ssl.SSLException (certificate error) + } + DialogHelper.showAlertDialog(BaseActivity.currentActivity, e.getMessage()); + break; } - createDatatransPayment(transcationId, paymentMethodName); - break; - case CANCELED: - createOrderActivity.setPaymentLayoutVisibility(false); - DialogHelper.showAlertDialog(BaseActivity.currentActivity, paymentCanceledText); - break; - case ERROR: - createOrderActivity.setPaymentLayoutVisibility(false); - Exception e = datatransPaymentProcess.getException(); - if (e instanceof BusinessException) { - BusinessException be = (BusinessException)e; - int errorCode = be.getErrorCode();// Datatrans error code if needed - // display some error message - } else { - // unexpected technical exception, either fatal TechnicalException or // javax.net.ssl.SSLException (certificate error) - } - DialogHelper.showAlertDialog(BaseActivity.currentActivity, e.getMessage()); - break; - } + } + }); } private void createBraintreePayment(final DropInResult dropInResult){