Skip to content

Commit

Permalink
Release 6.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-mobile committed Mar 16, 2022
1 parent 4216192 commit e241fa7
Show file tree
Hide file tree
Showing 63 changed files with 3,533 additions and 1,108 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.5
6.5.0
2 changes: 1 addition & 1 deletion .version_code
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6040500
6050000
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
### NEXT_VERSION_DESCRIPTION_BEGIN
### NEXT_VERSION_DESCRIPTION_END

## [6.5.0] (16-03-2022)

- Hide ThreatMetrix into mSdk
- Update documentation

## [6.4.5] (06-12-2021)

- Add confirmation in tokenize
Expand Down
6 changes: 5 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Migration guide

### Table of Contents
[6.4.5 -> 6.5.0](##6---6)
- Удалить библиотеку ThreatMetrix-Android-SDK-.aar, теперь она встроена в само SDK.

[6.0.0 -> 6.0.2](##6---6)
- Убрать зависимость `implementation ("ru.yoomoney.sdk.auth:auth:$yoo_sdk_auth_version")` - теперь она подтягивается автоматически

Expand Down Expand Up @@ -74,7 +77,8 @@ dependencies {
}
```

### **Подключить `ThreatMetrix Android SDK 6.2-97
### **Подключить `ThreatMetrix Android SDK 6.2-97.aar`**

> Если вы не использовали платежный метод “ЮMoney”, и не подключали sdk авторизации, то этот блок можно пропустить.
Попросите у менеджера по подключению библиотеку `ThreatMetrix Android SDK 6.2-97.aar`. Создайте папку libs в модуле где подключаете sdk и добавьте туда файл `ThreatMetrix Android SDK 6.2-97.aar`. В build.gradle того же модуля в dependencies добавьте:
Expand Down
1,614 changes: 1,347 additions & 267 deletions README.md

Large diffs are not rendered by default.

1,641 changes: 1,294 additions & 347 deletions README_RU.md
100755 → 100644

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/diagrams/base_flow_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/diagrams/base_flow_diagram_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/scan-bank-card/icon-scanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ allprojects {
applyFromFileIfExists('buildInternal.gradle')

buildscript {
ext.kotlin_version = '1.4.32'
ext.kotlin_version = '1.5.21'
ext.dokka_version = '0.9.17'
ext.okhttp_version = '4.3.1'
ext.mockito_version = '2.19.0'
Expand All @@ -42,16 +42,16 @@ buildscript {
ext.material = '1.2.1'
ext.recyclerview = '1.1.0'
ext.constraintlayout = '2.0.1'
ext.espresso_core = '3.3.0'
ext.espresso_intents = '3.3.0'
ext.espresso_web = '3.3.0'
ext.espresso_core = '3.4.0'
ext.espresso_intents = '3.4.0'
ext.espresso_web = '3.4.0'
ext.androidx_junit = '1.1.2'

ext.target_sdk_version = 30
ext.target_sdk_version = 31

repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
def file = file("buildscriptDependencies.gradle")
if (file.exists()) {
Expand All @@ -60,7 +60,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6'
Expand All @@ -72,9 +72,8 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "http://pay.cards/maven" }
maven { url "https://pay.cards/maven" }
maven { url "https://jitpack.io" }
}
}
Expand All @@ -85,4 +84,4 @@ if (file("buildscriptDependencies.gradle").exists()) {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
43 changes: 3 additions & 40 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ext {

android {
compileSdkVersion target_sdk_version
buildToolsVersion "30.0.2"
buildToolsVersion "31.0.0"

resourcePrefix 'ym_'

Expand Down Expand Up @@ -89,42 +89,5 @@ android {
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation "androidx.appcompat:appcompat:$appcompat"
implementation "com.google.android.material:material:$material"
implementation "androidx.recyclerview:recyclerview:$recyclerview"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout"
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation 'com.yandex.android:mobmetricalib:3.21.0'
implementation 'ru.tinkoff.decoro:decoro:1.5.0'
implementation 'androidx.fragment:fragment-ktx:1.3.5'

implementation 'commons-io:commons-io:2.5'
implementation 'commons-codec:commons-codec:1.15'
implementation "ru.yoomoney.sdk:march:$march_lib_version"
implementation "ru.yoomoney.sdk.gui:ui-lib:$ui_lib_version"
compileOnly fileTree(dir: "libs", include: ["profiling-tool.aar"])
implementation ("ru.yoomoney.sdk.auth:auth:$yoo_sdk_auth_version")

def daggerVersion = "2.35.1"
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"

testImplementation "junit:junit:$junit"
testImplementation 'androidx.test:core:1.3.0'
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0"
testImplementation 'org.robolectric:robolectric:4.0.1'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.7"
testImplementation 'org.assertj:assertj-core:3.15.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.7"
}

task copyTestClasses(type: Copy) {
from "build/tmp/kotlin-classes/devDebugUnitTest"
into "build/intermediates/classes/devDebug"
exclude '*/META-INF/library_devDebug.kotlin_module'
}
apply from: 'buildDependencies.gradle'
apply from: 'buildTestDependencies.gradle'
45 changes: 45 additions & 0 deletions library/buildDependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* The MIT License (MIT)
* Copyright © 2022 NBCO YooMoney LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the “Software”), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation 'androidx.work:work-runtime:2.7.1'
implementation "androidx.appcompat:appcompat:$appcompat"
implementation "com.google.android.material:material:$material"
implementation "androidx.recyclerview:recyclerview:$recyclerview"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout"
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation 'com.yandex.android:mobmetricalib:4.1.1'
implementation 'ru.tinkoff.decoro:decoro:1.5.0'
implementation 'androidx.fragment:fragment-ktx:1.3.5'

implementation 'commons-io:commons-io:2.5'
implementation 'commons-codec:commons-codec:1.15'
implementation "ru.yoomoney.sdk:march:$march_lib_version"
implementation "ru.yoomoney.sdk.gui:ui-lib:$ui_lib_version"
implementation ("ru.yoomoney.sdk.auth:auth:$yoo_sdk_auth_version")

def daggerVersion = "2.35.1"
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* The MIT License (MIT)
* Copyright © 2020 NBCO YooMoney LLC
* Copyright © 2022 NBCO YooMoney LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the “Software”), to deal in the Software without restriction, including
Expand All @@ -19,18 +19,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

package ru.yoomoney.sdk.kassa.payments.metrics

import ru.yoomoney.sdk.kassa.payments.paymentAuth.PaymentAuthTokenRepository

internal class UserAuthTokenTypeParamProvider(
private val paymentAuthTokenRepository: PaymentAuthTokenRepository
) : () -> AuthTokenType {

override fun invoke() = if (paymentAuthTokenRepository.isPaymentAuthPersisted) {
AuthTokenTypeMultiple()
} else {
AuthTokenTypeSingle()
}

}
dependencies {
testImplementation "junit:junit:$junit"
testImplementation 'androidx.test:core:1.4.0'
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0"
testImplementation 'org.assertj:assertj-core:3.15.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0"
}
2 changes: 1 addition & 1 deletion library/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion = "0.7.9"
toolVersion = "0.8.6"
reportsDir = file("$buildDir/reports")
}

Expand Down
5 changes: 4 additions & 1 deletion library/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ru.yoomoney.sdk.kassa.payments">
<application>
<application
android:networkSecurityConfig="@xml/ym_network_security_config"
tools:targetApi="n">
<activity
android:name="ru.yoomoney.sdk.kassa.payments.utils.WebViewActivity"
android:exported="false" />
Expand Down
15 changes: 15 additions & 0 deletions library/src/debug/res/xml/ym_network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<network-security-config xmlns:tools="http://schemas.android.com/tools"
tools:ignore="ResourceName">
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user"/>
</trust-anchors>
</debug-overrides>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">jenkins-ot.test.yamoney.ru</domain>
<domain includeSubdomains="true">iva-test-cms1.yamoney.ru</domain>
<domain includeSubdomains="true">stubohub.appb2b1.cloud.yooteam.ru</domain>
<domain includeSubdomains="true">payment-api-v3.appb2b1.cloud.yooteam.ru</domain>
</domain-config>
</network-security-config>
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ object Checkout {
return WebViewActivity.create(
context = context,
url = url,
logParam = "screen3ds"
logParam = "openScreen3ds"
)
}

Expand Down Expand Up @@ -218,7 +218,7 @@ object Checkout {
WebViewActivity.create(
context = context,
url = confirmationUrl,
logParam = "screen3ds"
logParam = "openScreen3ds"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,64 @@

package ru.yoomoney.sdk.kassa.payments.contract

import ru.yoomoney.sdk.kassa.payments.checkoutParameters.PaymentParameters
import ru.yoomoney.sdk.kassa.payments.metrics.AuthType
import ru.yoomoney.sdk.kassa.payments.metrics.ErrorScreenReporter
import ru.yoomoney.sdk.kassa.payments.metrics.Reporter
import ru.yoomoney.sdk.kassa.payments.model.LinkedCard
import ru.yoomoney.sdk.kassa.payments.model.BankCardPaymentOption
import ru.yoomoney.sdk.kassa.payments.model.PaymentIdCscConfirmation
import ru.yoomoney.sdk.kassa.payments.metrics.SavePaymentMethodProvider
import ru.yoomoney.sdk.march.Logic
import ru.yoomoney.sdk.march.Out
import ru.yoomoney.sdk.kassa.payments.metrics.TokenizeScheme
import ru.yoomoney.sdk.kassa.payments.metrics.TokenizeSchemeParamProvider
import ru.yoomoney.sdk.kassa.payments.model.PaymentInstrumentBankCard
import ru.yoomoney.sdk.kassa.payments.model.PaymentOption

private const val ACTION_SCREEN_PAYMENT_CONTRACT = "screenPaymentContract"
private const val ACTION_SCREEN_PAYMENT_CONTRACT_ERROR = "screenErrorContract"
private const val ACTION_LOGOUT = "actionLogout"

internal class ContractAnalytics(
private val reporter: Reporter,
private val errorScreenReporter: ErrorScreenReporter,
private val businessLogic: Logic<Contract.State, Contract.Action>,
private val getUserAuthType: () -> AuthType,
private val paymentParameters: PaymentParameters,
private val tokenizeSchemeParamProvider: TokenizeSchemeParamProvider,
private val getTokenizeScheme: (PaymentOption, PaymentInstrumentBankCard?) -> TokenizeScheme
) : Logic<Contract.State, Contract.Action> {

override fun invoke(state: Contract.State, action: Contract.Action): Out<Contract.State, Contract.Action> {
val nameArgsPairs = when (action) {
Contract.Action.Logout -> listOf("actionLogout" to null)
Contract.Action.Logout -> listOf(ACTION_LOGOUT to null)
is Contract.Action.LoadContractSuccess -> {
listOf(
"screenPaymentContract" to listOf(
ACTION_SCREEN_PAYMENT_CONTRACT to listOf(
getUserAuthType(),
getTokenizeScheme(
action.outputModel.paymentOption,
action.outputModel.instrument
)
),
when (action.outputModel.paymentOption) {
is BankCardPaymentOption -> "screenBankCardForm" to listOf(getUserAuthType())
is LinkedCard -> "screenLinkedCardForm" to null
is PaymentIdCscConfirmation -> "screenRecurringCardForm" to null
else -> null to null
}
)
)
}
is Contract.Action.LoadContractFailed -> {
tokenizeSchemeParamProvider.invoke()?.let { tokenizeScheme ->
listOf(
ACTION_SCREEN_PAYMENT_CONTRACT_ERROR to listOf(
getUserAuthType(),
tokenizeScheme,
SavePaymentMethodProvider().invoke(paymentParameters)
)
)
}
}
else -> listOf(null to null)
}

nameArgsPairs.forEach { pair ->
nameArgsPairs?.forEach { pair ->
pair.first?.let {
reporter.report(it, pair.second)
}
}

errorScreenReporter.takeIf { action is Contract.Action.LoadContractFailed }?.report()

return businessLogic(state, action)
}
}
Loading

0 comments on commit e241fa7

Please sign in to comment.