Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Add getStartIntent function
Browse files Browse the repository at this point in the history
  • Loading branch information
a.ignatov committed Apr 8, 2021
1 parent 1e71909 commit 3da8bae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 3 additions & 5 deletions local.properties
Original file line number Diff line number Diff line change
@@ -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
#Fri Jan 22 15:32:23 YEKT 2021
sdk.dir=/Users/a.ignatov/Library/Android/sdk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 3da8bae

Please sign in to comment.