diff --git a/local.properties b/local.properties index 48e21ec..40811fd 100644 --- a/local.properties +++ b/local.properties @@ -1,10 +1,8 @@ -## This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file should *NOT* be checked into Version Control Systems, +## This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -sdk.dir=/Users/iskhakov.s/Library/Android/sdk \ No newline at end of file +#Fri Jan 22 15:32:23 YEKT 2021 +sdk.dir=/Users/a.ignatov/Library/Android/sdk diff --git a/sdk/src/main/java/ru/cloudpayments/sdk/configuration/CloudpaymentsSDK.kt b/sdk/src/main/java/ru/cloudpayments/sdk/configuration/CloudpaymentsSDK.kt index 0d474d4..7d79011 100644 --- a/sdk/src/main/java/ru/cloudpayments/sdk/configuration/CloudpaymentsSDK.kt +++ b/sdk/src/main/java/ru/cloudpayments/sdk/configuration/CloudpaymentsSDK.kt @@ -1,5 +1,7 @@ package ru.cloudpayments.sdk.configuration +import android.content.Context +import android.content.Intent import androidx.appcompat.app.AppCompatActivity import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor @@ -16,6 +18,9 @@ import java.util.concurrent.TimeUnit interface CloudpaymentsSDK { fun start(configuration: PaymentConfiguration, from: AppCompatActivity, requestCode: Int) + + fun getStartIntent(context: Context, configuration: PaymentConfiguration): Intent + companion object { fun getInstance(): CloudpaymentsSDK { return CloudpaymentsSDKImpl() @@ -65,6 +70,10 @@ interface CloudpaymentsSDK { internal class CloudpaymentsSDKImpl: CloudpaymentsSDK { override fun start(configuration: PaymentConfiguration, from: AppCompatActivity, requestCode: Int) { - from.startActivityForResult(PaymentActivity.getStartIntent(from, configuration), requestCode) + from.startActivityForResult(this.getStartIntent(from, configuration), requestCode) + } + + override fun getStartIntent(context: Context, configuration: PaymentConfiguration): Intent { + return PaymentActivity.getStartIntent(context, configuration) } } \ No newline at end of file