Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/features/cert' into features/cert
Browse files Browse the repository at this point in the history
  • Loading branch information
kjh5833 committed Mar 19, 2021
2 parents b3a5b5d + a69c80f commit c4527c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
23 changes: 19 additions & 4 deletions app/src/main/java/com/iamport/sampleapp/ui/PaymentFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import com.iamport.sampleapp.MerchantReceiver
import com.iamport.sampleapp.PaymentResultData.result
import com.iamport.sampleapp.R
import com.iamport.sampleapp.databinding.PaymentFragmentBinding
import com.iamport.sdk.data.sdk.IamPortApprove
import com.iamport.sdk.data.sdk.IamPortRequest
import com.iamport.sdk.data.sdk.IamPortResponse
import com.iamport.sdk.data.sdk.PG
import com.iamport.sdk.data.sdk.*
import com.iamport.sdk.domain.core.ICallbackPaymentResult
import com.iamport.sdk.domain.core.Iamport
import com.iamport.sdk.domain.utils.CONST
Expand Down Expand Up @@ -73,6 +70,10 @@ class PaymentFragment : BaseFragment<PaymentFragmentBinding>() {
onClickPayment()
}

viewDataBinding.certificationButton.setOnClickListener {
onClickCertification()
}

viewDataBinding.backButton.setOnClickListener {
backPressCallback.handleOnBackPressed()
}
Expand Down Expand Up @@ -113,6 +114,19 @@ class PaymentFragment : BaseFragment<PaymentFragmentBinding>() {
Log.i("SAMPLE", "isPolling? ${Iamport.isPollingValue()}")
}

fun onClickCertification() {
val userCode = "imp00357859"
val certification = IamPortCertification(
merchant_uid = "muid_aos_123123",
min_age = 19,
name = "김준혁",
phone = "010-4597-5833",
company = "유어포트",
)

Iamport.certification(userCode, certification) { callBackListener.result(it) }
}


// 결제 버튼 클릭
private fun onClickPayment() {
Expand Down Expand Up @@ -152,6 +166,7 @@ class PaymentFragment : BaseFragment<PaymentFragmentBinding>() {
// Iamport.payment(userCode, request,
// approveCallback = { approveCallback(it) },
// paymentResultCallback = { callBackListener.result(it) })

Iamport.payment(userCode, request) { callBackListener.result(it) }
}

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/payment_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@
app:layout_constraintRight_toRightOf="parent"
/>

<Button
android:id="@+id/certification_button"
android:layout_width="80dp"
android:layout_height="70dp"
android:layout_marginBottom="30dp"
android:text="@string/certification"
app:layout_constraintBottom_toTopOf="@id/payment_button"
app:layout_constraintLeft_toRightOf="@+id/back_button"/>


<Button
android:id="@+id/payment_button"
android:layout_width="300dp"
Expand Down

0 comments on commit c4527c7

Please sign in to comment.