-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from iamport/features/chai-subscribe
feat : CHAI 정기결제 연동 Features/chai subscribe
- Loading branch information
Showing
23 changed files
with
378 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
package com.iamport.sdk.data.chai | ||
|
||
import com.iamport.sdk.domain.utils.CONST | ||
import com.orhanobut.logger.Logger | ||
|
||
// 차이 네이티브 결제 관련 | ||
object CHAI { | ||
var pkg: String? = null | ||
const val SINGLE_ACTIVITY_VERSION: Long = 2000169 | ||
const val PAYMENT_ID = "paymentId" | ||
const val IDEMPOENCY_KEY = "idempotencyKey" | ||
const val SUBSCRIPTION_ID = "subscriptionId" | ||
const val IDEMPOTENCY_KEY = "idempotencyKey" | ||
const val STATUS = "status" | ||
const val NATIVE = "native" | ||
const val CHANNEL = "mobile" | ||
const val MODE = "staging" | ||
} | ||
|
||
// 차이 mode 설정에 따라 chai server url 이 다름 | ||
enum class CHAI_MODE(val url: String) { | ||
prod(CONST.CHAI_SERVICE_URL), | ||
staging(CONST.CHAI_SERVICE_STAGING_URL), | ||
dev(CONST.CHAI_SERVICE_DEV_URL); | ||
|
||
companion object { | ||
fun getChaiUrl(mode: String?): String { | ||
return values().find { mode == (it.name) }?.url ?: run { | ||
Logger.w("Not found CHAI mode => [$mode]") | ||
prod.url // default | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
sdk/src/main/java/com/iamport/sdk/data/chai/response/ChaiPaymentSubscription.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.iamport.sdk.data.chai.response | ||
|
||
data class ChaiPaymentSubscription( | ||
val subscriptionId: String, | ||
val status: String, | ||
val displayStatus: String, | ||
val idempotencyKey: String, | ||
val checkoutAmount: Float, | ||
val returnUrl: String, | ||
val description: String, | ||
val merchantUserId: String, | ||
val createdAt: String, // "2020-10-27T06:36:12.218Z", | ||
val updatedAt: String, // "2020-10-27T06:36:12.218Z", | ||
): BaseChaiPayment() |
2 changes: 1 addition & 1 deletion
2
sdk/src/main/java/com/iamport/sdk/data/chai/response/PaymentMetadata.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.iamport.sdk.data.chai.response | ||
|
||
data class PaymentMetadata(val merchantId: String) // "INIpayTest" | ||
data class PaymentMetadata(val merchantId: String?) // "INIpayTest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortApprove.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.