Skip to content

Commit

Permalink
Merge pull request #8 from ronjunevaldoz/develop
Browse files Browse the repository at this point in the history
v1.0.2-dev05
  • Loading branch information
ronjunevaldoz authored Oct 2, 2024
2 parents 1962d6b + 38e0108 commit c3b4c82
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.2-dev05]

### Fixes
- wrong input in createLink

## [v1.0.2-dev04]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ plugins {

allprojects {
group = "io.github.ronjunevaldoz"
version = "1.0.2-dev04"
version = "1.0.2-dev05"
}

mavenPublishing {
coordinates(
groupId = "io.github.ronjunevaldoz",
artifactId = "paymongo-kotlin",
version = "1.0.2-dev04"
version = "1.0.2-dev05"
)

pom {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.github.ronjunevaldoz.paymongo

import io.github.ronjunevaldoz.paymongo.models.Billing
import io.github.ronjunevaldoz.paymongo.models.resource.CreateLinkInput
import io.github.ronjunevaldoz.paymongo.models.resource.CreatePaymentMethodInput
import io.github.ronjunevaldoz.paymongo.models.resource.CreateSourceInput
import io.github.ronjunevaldoz.paymongo.models.resource.CreateWebhookInput
import io.github.ronjunevaldoz.paymongo.models.resource.Link
import io.github.ronjunevaldoz.paymongo.models.resource.PaymentMethodResponse
import io.github.ronjunevaldoz.paymongo.models.resource.PaymentType
import io.github.ronjunevaldoz.paymongo.models.resource.SourceResponse
Expand Down Expand Up @@ -48,7 +50,7 @@ suspend fun IPayMongo.createPaymentMethod(input: CreatePaymentMethodInput.Builde
}

suspend fun IPayMongo.createWebhook(
url: String,
url: String? = null,
events: List<WebhookEvent.Event> = WebhookEvent.Event.All
): WebhookResponse {
return createWebhook(
Expand All @@ -61,4 +63,23 @@ suspend fun IPayMongo.createWebhook(
)
)
)
}


suspend fun IPayMongo.createLink(
amount: Int,
description: String,
remarks: String
): Link {
return createLink(
CreateLinkInput(
data = CreateLinkInput.LinkInput(
attributes = CreateLinkInput.Attributes(
amount = amount,
description = description,
remarks = remarks
)
)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class CreateLinkInput(val data: Attributes) {
data class CreateLinkInput(val data: LinkInput) {
@Serializable
data class LinkInput(
val attributes: Attributes
)

@Serializable
data class Attributes(
val amount: Int,
Expand Down

0 comments on commit c3b4c82

Please sign in to comment.