Skip to content

Commit

Permalink
Merge pull request #27 from tillhub/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
SloInfinity authored Jun 26, 2024
2 parents d0d6598 + 9778565 commit 24ae667
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -14,7 +15,7 @@ dependencyResolutionManagement {
repositories {
...
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://jitpack.io' }
}
}
```
Expand Down Expand Up @@ -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)

...

Expand Down
2 changes: 1 addition & 1 deletion payment-engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ afterEvaluate {
create<MavenPublication>("payment-engine") {
groupId = "de.tillhub.paymentengine"
artifactId = "payment-engine"
version = "1.3.4"
version = "2.0.1"

from(components.getByName("release"))
}
Expand Down
36 changes: 36 additions & 0 deletions payment-engine/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 <init>(android.content.Context, android.util.AttributeSet, int);
}

# Breaking changes with AGP 8.0
# R8 upgrade documentation
-dontwarn java.lang.invoke.StringConcatFactory

0 comments on commit 24ae667

Please sign in to comment.