diff --git a/README.md b/README.md index 65cb5d0..b4a845d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ # Payment Engine Android library which combines different payments protocols into single interface solution. So far supported payments are: -* **ZVT** +* **ZVT** - Zero Reactive Voltage Transmission is an german abbreviation and stands for Payment Terminal +* **OPI** - The Open Payment Initiative, or O.P.I. for short # How to setup **Step 1.** Add the JitPack repository to your `settings.gradle` file: @@ -14,7 +15,7 @@ dependencyResolutionManagement { repositories { ... mavenCentral() - maven { url 'https://jitpack.io' } + maven { url 'https://jitpack.io' } } } ``` @@ -58,24 +59,24 @@ override fun onCreate(savedInstanceState: Bundle?) { ### 2. Usage of PaymentEngine -`PaymentEngine.kt` is per Activity singlton helper class which tries to simplify the process of implementation and it gives you access to all library available actions (managers). +`PaymentEngine.kt` is singlton helper class which tries to simplify the process of implementation and it gives you access to all library available actions (managers). * `PaymentManager` is used to start of a card payment transaction * `RefundManager` is used to start of a partial card payment refund * `ReversalManager` is used to start of a card payment reversal * `ReconciliationManager` is used to start of a terminal reconciliation -It also gives you more flexibility setting up terminal configuration, observing result through SharedFlow and triggering actions with multiple methods. +It also gives you more flexibility setting up terminal configuration, observing result through singleton Flow and triggering actions with multiple methods. ```kotlin private val paymentEngine: PaymentEngine by lazy { - PaymentEngine.getInstance(this) + PaymentEngine.getInstance() } override fun onCreate(savedInstanceState: Bundle?) { // ... - val paymentManager = paymentEngine.newPaymentManager().build(lifecycle) + val paymentManager = paymentEngine.newPaymentManager(this) ... diff --git a/payment-engine/build.gradle.kts b/payment-engine/build.gradle.kts index ac04607..b139479 100644 --- a/payment-engine/build.gradle.kts +++ b/payment-engine/build.gradle.kts @@ -92,7 +92,7 @@ afterEvaluate { create("payment-engine") { groupId = "de.tillhub.paymentengine" artifactId = "payment-engine" - version = "1.3.4" + version = "2.0.1" from(components.getByName("release")) } diff --git a/payment-engine/proguard-rules.pro b/payment-engine/proguard-rules.pro index 16dd60c..7856ec2 100644 --- a/payment-engine/proguard-rules.pro +++ b/payment-engine/proguard-rules.pro @@ -52,6 +52,42 @@ -keep class de.tillhub.paymentengine.data.TransactionData { *; } -keep class de.tillhub.paymentengine.data.TransactionResultCode { *; } +# Communication classes +-keep class de.tillhub.paymentengine.opi.data.CardServiceRequest { *; } +-keep class de.tillhub.paymentengine.opi.data.PosData { *; } +-keep class de.tillhub.paymentengine.opi.data.TotalAmount { *; } +-keep class de.tillhub.paymentengine.opi.data.OriginalTransaction { *; } +-keep class de.tillhub.paymentengine.opi.data.ServiceRequestType { *; } +-keep class de.tillhub.paymentengine.opi.data.CardServiceResponse { *; } +-keep class de.tillhub.paymentengine.opi.data.Terminal { *; } +-keep class de.tillhub.paymentengine.opi.data.Tender { *; } +-keep class de.tillhub.paymentengine.opi.data.CardDetails { *; } +-keep class de.tillhub.paymentengine.opi.data.CardValue { *; } +-keep class de.tillhub.paymentengine.opi.data.PrivateData { *; } +-keep class de.tillhub.paymentengine.opi.data.Authorisation { *; } +-keep class de.tillhub.paymentengine.opi.data.ValueElement { *; } +-keep class de.tillhub.paymentengine.opi.data.OverallResult { *; } +-keep class de.tillhub.paymentengine.opi.data.DeviceRequest { *; } +-keep class de.tillhub.paymentengine.opi.data.Output { *; } +-keep class de.tillhub.paymentengine.opi.data.TextLine { *; } +-keep class de.tillhub.paymentengine.opi.data.DeviceType { *; } +-keep class de.tillhub.paymentengine.opi.data.DeviceRequestType { *; } +-keep class de.tillhub.paymentengine.opi.data.DeviceResponse { *; } +-keep class de.tillhub.paymentengine.opi.data.ServiceRequest { *; } +-keep class de.tillhub.paymentengine.opi.data.ServiceResponse { *; } +-keep class de.tillhub.paymentengine.opi.data.Reconciliation { *; } + +-keep public class org.simpleframework.**{ *; } +-keep class org.simpleframework.xml.**{ *; } +-keep class org.simpleframework.xml.core.**{ *; } +-keep class org.simpleframework.xml.util.**{ *; } +-keepattributes *Annotation* +-keepattributes Signature + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet, int); +} + # Breaking changes with AGP 8.0 # R8 upgrade documentation -dontwarn java.lang.invoke.StringConcatFactory \ No newline at end of file