Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Package and installation instructions are available at the [Maven Central Reposi
<dependency>
<groupId>eu.kevin</groupId>
<artifactId>kevin-jvm</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
```

### Gradle
```
implementation 'eu.kevin:kevin-jvm:1.0.0'
implementation 'eu.kevin:kevin-jvm:1.0.1'
```

## Usage Examples
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "eu.kevin"
version = "1.0.0"
version = "1.0.1"

repositories {
mavenCentral()
Expand Down
32 changes: 16 additions & 16 deletions src/main/kotlin/eu/kevin/api/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ internal object Endpoint {

object Paths {
object Payment {
fun initiatePayment() = "/pis/payment"
fun getPaymentStatus(paymentId: String) = "/pis/payment/$paymentId/status"
fun initiatePaymentRefund(paymentId: String) = "/pis/payment/$paymentId/refunds"
fun initiatePayment() = "pis/payment"
fun getPaymentStatus(paymentId: String) = "pis/payment/$paymentId/status"
fun initiatePaymentRefund(paymentId: String) = "pis/payment/$paymentId/refunds"
}

object Auth {
fun startAuthentication() = "/auth"
fun receiveToken() = "/auth/token"
fun receiveTokenContent() = "/auth/token/content"
fun startAuthentication() = "auth"
fun receiveToken() = "auth/token"
fun receiveTokenContent() = "auth/token/content"
}

object General {
fun getSupportedCountries() = "/auth/countries"
fun getSupportedBanks() = "/auth/banks"
fun getSupportedBank(bankId: String) = "/auth/banks/$bankId"
fun getSupportedBankByCardNumberPiece(cardNumberPiece: String) = "/auth/banks/cards/$cardNumberPiece"
fun getPaymentMethods() = "/auth/paymentMethods"
fun getProjectSettings() = "/auth/project/settings"
fun getSupportedCountries() = "auth/countries"
fun getSupportedBanks() = "auth/banks"
fun getSupportedBank(bankId: String) = "auth/banks/$bankId"
fun getSupportedBankByCardNumberPiece(cardNumberPiece: String) = "auth/banks/cards/$cardNumberPiece"
fun getPaymentMethods() = "auth/paymentMethods"
fun getProjectSettings() = "auth/project/settings"
}

object Account {
fun getAccountsList() = "/ais/accounts"
fun getAccountDetails(accountId: String) = "/ais/accounts/$accountId"
fun getAccountTransactions(accountId: String) = "/ais/accounts/$accountId/transactions"
fun getAccountBalance(accountId: String) = "/ais/accounts/$accountId/balance"
fun getAccountsList() = "ais/accounts"
fun getAccountDetails(accountId: String) = "ais/accounts/$accountId"
fun getAccountTransactions(accountId: String) = "ais/accounts/$accountId/transactions"
fun getAccountBalance(accountId: String) = "ais/accounts/$accountId/balance"
}
}
}
8 changes: 1 addition & 7 deletions src/main/kotlin/eu/kevin/api/services/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ class Client internal constructor(

private fun HttpClient.withAuthorization() = this.config {
defaultRequest {
url.takeFrom(
URLBuilder().takeFrom(
URI.create("$apiUrl/").resolve(".${Endpoint.VERSION}")
).apply {
encodedPath += url.encodedPath
}
)
url.takeFrom(URI.create("$apiUrl/").resolve(".${Endpoint.VERSION}/"))
header("Client-Id", authorization.clientId)
header("Client-Secret", authorization.clientSecret)
customHeaders.forEach { header(it.key, it.value) }
Expand Down