Skip to content

Commit f96175b

Browse files
authored
Fix path (#46)
1 parent a74e0ec commit f96175b

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Package and installation instructions are available at the [Maven Central Reposi
2121
<dependency>
2222
<groupId>eu.kevin</groupId>
2323
<artifactId>kevin-jvm</artifactId>
24-
<version>1.0.0</version>
24+
<version>1.0.1</version>
2525
</dependency>
2626
```
2727

2828
### Gradle
2929
```
30-
implementation 'eu.kevin:kevin-jvm:1.0.0'
30+
implementation 'eu.kevin:kevin-jvm:1.0.1'
3131
```
3232

3333
## Usage Examples

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "eu.kevin"
14-
version = "1.0.0"
14+
version = "1.0.1"
1515

1616
repositories {
1717
mavenCentral()

src/main/kotlin/eu/kevin/api/Endpoint.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@ internal object Endpoint {
66

77
object Paths {
88
object Payment {
9-
fun initiatePayment() = "/pis/payment"
10-
fun getPaymentStatus(paymentId: String) = "/pis/payment/$paymentId/status"
11-
fun initiatePaymentRefund(paymentId: String) = "/pis/payment/$paymentId/refunds"
9+
fun initiatePayment() = "pis/payment"
10+
fun getPaymentStatus(paymentId: String) = "pis/payment/$paymentId/status"
11+
fun initiatePaymentRefund(paymentId: String) = "pis/payment/$paymentId/refunds"
1212
}
1313

1414
object Auth {
15-
fun startAuthentication() = "/auth"
16-
fun receiveToken() = "/auth/token"
17-
fun receiveTokenContent() = "/auth/token/content"
15+
fun startAuthentication() = "auth"
16+
fun receiveToken() = "auth/token"
17+
fun receiveTokenContent() = "auth/token/content"
1818
}
1919

2020
object General {
21-
fun getSupportedCountries() = "/auth/countries"
22-
fun getSupportedBanks() = "/auth/banks"
23-
fun getSupportedBank(bankId: String) = "/auth/banks/$bankId"
24-
fun getSupportedBankByCardNumberPiece(cardNumberPiece: String) = "/auth/banks/cards/$cardNumberPiece"
25-
fun getPaymentMethods() = "/auth/paymentMethods"
26-
fun getProjectSettings() = "/auth/project/settings"
21+
fun getSupportedCountries() = "auth/countries"
22+
fun getSupportedBanks() = "auth/banks"
23+
fun getSupportedBank(bankId: String) = "auth/banks/$bankId"
24+
fun getSupportedBankByCardNumberPiece(cardNumberPiece: String) = "auth/banks/cards/$cardNumberPiece"
25+
fun getPaymentMethods() = "auth/paymentMethods"
26+
fun getProjectSettings() = "auth/project/settings"
2727
}
2828

2929
object Account {
30-
fun getAccountsList() = "/ais/accounts"
31-
fun getAccountDetails(accountId: String) = "/ais/accounts/$accountId"
32-
fun getAccountTransactions(accountId: String) = "/ais/accounts/$accountId/transactions"
33-
fun getAccountBalance(accountId: String) = "/ais/accounts/$accountId/balance"
30+
fun getAccountsList() = "ais/accounts"
31+
fun getAccountDetails(accountId: String) = "ais/accounts/$accountId"
32+
fun getAccountTransactions(accountId: String) = "ais/accounts/$accountId/transactions"
33+
fun getAccountBalance(accountId: String) = "ais/accounts/$accountId/balance"
3434
}
3535
}
3636
}

src/main/kotlin/eu/kevin/api/services/Client.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ class Client internal constructor(
3737

3838
private fun HttpClient.withAuthorization() = this.config {
3939
defaultRequest {
40-
url.takeFrom(
41-
URLBuilder().takeFrom(
42-
URI.create("$apiUrl/").resolve(".${Endpoint.VERSION}")
43-
).apply {
44-
encodedPath += url.encodedPath
45-
}
46-
)
40+
url.takeFrom(URI.create("$apiUrl/").resolve(".${Endpoint.VERSION}/"))
4741
header("Client-Id", authorization.clientId)
4842
header("Client-Secret", authorization.clientSecret)
4943
customHeaders.forEach { header(it.key, it.value) }

0 commit comments

Comments
 (0)