Skip to content

Commit

Permalink
feat : add kotlin Serializable
Browse files Browse the repository at this point in the history
IamPortRequest 에 반영
  • Loading branch information
kjh5833 committed Mar 26, 2021
1 parent 0a8a3d0 commit b8a5b33
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ buildscript {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.koin:koin-gradle-plugin:$koin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ object Versions {

// const val chuck = "1.1.0"
const val robolectric = "4.3"

const val serialization = "1.1.0"
}

object Libs {
Expand Down Expand Up @@ -107,6 +109,8 @@ object Libs {
// loading animation
const val spinKit = "com.github.ybq:Android-SpinKit:${Versions.spinKit}"

const val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}"

// const val chuck = "com.readystatesoftware.chuck:library:${Versions.chuck}"
// const val releaseChuck = "com.readystatesoftware.chuck:library-no-op:${Versions.chuck}"

Expand Down
4 changes: 4 additions & 0 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlinx-serialization'

android {
compileSdkVersion 30
Expand Down Expand Up @@ -122,4 +123,7 @@ dependencies {

// debugImplementation Libs.chuck
// releaseImplementation Libs.releaseChuck

implementation Libs.serialization

}
2 changes: 2 additions & 0 deletions sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.iamport.sdk.data.sdk

import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable

@Parcelize
@Serializable
data class CardQuota(val card_quota : List<Int>?) : Parcelable
//if (method === 'card' && cardQuota !== 0) {
// params.display = {
Expand Down
3 changes: 3 additions & 0 deletions sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import com.iamport.sdk.domain.utils.CONST
import com.iamport.sdk.domain.utils.Util
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable

/**
* SDK 에 결제 요청할 데이터
* https://docs.iamport.kr/tech/imp?lang=ko#param
*/

@Parcelize
@Serializable
data class IamPortRequest(
val pg: String,
val pay_method: PayMethod = PayMethod.card, // 명세상 필수인지 불명확함, default card
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package com.iamport.sdk.data.sdk

import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable

/**
* for naverpay
*/

@Parcelize
@Serializable
data class ProductItem(
val categoryType: String,
val categoryId: String,
Expand Down

0 comments on commit b8a5b33

Please sign in to comment.