Commit 912ad078 authored by Izol's avatar Izol

commit sourcetree

parent a2337fc8
This diff is collapsed.
......@@ -6,16 +6,22 @@
</shared>
</component>
<component name="AndroidLogFilters">
<option name="TOOL_WINDOW_LOG_LEVEL" value="debug" />
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="No Filters" />
<option name="TOOL_WINDOW_REGEXP_FILTER" value="false" />
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="ini pesan second" />
<option name="TOOL_WINDOW_LOG_LEVEL" value="verbose" />
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="NONE" />
</component>
<component name="ChangeListManager">
<list default="true" id="8704a1d9-96ef-4cdc-ac57-c88bc9c0306e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" beforeDir="false" />
<change afterPath="$PROJECT_DIR$/.flutter-plugins" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.flutter-plugins-dependencies" afterDir="false" />
<change afterPath="$PROJECT_DIR$/android/app/src/main/res/drawable/wahoo_print.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/assets/wahoo.bmp" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ios/Flutter/Generated.xcconfig" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ios/Flutter/flutter_export_environment.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Flutter_Plugins.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Flutter_Plugins.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
......@@ -31,30 +37,24 @@
<change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/file-system.probe" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/file-system.probe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/modules/-435484205/android.workmanager.androidTest.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/modules/-435484205/android.workmanager.unitTest.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/build.gradle" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/debug/app-debug.apk" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/debug/app-debug.apk" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/release/app-release.apk" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/release/app-release.apk" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/src/main/kotlin/com/example/self_service_3/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/src/main/kotlin/com/example/self_service_3/MainActivity.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/app/src/main/res/drawable/wahoo.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/android/local.properties" beforeDir="false" afterPath="$PROJECT_DIR$/android/local.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/wahoo.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/assets/wahoo.png" beforeDir="false" afterPath="$PROJECT_DIR$/assets/wahoo.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/wristband.gif" beforeDir="false" afterPath="$PROJECT_DIR$/assets/wristband.gif" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Runner/GeneratedPluginRegistrant.h" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Runner/GeneratedPluginRegistrant.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Runner/GeneratedPluginRegistrant.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Runner/GeneratedPluginRegistrant.m" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kotlin-profile/2022-11-28-11-34-03-909.profile" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/lib/services/api_helpert.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/services/api_helpert.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/ui/pages/home_page.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/ui/pages/home_page.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/ui/pages/set_merchant.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/ui/pages/set_merchant.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/linux/flutter/generated_plugin_registrant.cc" beforeDir="false" afterPath="$PROJECT_DIR$/linux/flutter/generated_plugin_registrant.cc" afterDir="false" />
<change beforePath="$PROJECT_DIR$/linux/flutter/generated_plugin_registrant.h" beforeDir="false" afterPath="$PROJECT_DIR$/linux/flutter/generated_plugin_registrant.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/linux/flutter/generated_plugins.cmake" beforeDir="false" afterPath="$PROJECT_DIR$/linux/flutter/generated_plugins.cmake" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/ui/pages/splash_page.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/ui/pages/splash_page.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.lock" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list>
......@@ -158,4 +158,25 @@
</map>
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="Dart">
<url>file://$PROJECT_DIR$/lib/reader/reader_flutter.dart</url>
<line>109</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="Dart">
<url>file://$PROJECT_DIR$/lib/reader/reader_flutter.dart</url>
<line>110</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="Dart">
<url>file://$PROJECT_DIR$/lib/reader/reader_flutter.dart</url>
<line>112</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
......@@ -16,6 +16,11 @@
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven4" />
<option name="name" value="maven4" />
<option name="url" value="https://storage.googleapis.com/download.flutter.io" />
</remote-repository>
<remote-repository>
<option name="id" value="Google7" />
<option name="name" value="Google7" />
......
This diff is collapsed.
......@@ -80,7 +80,7 @@ dependencies {
implementation 'androidx.annotation:annotation:1.4.0'
// library mdd
implementation(group: 'com.mdd.topup', name: 'mifare_mdd_lib', version: '0.0.10-rev13', ext: 'aar')
implementation(group: 'com.mdd.topup', name: 'mifare_mdd_lib', version: '0.0.11', ext: 'aar')
implementation(group: 'com.mdd.payment', name: 'aar-deviceid-release', version: '2.0.6', ext: 'aar')
implementation(group: 'com.mdd.library', name: 'android-escpos-receipt', version: '1.0.1', ext: 'aar')
implementation(group: 'com.mdd.payment', name: 'nativecripto-release', version: '2.0.1', ext: 'aar')
......
......@@ -31,6 +31,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
when (call.method) {
"init_library" -> {
this.result = result;
val callback = this
object : Thread() {
override fun run() {
......@@ -82,15 +83,15 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
val getRegDb = call.argument<String>("get_reg_db")
val amount = call.argument<String>("amount")
val topupInquiryResponse = _mifareTicketing?.topupInquiry(
outletName?.toLowerCase(Locale.ROOT)!!.replace(" ", "-"),
"M",
cardNumber!!,
amount!!,
"TOPUP" + System.currentTimeMillis(),
prevBalance!!,
deviceTimestamp = sdf.format(timeNow),
requestTimestamp = sdf.format(timeNow),
getRegDb!!,
outletName?.toLowerCase(Locale.ROOT)!!.replace(" ", "-"),
"M",
cardNumber!!,
amount!!,
"TOPUP" + System.currentTimeMillis(),
prevBalance!!,
deviceTimestamp = sdf.format(timeNow),
requestTimestamp = sdf.format(timeNow),
getRegDb!!,
);
result.success(Gson().toJson(topupInquiryResponse))
......@@ -121,7 +122,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
val amount = call.argument<Int>("amount")
_mifareTicketing?.topupBalanceCard(cardNumber!!, amount!!)
}
"activate_library" ->{
"activate_library" -> {
val sukses = _mifareTicketing?.activateLibrary()
result.success(sukses == true)
}
......@@ -158,11 +159,11 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
}
override fun onCardDetected() {
Log.d("onCardDetected","Card Detected")
Log.d("onCardDetected", "Card Detected")
}
override fun onErrorOperation(reason: String?, errorCode: String) {
Log.d("onErrorOperation",reason.toString())
Log.d("onErrorOperation", reason.toString())
if (errorCode == "103F") {
result?.success(reason)
} else if (errorCode == "0005") {
......@@ -176,7 +177,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
TODO("Not yet implemented")
}
override fun onSuccessRefundDepositBalanceCard(ticket: Ticket?){
override fun onSuccessRefundDepositBalanceCard(ticket: Ticket?) {
TODO("Not yet implemented")
}
......@@ -201,7 +202,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
}
override fun onSuccessInitEngine() {
print("success init engine")
Log.d("MainActivity", "success init engine")
result?.success("success init engine")
}
......@@ -238,8 +239,10 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
val cardExpiry = Date(cardEpoch * 1000)
val sdf = SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.US)
// [C]<img>${PrinterTextParserImg.bitmapToHexadecimalString(printer, this.getApplicationContext().getResources().getDrawableForDensity(R.drawable.logo, DisplayMetrics.DENSITY_MEDIUM))}</img>
var bitmapIcon: Drawable? = this.getResources()?.getDrawableForDensity(R.drawable.wahoo_print,
DisplayMetrics.DENSITY_LOW, getTheme())
var bitmapIcon: Drawable? = this.getResources()?.getDrawableForDensity(
R.drawable.wahoo_print,
DisplayMetrics.DENSITY_LOW, getTheme()
)
if (Build.MODEL != "T2s") {
val text = """
......@@ -268,6 +271,10 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.setMarginRight(20)
val manufacturer = Build.MANUFACTURER
val model = Build.MODEL
var bitmapIcon: Drawable? = this.getResources()?.getDrawableForDensity(
R.drawable.wahoo_print,
DisplayMetrics.DENSITY_LOW, getTheme()
)
receiptLayout = receiptLayout
.setAlign(Paint.Align.CENTER)
.setColor(Color.BLACK)
......@@ -281,26 +288,30 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.addLine()
.addBlankSpace(10)
.setAlign(Paint.Align.LEFT)
.addText("Tanggal...............: " + sdf.format(timeNow))
.addBlankSpace(10)
.addText("No Transaksi.....: $approvalCode")
.addBlankSpace(10)
.addText("No Kartu.............: " + ticket.cardNumber)
.addBlankSpace(10)
.addText("Berlaku................: " + sdf.format(cardExpiry))
.addBlankSpace(10)
.addText("Tanggal...............: " + sdf.format(timeNow))
.addText("Masa Berlaku................: " + sdf.format(cardExpiry))
.addBlankSpace(10)
.addText(
"Saldo Awal.........: Rp" + formatDecimalToPrice(prevBalance.toDouble())
.toString()
)
.addBlankSpace(10)
.addText("Denom.................: Rp" + formatDecimalToPrice(denom.toDouble()))
.addText("Isi Saldo.................: Rp" + formatDecimalToPrice(denom.toDouble()))
.addBlankSpace(10)
.addText(
"Saldo Akhir.........: Rp" + formatDecimalToPrice(
ticket.balance!!.toDouble()
)
)
.addBlankSpace(10)
.addText("Biaya Layanan.........: Rp" + formatDecimalToPrice(serviceCharge.toDouble()).toString())
.addBlankSpace(10)
.addText("Jumlah Bayar.........: Rp" + formatDecimalToPrice(serviceChargeAmount.toDouble()).toString())
receiptLayout = receiptLayout
.setAlign(Paint.Align.CENTER)
......@@ -309,12 +320,11 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.addBlankSpace(15)
.addText("Top Up Berhasil")
.addBlankSpace(10)
.addText("Terima kasih atas kunjungan Anda")
.addBlankSpace(10)
.addText("powered by dolanapp.com")
val finalReceiptLayout: ReceiptBuilder = receiptLayout
_mifareTicketing?.generateReceiptTopup(finalReceiptLayout, "", bitmapIcon)
}
}
......
No preview for this file type
This diff is collapsed.
......@@ -55,7 +55,7 @@ class _SplashPageState extends State<SplashPage> {
} else {
navigationToSetConfig();
}
}
}
void navigationToGetOutlet() {
Navigator.of(context)
......@@ -88,10 +88,10 @@ class _SplashPageState extends State<SplashPage> {
void permissionState() async {
if (await Permission.storage.request().isGranted &&
await Permission.phone.request().isGranted) {
StartService.initLibrary();
Future.delayed(Duration(seconds: 3), () {
checkAktivation();
StartService.initLibrary().then((value) {
Future.delayed(Duration(seconds: 3), () {
checkAktivation();
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment