commonTest.io.revenuemonster.sdk.JVMSDK.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rm-kotlin-sdk Show documentation
Show all versions of rm-kotlin-sdk Show documentation
Revenue Monster Kotlin Multiplatform SDK
package io.revenuemonster.sdk
import io.revenuemonster.sdk.model.auth.Config
import io.revenuemonster.sdk.model.common.Order
import io.revenuemonster.sdk.model.request.PosQuickPay
import io.revenuemonster.sdk.util.RMException
import kotlinx.coroutines.runBlocking
import org.junit.Test
class JVMSDK {
@Test
fun test() {
val config = Config(
clientID = "1662954961551527171",
clientSecret = "IQUMlKIzfxbWUIDxSQsggHaplFuSxkkX",
privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" +
"MIIEowIBAAKCAQB56wg/6BI9zmKDoaJcgiz9gDU3l2/NA3LsJZTVLveuTzl06i5h\n" +
"Be3xscQRJIm+aIDdhvs2CDOKKMZ4x8FaDAWC8YA6MIMfHSg7tOnmBM2Lae/kmoqd\n" +
"Z8RzUpjgy6lwcDk8Jo/NjhTFCaVJDpeGJrUQc3fB7UJskoM1efX8NFMPS2S/n97A\n" +
"s0ZYiCMAIzN86UchR1wZFF0VvfEzuXtbfc0Enq03Yo2KKPRIeLo6beyfZ9mfdqCl\n" +
"hhOMG3cuJKSG+t08JAdtkAj6DejQxZuH6MpN4MDtN9xwI5a/7BKJZ9ORCvGszWF6\n" +
"r7SyKn/PO/sYF6ysINJUOlGjthZo280K/BSVAgMBAAECggEAaZpy3+AmBNFDNd+I\n" +
"4naDf+VQs2GCHuPQ5Mm8vFfdhGftTd8W40WekI85VNwAUCT3Emu8J1Y9RnwBRldI\n" +
"nLXzBDQprL2ephG8atNPEsWwQQU3HR3b2XIrkPTHpVfj4Zfji72fLB7Y0L+FIt33\n" +
"0+StS52o6xqXQbI64tRMhPPRyll9rxuQJGj29oJgtkPoHfF2fdnlYveQS5xAJuaN\n" +
"kLd0MkVUf3ComT3630nEhas6mZO9+hO+fnaJWyj1hupCFMQQ8TBx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n" +
"-----END RSA PRIVATE KEY-----",
sandbox = true
)
runBlocking {
try {
val auth = RevenueMonsterAuth(config).getAccessToken()
val sdk = RevenueMonsterSDK(auth)
val r1 = sdk.merchant.getProfile()
println("Result ====>")
println(r1)
} catch (e: RMException) {
println("Debug 1 ====>")
println(e.errorCode)
println(e.errorMessage)
} catch (e: Throwable) {
println("Debug 2 ====>")
println(e.printStackTrace())
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy