
Client library facilitating interaction with PayMongo's API, supporting operations like creating sources, payments, payment intents, and webhooks, while providing integration capabilities for various payment methods.
Paymongo client for kotlin
https://docs.paymongo.com/reference
val config = Paymongo.Config.apply{
secretKey = "sk_123456"
}
val client = PayMongo(config)paymongo-kotlin-ktor-server verifies the Paymongo-Signature header, decodes the payload, and
optionally flags redelivered events. See samples/server
for a full runnable example.
implementation("io.github.ronjunevaldoz:paymongo-kotlin-ktor-server:<VERSION>")routing {
route("/webhooks/paymongo") {
install(PayMongoWebhookVerification) {
secretKey = "whsec_..."
dedupStore = InMemoryPayMongoWebhookDedupStore() // opt-in; process-local only
}
post {
if (call.isDuplicatePayMongoEvent) {
call.respond(HttpStatusCode.OK)
return@post
}
when (call.payMongoEvent.data.attributes.type) {
WebhookEvent.Event.PaymentPaid -> { /* fulfill the order */ }
else -> {}
}
call.respond(HttpStatusCode.OK)
}
}
}A missing/malformed signature header throws PayMongoSignatureFormatException; a signature
mismatch throws PayMongoSignatureMismatchException. Install Ktor's StatusPages to map either
to a 400, or they surface as an unhandled 500.
repositories {
mavenCentral()
}implementation("io.github.ronjunevaldoz:paymongo-kotlin:<VERSION>")implementation("io.github.ronjunevaldoz:paymongo-kotlin-<PLATFORM>:<VERSION>")https://developers.paymongo.com/docs/community-made-libraries
Paymongo client for kotlin
https://docs.paymongo.com/reference
val config = Paymongo.Config.apply{
secretKey = "sk_123456"
}
val client = PayMongo(config)paymongo-kotlin-ktor-server verifies the Paymongo-Signature header, decodes the payload, and
optionally flags redelivered events. See samples/server
for a full runnable example.
implementation("io.github.ronjunevaldoz:paymongo-kotlin-ktor-server:<VERSION>")routing {
route("/webhooks/paymongo") {
install(PayMongoWebhookVerification) {
secretKey = "whsec_..."
dedupStore = InMemoryPayMongoWebhookDedupStore() // opt-in; process-local only
}
post {
if (call.isDuplicatePayMongoEvent) {
call.respond(HttpStatusCode.OK)
return@post
}
when (call.payMongoEvent.data.attributes.type) {
WebhookEvent.Event.PaymentPaid -> { /* fulfill the order */ }
else -> {}
}
call.respond(HttpStatusCode.OK)
}
}
}A missing/malformed signature header throws PayMongoSignatureFormatException; a signature
mismatch throws PayMongoSignatureMismatchException. Install Ktor's StatusPages to map either
to a 400, or they surface as an unhandled 500.
repositories {
mavenCentral()
}implementation("io.github.ronjunevaldoz:paymongo-kotlin:<VERSION>")implementation("io.github.ronjunevaldoz:paymongo-kotlin-<PLATFORM>:<VERSION>")https://developers.paymongo.com/docs/community-made-libraries