diff --git a/README.md b/README.md index 129774c..619f276 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ Package and installation instructions are available at the [Maven Central Reposi eu.kevin kevin-jvm - 1.0.0 + 1.0.1 ``` ### Gradle ``` -implementation 'eu.kevin:kevin-jvm:1.0.0' +implementation 'eu.kevin:kevin-jvm:1.0.1' ``` ## Usage Examples diff --git a/build.gradle.kts b/build.gradle.kts index da12274..9eb7196 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { } group = "eu.kevin" -version = "1.0.0" +version = "1.0.1" repositories { mavenCentral() diff --git a/src/main/kotlin/eu/kevin/api/Endpoint.kt b/src/main/kotlin/eu/kevin/api/Endpoint.kt index 5def58b..558cb72 100644 --- a/src/main/kotlin/eu/kevin/api/Endpoint.kt +++ b/src/main/kotlin/eu/kevin/api/Endpoint.kt @@ -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" } } } diff --git a/src/main/kotlin/eu/kevin/api/services/Client.kt b/src/main/kotlin/eu/kevin/api/services/Client.kt index 909eaa0..a79e68e 100644 --- a/src/main/kotlin/eu/kevin/api/services/Client.kt +++ b/src/main/kotlin/eu/kevin/api/services/Client.kt @@ -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) }