Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
b3cc383
Update README.md
sybock May 25, 2023
42b25a1
Update CHANGELOG.md
kangdromeda May 30, 2023
c5543d4
Merge pull request #10 from tosspayments/feature/cp-203
kangdromeda May 30, 2023
0216905
- version update
May 30, 2023
3baf09b
Merge branch 'release/0.1.4'
May 30, 2023
d64f487
Update README.md
sybock Jun 2, 2023
8d7ebac
- update amount 실패하는 이슈 수정
Jun 8, 2023
17ff453
- paymentMethods 객체 생성 누락 이슈 수정
Jun 8, 2023
2d671ec
Merge pull request #12 from tosspayments/issue/update_amount
kangdromeda Jun 8, 2023
c502654
- version update
Jun 8, 2023
e3191b2
Merge branch 'release/0.1.5'
Jun 8, 2023
dfcc592
issue (update_amount) : 금액 변경 기능 추가
Jun 8, 2023
c10da93
Merge branch 'develop'
Jun 8, 2023
764dfd4
- 기본 결제 정보 수정
Jun 8, 2023
38a9fa5
Merge branch 'develop'
Jun 8, 2023
e9040e8
- version update
Jun 8, 2023
3b61c7c
[QAESXT-2455] 에스크로 화면 미노출 이슈 수정
Jun 15, 2023
1e0ec17
Merge tag '0.1.7' into develop
Jun 16, 2023
107a087
Merge branch 'hotfix/0.1.7'
Jun 16, 2023
188aa12
renderPaymentMethods 스펙 추가
Jun 19, 2023
1556fa5
code 정리
Jun 20, 2023
dbe43c6
Merge pull request #14 from tosspayments/feature/pwd-181
kangdromeda Jun 20, 2023
ecfafca
widgetStatus 메세지 추가
Jun 20, 2023
be14321
- widget status listener 구현 및 예제 적용
Jun 20, 2023
b9c60d0
Merge pull request #15 from tosspayments/feature/pwd-189
kangdromeda Jun 20, 2023
6d60569
widgetStatus 메세지 추가
Jun 20, 2023
d11eb6a
widgetStatus interface 수정
Jun 26, 2023
191a31a
Merge branch 'release/0.1.8' into develop
Jun 26, 2023
2e66429
[0.1.8] CHANGELOG 추가
Jun 26, 2023
38573f8
Merge branch 'release/0.1.8' into develop
Jun 26, 2023
a22e6d3
- 환율, 국가코드 대문자로 변경
Jun 26, 2023
1828ab9
환율, 국가코드 강제 대문자 변환 로직 제거
Jun 26, 2023
7083ec5
- 결제 성공 금액 number format 오류 수정
Jul 3, 2023
bc0ab22
Merge branch 'feature/qaext-2493' into develop
Jul 3, 2023
d11192f
- 결제 금액 type 수정
Jul 3, 2023
3485886
- flavorDimension 추가
Jul 3, 2023
9a73819
release/0.1.9 : version update
Jul 3, 2023
3d4522f
release/0.1.9 : 추가 api 주석 수정, CHANGELOG 수정
Jul 3, 2023
b40fd9a
release/0.1.9 : 빌드 에러 수정
Jul 3, 2023
aff2b72
release/0.1.9 : 빌드 에러 수정
Jul 3, 2023
212ca4c
hotfix(0.1.10) : 결제 카드사 추가
Jul 11, 2023
daa168b
hotfix(0.1.10) : CHANGELOG 수정
Jul 11, 2023
6419dcc
Update README.md
sybock Jul 11, 2023
6da6a45
feature/pwd-225 : 에러 수신 interface 변경
Jul 18, 2023
0c5d069
Merge pull request #16 from tosspayments/feature/pwd-225
kangdromeda Jul 18, 2023
a61167a
release/0.1.11 : Version update
Jul 26, 2023
010274a
refactor: PaymentMethod.PaymentInfo 데이터 모델 구조 변경
sieunju Sep 18, 2023
c2fbaba
getSelectedPaymentMethod 구현
JooYang Sep 21, 2023
63ce7d4
validation error 처리
JooYang Sep 26, 2023
bd843ba
update version, CHANGELOG
JooYang Sep 26, 2023
a03d05b
update Sample Project
JooYang Sep 26, 2023
b80b76b
샘플 앱 동작/로그 추가
JooYang Oct 5, 2023
caa84fe
샘플 앱 동작 추가, lint
JooYang Oct 5, 2023
7d7452d
edit CHANGELOG
JooYang Oct 5, 2023
ba4d4cd
Merge pull request #18 from tosspayments/feat/cp-371
JooYang Oct 5, 2023
590782b
PaymentWidget options 파라미터 수정
JooYang Oct 6, 2023
9821a2d
feature/cp-376 : 로깅 시점 변경 및 샘플 앱 redirectUrl 이슈 수정 (#19)
JooYang Oct 11, 2023
ed39ad5
카드사 결제 취소 시 오류 화면으로 이동하는 이슈 수정 (#22)
JooYang Dec 13, 2023
2f532f3
release/0.1.13 : Version update
JooYang Dec 13, 2023
911d8a6
useInternationalCardOnly 파라미터 추가 (#23)
JooYang Jan 3, 2024
d8035d9
release/0.1.14 : Version update
JooYang Jan 3, 2024
bca9367
삼성카드 백신 앱 onestore 대응 (#25)
JooYang Mar 6, 2024
305d29c
release/0.1.15 : Version update
JooYang Mar 6, 2024
24570c4
결제 취소 문구 한글로 변경 (#26)
JooYang Jul 3, 2024
3e2fcac
release/0.1.16 : Version update
JooYang Jul 3, 2024
09d03e2
Payment SDK 다통화승인(외화결제) 지원 (#27)
JooYang Dec 19, 2024
f0f29ad
release/0.1.17 : Version update (#28)
JooYang Dec 19, 2024
d86bade
refactor: PaymentMethod.PaymentInfo 데이터 모델 구조 변경
sieunju Sep 18, 2023
1035293
fix: Code Conflict 대응
sieunju May 12, 2025
26bd4f3
Merge remote-tracking branch 'origin/feature/refactor_data_model' int…
sieunju May 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,11 @@ jobs:
uses: ASzc/change-string-case-action@v5
with:
string: ${{inputs.build_flavor}}
- name: Restore gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle/
echo "CUSTOMER_KEY=CUSTOMER_KEY" >> ~/.gradle/gradle.properties
echo "CLIENT_KEY=CLIENT_KEY" >> ~/.gradle/gradle.properties
echo "REDIRECT_URL=REDIRECT_URL" >> ~/.gradle/gradle.properties
echo "ORDER_ID=ORDER_ID" >> ~/.gradle/gradle.properties
- name: Set Build Variables
id: variables
run: |
echo "TASK=assemble${{steps.string.outputs.capitalized}}Debug" >> $GITHUB_OUTPUT
echo "FILE_PATH=./app/build/outputs/apk/${{steps.string.outputs.lowercase}}/debug/app-${{steps.string.outputs.lowercase}}-debug.apk" >> $GITHUB_OUTPUT
echo "TASK=assemble${{steps.string.outputs.capitalized}}LocalDebug" >> $GITHUB_OUTPUT
echo "FILE_PATH=./app/build/outputs/apk/${{steps.string.outputs.lowercase}}Local/debug/app-${{steps.string.outputs.lowercase}}-local-debug.apk" >> $GITHUB_OUTPUT
- name: Checkout Repository
uses: actions/checkout@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
local.properties
app/build
paymentsdk/build
build
app/.DS_Store
.DS_Store
66 changes: 61 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,60 @@
# 0.1.4 (2023.05.19)
# 0.1.17 (2024.12.19)
## Added
### Payment SDK 다통화승인(외화결제) 지원

# 0.1.16 (2024.07.03)
## Fixed
### 결제 취소 에러 문구 한글로 변경

# 0.1.15 (2024.03.06)
## Fixed
### 삼성카드 일반결제 백신 앱 (vguard) 이슈 대응

# 0.1.14 (2024.01.03)
## Added
### requestPayment의 PaymentInfo에 useInternationalCardOnly 파라미터 추가

# 0.1.13 (2023.12.13)
## Fixed
### 카드사 결제 페이지에서 취소 시 에러 화면으로 이동하는 이슈 수정

# 0.1.12 (2023.10.06)
## Added
### 고객이 선택한 결제수단 반환
com.tosspayments.paymentsdk.PaymentWidget.getSelectedPaymentMethod(): SelectedPaymentMethod

### 위젯 렌더링 status listener에 onFail 메서드 추가
com.tosspayments.paymentsdk.model.PaymentWidgetStatusListener.onFail(fail: TossPaymentResult.Fail)

| Parameter | Description |
|-----------|-------------|
| fail | 에러 정보 |

# 0.1.11 (2023.07.26)
## Fixed
### 결제 위젯에서 발생하는 Error Event 수신이 안되는 이슈 수정

# 0.1.10 (2023.07.11)
## Changed
### 결제 카드사 추가

# 0.1.9 (2023.07.04)
## Added
### 해외결제 지원 및 멀티위젯 옵션 추가
com.tosspayments.paymentsdk.PaymentWidget.renderPaymentMethods(com.tosspayments.paymentsdk.view.PaymentMethod, com.tosspayments.paymentsdk.view.PaymentMethod.Rendering.Amount, com.tosspayments.paymentsdk.view.PaymentMethod.Rendering.Options, com.tosspayments.paymentsdk.model.PaymentWidgetStatusListener)


# 0.1.8 (2023.06.26)

## Added
### 위젯 렌더링 status listener 추가
com.tosspayments.paymentsdk.model.PaymentWidgetStatusListener

## Changed
### renderPaymentMethods, renderAgreement 메서드 paymentWidgetStatusListener parameter 추가


# 0.1.4 (2023.05.30)

## Added
### 결제 수단 초기화 메서드
Expand All @@ -12,10 +68,10 @@ com.tosspayments.paymentsdk.PaymentWidget.renderPaymentMethods(method: PaymentMe
### 결제 요청
com. tosspayments.paymentsdk.PaymentWidget.requestPayment(paymentInfo: PaymentMethod.PaymentInfo, paymentCallback: PaymentCallback)

| Parameter | Description |
|-------------|-------------------|
| paymentInfo | 결제 정보 |
| paymentInfo | 결제 결과 수신 Callback |
| Parameter | Description |
|-----------------|-------------------|
| paymentInfo | 결제 정보 |
| paymentCallback | 결제 결과 수신 Callback |

### 결제 금액 갱신
com. tosspayments.paymentsdk.PaymentWidget.updateAmount(amount: Number, description: String?)
Expand Down
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
프로젝트의 Gradle 설정을 아래와 같이 설정하세요.

```gradle
// build.gradle(Project)

allprojects {
repositories {
...
mavenCentral()
maven { url "https://jitpack.io" }
}
// settings.gradle

dependencyResolutionManagement {
...
repositories {
...
mavenCentral()
maven { url "https://jitpack.io" }
}
}
```

Expand All @@ -43,24 +44,28 @@ dependencies {
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">

...

<com.tosspayments.paymentsdk.view.PaymentMethodWidget
android:id="@+id/payment_widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />

...
<com.tosspayments.paymentsdk.view.PaymentMethod
android:id="@+id/payment_widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp" />

<com.tosspayments.paymentsdk.view.Agreement
android:id="@+id/agreement_widget"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

...

</androidx.constraintlayout.widget.ConstraintLayout>

```

## 시작하기
Expand All @@ -79,6 +84,6 @@ git clone https://github.com/tosspayments/payment-sdk-android

2. Android Studio에서 프로젝트를 여세요.

3. [샘플 앱](https://github.com/tosspayments/payment-sdk-android/tree/main/app)을 빌드하세요. 앱을 실행하면 아래와 같이 다양한 결제수단 및 결제위젯을 테스트할 수 있습니다.
3. 'Android Studio > Build > Select Build Variant' 메뉴에서 app / paymentsdk 모두 **liveDebug** 설정 후 [샘플 앱](https://github.com/tosspayments/payment-sdk-android/tree/main/app)을 빌드하세요.

![토스페이먼츠 Android SDK 샘플 프로젝터 화면](https://static.tosspayments.com/docs/github/android-sample.png)
![토스페이먼츠 Android SDK 샘플 프로젝터 화면](https://static.tosspayments.com/docs/github/android-sample.png)
21 changes: 16 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ android {
namespace 'com.tosspayments.paymentsdk.sample'
compileSdk 33

flavorDimensions "server"
flavorDimensions "server", "source"

defaultConfig {
applicationId "com.tosspayments.paymentsdk.sample"
minSdk 21
targetSdk 33
versionCode 1
versionName "0.1.0"
versionName project.property("versionName") as String

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -29,14 +29,24 @@ android {
dimension "server"
applicationIdSuffix ".dev"
}

staging {
dimension "server"
applicationIdSuffix ".staging"
}

live {
dimension "server"
applicationIdSuffix ".live"
}

local {
dimension "source"
}

remote {
dimension "source"
}
}

buildTypes {
Expand All @@ -58,16 +68,17 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
viewBinding {
enabled = true
}
}

dependencies {
def lifecycle_version = "2.5.1"
def compose_version = "1.2.1"

// implementation 'com.github.tosspayments:payment-sdk-android:0.1.4'

// 로컬 테스트시 해제
implementation project(':paymentsdk')
// remoteImplementation 'com.github.tosspayments:payment-sdk-android:${project.property("versionName")}'

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.tosspayments.paymentsdk.sample.activity
import androidx.activity.viewModels
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import com.tosspayments.paymentsdk.model.paymentinfo.Currency
import com.tosspayments.paymentsdk.sample.viewmodel.CardPaymentViewModel
import com.tosspayments.paymentsdk.model.paymentinfo.TossCardPaymentCompany
import com.tosspayments.paymentsdk.model.paymentinfo.TossCardPaymentFlow
Expand All @@ -25,6 +26,7 @@ class CardPaymentActivity : PaymentActivity<TossCardPaymentInfo>() {
FlowMode()
EasyPay()
DiscountCode()
Currency()
}

@Composable
Expand Down Expand Up @@ -188,4 +190,15 @@ class CardPaymentActivity : PaymentActivity<TossCardPaymentInfo>() {
}
}
}

@Composable
private fun Currency() {
ItemSelectDialog("통화",
buttonText = viewModel.currency.collectAsState().value?.name ?: "통화 선택",
items = Currency.values().map { Pair(it.name, it) }) {
it?.let {
viewModel.setCurrency(it)
}
}
}
}
Loading