Skip to content

Commit 2beecb9

Browse files
author
ehowlsla
committed
결제상품 지원을 위한 리팩토링중
1 parent 088409a commit 2beecb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3091
-637
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies {
4848
Bootpay.init(getFragmentManager())
4949
.setApplicationId("59a7e647396fa64fcad4a8c2") // 해당 프로젝트(안드로이드)의 application id 값
5050
.setPG(PG.DANAL) // 결제할 PG 사
51-
.setUserPhone("010-1234-5678") // 구매자 전화번호
51+
.setUser_phone("010-1234-5678") // 구매자 전화번호
5252
.setMethod(Method.PHONE) // 결제수단
5353
.setName("맥북프로임다") // 결제할 상품명
5454
.setOrderId("1234") // 결제 고유번호

bootpay/bootpay.iml

Lines changed: 33 additions & 23 deletions
Large diffs are not rendered by default.

bootpay/build.gradle

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdkVersion 25
6-
buildToolsVersion '27.0.3'
5+
compileSdkVersion 26
6+
buildToolsVersion '28.0.3'
77

88
defaultConfig {
99
minSdkVersion 17
10-
targetSdkVersion 25
10+
targetSdkVersion 26
1111
versionCode 1
1212
versionName "1.0"
1313
}
@@ -17,6 +17,10 @@ android {
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
20+
compileOptions {
21+
sourceCompatibility = '1.8'
22+
targetCompatibility = '1.8'
23+
}
2024
}
2125

2226
dependencies {
@@ -30,8 +34,10 @@ dependencies {
3034
implementation 'com.squareup.retrofit2:converter-moshi:2.3.0'
3135
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
3236
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
33-
implementation 'com.android.support:appcompat-v7:25.3.1'// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
34-
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '1.2.41'
37+
implementation 'com.android.support:appcompat-v7:26.0.0'// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
38+
// implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.'
39+
40+
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '1.3.21'
3541
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
3642
}
3743
repositories {

bootpay/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
android:allowBackup="true"
1111
android:label="@string/app_name"
1212
android:supportsRtl="true">
13+
<activity android:name=".BootpayActivity" android:screenOrientation="portrait">
14+
<intent-filter>
15+
<action android:name="android.intent.action.VIEW"/>
16+
<data android:host="app2app" android:scheme="bootpay" />
17+
</intent-filter>
18+
</activity>
1319
</application>
1420

1521
</manifest>

bootpay/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import android.os.Bundle;
2929
* till the purchaseItem is consumed.
3030
* 4. An API to consume a purchaseItem of an inapp item. All purchases of one-time
3131
* in-app items are consumable and thereafter can be purchased again.
32-
* 5. An API to get current purchases of the user immediately. This will not contain any
32+
* 5. An API to get current purchases of the bootUser immediately. This will not contain any
3333
* consumed purchases.
3434
*
3535
* All calls will give a response code with the following possible values
3636
* RESULT_OK = 0 - success
37-
* RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog
37+
* RESULT_USER_CANCELED = 1 - bootUser pressed back or canceled a dialog
3838
* RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested
3939
* RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchaseItem
4040
* RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API
@@ -106,7 +106,7 @@ interface IInAppBillingService {
106106
String developerPayload);
107107

108108
/**
109-
* Returns the current SKUs owned by the user of the type and package name specified along with
109+
* Returns the current SKUs owned by the bootUser of the type and package name specified along with
110110
* purchaseItem information and a signature of the data to be validated.
111111
* This will return all SKUs that have been purchased in V3 and managed items purchased using
112112
* V1 and V2 that have not been consumed.
@@ -127,7 +127,7 @@ interface IInAppBillingService {
127127
* of the purchaseItem information
128128
* "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the
129129
* next set of in-app purchases. Only set if the
130-
* user has more owned skus than the current list.
130+
* bootUser has more owned skus than the current list.
131131
*/
132132
Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken);
133133

bootpay/src/main/java/kr/co/bootpay/Bootpay.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,33 @@
33
import android.app.Activity;
44
import android.app.Fragment;
55
import android.app.FragmentManager;
6+
import android.content.Context;
67

78
public class Bootpay {
8-
private static BootpayDialog.Builder builder;
9+
private static Context context;
10+
protected static BootpayBuilder builder;
11+
12+
/******************
13+
* 부트페이 앱투앱 관련 로직
14+
******************/
15+
public static BootpayBuilder init(Context context) {
16+
Bootpay.context = context;
17+
return builder = new BootpayBuilder(context);
18+
}
919

10-
public static BootpayDialog.Builder init(Activity activity) {
20+
/******************
21+
* 부트페이 일반결제 관련 로직
22+
******************/
23+
public static BootpayBuilder init(Activity activity) {
1124
return init(activity.getFragmentManager());
1225
}
1326

14-
public static BootpayDialog.Builder init(Fragment fragment) {
27+
public static BootpayBuilder init(Fragment fragment) {
1528
return init(fragment.getFragmentManager());
1629
}
1730

18-
public static BootpayDialog.Builder init(FragmentManager fragmentManager) {
19-
return builder = new BootpayDialog.Builder(fragmentManager);
31+
public static BootpayBuilder init(FragmentManager fragmentManager) {
32+
return builder = new BootpayBuilder(fragmentManager);
2033
}
2134

2235
public static void finish() {
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package kr.co.bootpay;
2+
3+
import android.app.Activity;
4+
import android.content.Context;
5+
import android.content.Intent;
6+
import android.os.Bundle;
7+
import android.support.annotation.Nullable;
8+
import android.util.Log;
9+
import android.widget.Toast;
10+
11+
import kr.co.bootpay.app2app.payapp.Payload;
12+
import kr.co.bootpay.model.Request;
13+
import kr.co.bootpay.pref.UserInfo;
14+
15+
public class BootpayActivity extends Activity {
16+
17+
public static final int REQUEST_INTERNAL = 1000; // 원격결제
18+
public static final int REQUEST_NOTEPAYMENT = 1001; // 수기결제
19+
public static final int REQUEST_NFCPAYMENT = 1002; // NFC 결제
20+
public static final int REQUEST_SAMSUNGPAYMENT = 1003; // 삼성페이
21+
public static final int REQUEST_FIXEDPERIODPAYMENT = 1004; // 정기결제
22+
public static final int REQUEST_CASHRECEIPTPAYMENT = 1005; // 현금영수증 발행 요청
23+
public static final int REQUEST_OCRPAYMENT = 1006; // 카메라 결제
24+
25+
Context context;
26+
27+
28+
@Override
29+
protected void onCreate(@Nullable Bundle savedInstanceState) {
30+
super.onCreate(savedInstanceState);
31+
// SecurePreference.context = this;
32+
this.context = this;
33+
UserInfo.update();
34+
startApp2App();
35+
36+
37+
38+
// setContentView();
39+
}
40+
41+
void startApp2App() {
42+
if ("payapp".equals(Bootpay.builder.request.getPg())) {
43+
startPayapp();
44+
}
45+
46+
}
47+
48+
void startPayapp() {
49+
try {
50+
Payload payload = new Payload(this, Bootpay.builder.request);
51+
Intent intent = new Intent(Intent.ACTION_VIEW, payload.toIntentUri());
52+
startActivityForResult(intent, 1);
53+
} catch (Exception e) {
54+
Log.d("intent", e.getMessage());
55+
}
56+
}
57+
58+
59+
private int getResultCode(Request request) {
60+
return 0;
61+
}
62+
63+
64+
@Override
65+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
66+
super.onActivityResult(requestCode, resultCode, data);
67+
68+
// Bootpay.builder
69+
if(data != null) {
70+
Log.d("result", "onActivityResult : " + data.getData().toString());
71+
72+
Toast.makeText(context, data.getData().toString(), Toast.LENGTH_SHORT).show();
73+
}
74+
}
75+
76+
}

bootpay/src/main/java/kr/co/bootpay/BootpayAnalytics.java

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ public static void login(
4242
String email,
4343
String userName
4444
) {
45-
login(id, email, userName, "");
45+
login(id, email, userName, Gender.UNKNOWN);
4646
}
4747

48-
public static void login(
49-
String id,
50-
String email,
51-
String userName,
52-
String gender
53-
) {
54-
login(id, email, userName, gender, null);
55-
}
48+
// public static void login(
49+
// String id,
50+
// String email,
51+
// String userName,
52+
// int gender
53+
// ) {
54+
// login(id, email, userName, gender, null);
55+
// }
5656

5757
public static void login(
5858
String id,
5959
String email,
6060
String userName,
61-
Gender gender
61+
int gender
6262
) {
6363
login(id, email, userName, gender, null);
6464
}
@@ -67,62 +67,62 @@ public static void login(
6767
String id,
6868
String email,
6969
String userName,
70-
String gender,
70+
int gender,
7171
String birth
7272
) {
7373
login(id, email, userName, gender, birth, null);
7474
}
7575

76-
public static void login(
77-
String id,
78-
String email,
79-
String userName,
80-
Gender gender,
81-
String birth
82-
) {
83-
login(id, email, userName, gender, birth, null);
84-
}
76+
// public static void login(
77+
// String id,
78+
// String email,
79+
// String userName,
80+
// int gender,
81+
// String birth
82+
// ) {
83+
// login(id, email, userName, gender, birth, null);
84+
// }
8585

8686

8787
public static void login(
8888
String id,
8989
String email,
9090
String userName,
91-
Gender gender,
91+
int gender,
9292
String birth,
9393
String phone
9494
) {
9595
login(id, email, userName, gender, birth, phone, null);
9696
}
9797

98-
public static void login(
99-
String id,
100-
String email,
101-
String userName,
102-
String gender,
103-
String birth,
104-
String phone
105-
) {
106-
login(id, email, userName, gender, birth, phone, null);
107-
}
108-
109-
public static void login(
110-
String id,
111-
String email,
112-
String userName,
113-
Gender gender,
114-
String birth,
115-
String phone,
116-
String area
117-
) {
118-
login(id, email, userName, gender == Gender.MALE ? "male" : "female", birth, phone, area);
119-
}
98+
// public static void login(
99+
// String id,
100+
// String email,
101+
// String userName,
102+
// int gender,
103+
// String birth,
104+
// String phone
105+
// ) {
106+
// login(id, email, userName, gender, birth, phone, null);
107+
// }
108+
109+
// public static void login(
110+
// String id,
111+
// String email,
112+
// String userName,
113+
// int gender,
114+
// String birth,
115+
// String phone,
116+
// String area
117+
// ) {
118+
// login(id, email, userName, gender, birth, phone, area);
119+
// }
120120

121121
public static void login(
122122
String id,
123123
String email,
124124
String userName,
125-
String gender,
125+
int gender,
126126
String birth,
127127
String phone,
128128
String area) {

0 commit comments

Comments
 (0)