├── .version ├── .version_code ├── sample ├── .gitignore ├── src │ └── main │ │ └── res │ │ ├── values │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── dimens.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── values-ru │ │ └── strings.xml │ │ └── drawable-v24 │ │ └── ic_launcher_foreground.xml ├── proguard-rules.pro └── lint.xml ├── library ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ └── fonts │ │ │ │ └── rouble.otf │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── ym_ic_add_card.png │ │ │ │ ├── ym_ic_sberbank.png │ │ │ │ ├── ym_ic_yoomoney.png │ │ │ │ ├── ym_ic_google_pay.png │ │ │ │ ├── ym_ic_logo_kassa.png │ │ │ │ ├── ym_ic_sberpay_info.png │ │ │ │ ├── ym_bottom_sheet_dialog_rounded_top_corners.xml │ │ │ │ ├── ym_ic_forward_m.xml │ │ │ │ ├── ym_ic_close.xml │ │ │ │ ├── ym_ic_arrow_back_gray_24dp.xml │ │ │ │ ├── ym_ic_credit_europe_bank_list.xml │ │ │ │ ├── ym_ic_credit_bank_of_moscow_list.xml │ │ │ │ ├── ym_ic_rosbank_list.xml │ │ │ │ ├── ym_ic_russian_regional_development_bank_list.xml │ │ │ │ ├── ym_ic_cardbrand_switch.xml │ │ │ │ ├── ym_ic_scanner_m.xml │ │ │ │ ├── ym_ic_cardbrand_diners_club.xml │ │ │ │ ├── ym_ic_expobank_list.xml │ │ │ │ ├── ym_ic_raiffeisenbank_list.xml │ │ │ │ ├── ym_ic_cardbrand_american_express.xml │ │ │ │ ├── ym_ic_skb_bank_list.xml │ │ │ │ ├── ym_ic_bank_souyz_list.xml │ │ │ │ ├── ym_ic_otkritie_roket_list.xml │ │ │ │ ├── ym_ic_card_type_mc_l.xml │ │ │ │ ├── ym_ic_transkapitalbank_list.xml │ │ │ │ ├── ym_ic_home_credit_bank_list.xml │ │ │ │ ├── ym_ic_alfa_bank_list.xml │ │ │ │ ├── ym_ic_asian_pacific_bank_list.xml │ │ │ │ ├── ym_btn_primary_red_enabled.xml │ │ │ │ ├── ym_btn_primary_green_disabled.xml │ │ │ │ ├── ym_btn_primary_green_enabled.xml │ │ │ │ ├── ym_btn_primary_red_disabled.xml │ │ │ │ ├── ym_edit_text_cursor.xml │ │ │ │ ├── ym_ic_bank_avangard_list.xml │ │ │ │ ├── ym_ic_globex_bank_list.xml │ │ │ │ ├── ym_background_grey.xml │ │ │ │ ├── ym_dialog_background.xml │ │ │ │ ├── ym_ic_bin_bank_list.xml │ │ │ │ ├── ym_ic_mts_bank_list.xml │ │ │ │ ├── ym_confirm_code_input_background.xml │ │ │ │ ├── ym_ic_rosgosstrakh_bank_list.xml │ │ │ │ ├── ym_ic_cardbrand_mir.xml │ │ │ │ ├── ym_ic_chevron_right.xml │ │ │ │ ├── ym_bottom_sheet_line.xml │ │ │ │ ├── ym_ic_unknown_list.xml │ │ │ │ ├── ym_ic_more_options.xml │ │ │ │ └── ym_ic_moskovskiy_industrialnyi_bank_list.xml │ │ │ ├── drawable-ru │ │ │ │ └── ym_ic_logo_kassa.png │ │ │ ├── color │ │ │ │ └── ym_btn_primary.xml │ │ │ ├── layout │ │ │ │ ├── ym_fragment_money_auth.xml │ │ │ │ ├── ym_divider.xml │ │ │ │ └── ym_view_progress.xml │ │ │ ├── drawable-sw600dp │ │ │ │ └── ym_dialog_background.xml │ │ │ ├── values │ │ │ │ └── untranslateable_strings.xml │ │ │ ├── values-sw600dp │ │ │ │ ├── styles.xml │ │ │ │ └── screen.xml │ │ │ └── menu │ │ │ │ └── ym_menu_activity_webview.xml │ │ └── java │ │ │ ├── ru │ │ │ └── yoomoney │ │ │ │ └── sdk │ │ │ │ └── kassa │ │ │ │ └── payments │ │ │ │ ├── ui │ │ │ │ ├── FlatButtonView.kt │ │ │ │ └── ViewExtensions.kt │ │ │ │ ├── model │ │ │ │ ├── Executor.kt │ │ │ │ ├── PaymentOptionsResponse.kt │ │ │ │ ├── ShopProperties.kt │ │ │ │ ├── CardBrand.kt │ │ │ │ ├── PaymentInstrumentBankCard.kt │ │ │ │ └── CurrentUser.kt │ │ │ │ ├── payment │ │ │ │ ├── PaymentId.kt │ │ │ │ ├── CurrentUserRepository.kt │ │ │ │ ├── CheckPaymentAuthRequiredGateway.kt │ │ │ │ ├── loadOptionList │ │ │ │ │ ├── PaymentOptionListIsEmptyException.kt │ │ │ │ │ └── PaymentOptionListRepository.kt │ │ │ │ ├── unbindCard │ │ │ │ │ └── UnbindCardGateway.kt │ │ │ │ ├── tokenize │ │ │ │ │ └── PaymentOptionInfoGateway.kt │ │ │ │ ├── PaymentMethodRepository.kt │ │ │ │ ├── loadPaymentInfo │ │ │ │ │ └── PaymentMethodInfoGateway.kt │ │ │ │ ├── selectOption │ │ │ │ │ └── SelectPaymentOptionUseCase.kt │ │ │ │ └── googlePay │ │ │ │ │ ├── GooglePayRepository.kt │ │ │ │ │ └── GooglePayTokenizationResult.kt │ │ │ │ ├── logout │ │ │ │ ├── LogoutRepository.kt │ │ │ │ └── LogoutUseCaseImpl.kt │ │ │ │ ├── tmx │ │ │ │ └── TmxSessionIdStorage.kt │ │ │ │ ├── errorFormatter │ │ │ │ └── ErrorFormatter.kt │ │ │ │ ├── contract │ │ │ │ └── SelectPaymentMethodUseCase.kt │ │ │ │ ├── paymentOptionList │ │ │ │ ├── ConfigUseCase.kt │ │ │ │ ├── unbind │ │ │ │ │ └── UnbindCardUseCase.kt │ │ │ │ ├── ShopPropertiesRepository.kt │ │ │ │ ├── ConfigUseCaseImpl.kt │ │ │ │ ├── PaymentOptionListItem.kt │ │ │ │ └── PaymentOptionView.kt │ │ │ │ ├── unbind │ │ │ │ ├── UnbindCardUseCase.kt │ │ │ │ └── MockUnbindCardGateway.kt │ │ │ │ ├── userAuth │ │ │ │ ├── User.kt │ │ │ │ ├── GetTransferDataUseCase.kt │ │ │ │ ├── AuthorizeUserRepository.kt │ │ │ │ ├── UserAuthInfoRepository.kt │ │ │ │ └── MockAuthorizeUserRepository.kt │ │ │ │ ├── metrics │ │ │ │ ├── bankCard │ │ │ │ │ └── BankCardAnalyticsLogger.kt │ │ │ │ ├── TokenizeSchemeParamProvider.kt │ │ │ │ └── ErrorScreenReporter.kt │ │ │ │ ├── logging │ │ │ │ ├── Logger.kt │ │ │ │ └── MsdkLogger.kt │ │ │ │ ├── http │ │ │ │ └── HostProvider.kt │ │ │ │ ├── secure │ │ │ │ └── Storage.kt │ │ │ │ ├── navigation │ │ │ │ ├── Router.kt │ │ │ │ └── AppRouter.kt │ │ │ │ ├── utils │ │ │ │ ├── PaymentMethodsUtils.kt │ │ │ │ ├── Language.kt │ │ │ │ ├── ContextExtention.kt │ │ │ │ ├── FileExtensions.kt │ │ │ │ ├── SimpleTextWatcher.kt │ │ │ │ ├── FragmentExtensions.kt │ │ │ │ └── PatternInputFilter.kt │ │ │ │ ├── paymentAuth │ │ │ │ ├── ProcessPaymentAuthUseCase.kt │ │ │ │ ├── PaymentAuthTokenRepository.kt │ │ │ │ ├── RequestPaymentAuthUseCase.kt │ │ │ │ ├── SmsSessionRetryRepository.kt │ │ │ │ ├── PaymentAuthTypeRepository.kt │ │ │ │ ├── MockSmsSessionRetryRepository.kt │ │ │ │ └── MockPaymentAuthTypeRepository.kt │ │ │ │ ├── extensions │ │ │ │ ├── CharSequenceExtensions.kt │ │ │ │ ├── ViewAnimatorExtensions.kt │ │ │ │ ├── ColorExtensions.kt │ │ │ │ ├── AmountExtensions.kt │ │ │ │ └── FragmentManagerExtensions.kt │ │ │ │ ├── tokenize │ │ │ │ └── TokenizeUseCase.kt │ │ │ │ ├── config │ │ │ │ ├── ConfigRepository.kt │ │ │ │ └── MockConfigRepository.kt │ │ │ │ ├── di │ │ │ │ ├── ViewModelKey.kt │ │ │ │ ├── PaymentOptionsListFormatter.kt │ │ │ │ ├── ViewModelKeyedFactoryModule.kt │ │ │ │ └── OkHttpModule.kt │ │ │ │ └── TokenizationResult.kt │ │ │ └── androidx │ │ │ └── lifecycle │ │ │ └── ViewModelKeyedFactory.kt │ ├── debug │ │ └── res │ │ │ └── xml │ │ │ └── ym_network_security_config.xml │ └── test │ │ └── resources │ │ └── robolectric.properties ├── lint.xml └── buildTestDependencies.gradle ├── logo.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── assets └── images │ ├── diagrams │ ├── base_flow_diagram.png │ └── base_flow_diagram_en.png │ ├── scan-bank-card │ ├── icon-scanner.png │ ├── bank-card-form-with-scan.png │ └── bank-card-form-without-scan.png │ ├── pay-flow-examples │ ├── 3_payment_method_screen.png │ ├── 5_post_purchase_screen.png │ ├── 4_google_pay_api_payment_screen.png │ └── 1_2_item_selection_pre_purchase_screen.png │ ├── recurrent-payments │ ├── save-payment-method-on.png │ └── save-payment-method-user-selects.png │ └── custom_ui_parameters_examples │ ├── 1_show_logo_true.png │ ├── 2_show_logo_false.png │ ├── 3_good_color_example.png │ └── 4_bad_color_example.png ├── .gitignore ├── LICENSE.txt ├── settings.gradle └── sensitive.gradle /.version: -------------------------------------------------------------------------------- 1 | 6.5.2 -------------------------------------------------------------------------------- /.version_code: -------------------------------------------------------------------------------- 1 | 6050200 -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/logo.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /library/src/main/assets/fonts/rouble.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/assets/fonts/rouble.otf -------------------------------------------------------------------------------- /assets/images/diagrams/base_flow_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/diagrams/base_flow_diagram.png -------------------------------------------------------------------------------- /assets/images/scan-bank-card/icon-scanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/scan-bank-card/icon-scanner.png -------------------------------------------------------------------------------- /assets/images/diagrams/base_flow_diagram_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/diagrams/base_flow_diagram_en.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_add_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_add_card.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_sberbank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_sberbank.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_yoomoney.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_yoomoney.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_google_pay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_google_pay.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_logo_kassa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_logo_kassa.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-ru/ym_ic_logo_kassa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable-ru/ym_ic_logo_kassa.png -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_sberpay_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/library/src/main/res/drawable/ym_ic_sberpay_info.png -------------------------------------------------------------------------------- /assets/images/pay-flow-examples/3_payment_method_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/pay-flow-examples/3_payment_method_screen.png -------------------------------------------------------------------------------- /assets/images/pay-flow-examples/5_post_purchase_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/pay-flow-examples/5_post_purchase_screen.png -------------------------------------------------------------------------------- /assets/images/recurrent-payments/save-payment-method-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/recurrent-payments/save-payment-method-on.png -------------------------------------------------------------------------------- /assets/images/scan-bank-card/bank-card-form-with-scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/scan-bank-card/bank-card-form-with-scan.png -------------------------------------------------------------------------------- /assets/images/scan-bank-card/bank-card-form-without-scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/scan-bank-card/bank-card-form-without-scan.png -------------------------------------------------------------------------------- /sample/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #0E1930 4 | -------------------------------------------------------------------------------- /assets/images/custom_ui_parameters_examples/1_show_logo_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/custom_ui_parameters_examples/1_show_logo_true.png -------------------------------------------------------------------------------- /assets/images/custom_ui_parameters_examples/2_show_logo_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/custom_ui_parameters_examples/2_show_logo_false.png -------------------------------------------------------------------------------- /assets/images/custom_ui_parameters_examples/3_good_color_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/custom_ui_parameters_examples/3_good_color_example.png -------------------------------------------------------------------------------- /assets/images/custom_ui_parameters_examples/4_bad_color_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/custom_ui_parameters_examples/4_bad_color_example.png -------------------------------------------------------------------------------- /assets/images/pay-flow-examples/4_google_pay_api_payment_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/pay-flow-examples/4_google_pay_api_payment_screen.png -------------------------------------------------------------------------------- /assets/images/recurrent-payments/save-payment-method-user-selects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/recurrent-payments/save-payment-method-user-selects.png -------------------------------------------------------------------------------- /assets/images/pay-flow-examples/1_2_item_selection_pre_purchase_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yoomoney/yookassa-android-sdk/HEAD/assets/images/pay-flow-examples/1_2_item_selection_pre_purchase_screen.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_bottom_sheet_dialog_rounded_top_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_forward_m.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | gen-aa/ 15 | classes/ 16 | fastlane/ 17 | 18 | # Local configuration file (sdk path, etc) 19 | local.properties 20 | 21 | # Idea files 22 | workspace.xml 23 | *.session 24 | .gradle/ 25 | .idea/* 26 | !.idea/codeStyles/ 27 | !.idea/copyright/ 28 | *.iml 29 | build/ 30 | 31 | *.gpg 32 | 33 | android-signing/ 34 | 35 | .DS_Store -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_arrow_back_gray_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /sample/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Демо mSDK 3 | Начать платёж 4 | Токенизация отменена 5 | Токен: %1$s 6 | Комета 7 | Очень яркая, период обращения — 112 лет 8 | +79991234567 9 | https://custom.redirect.url/ 10 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Demo mSDK 3 | Start the payment process 4 | Tokenization canceled 5 | Token: %1$s 6 | +79991234567 7 | https://custom.redirect.url/ 8 | Comet 9 | Very bright, with an orbital period of 112 years. 10 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_credit_europe_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/ui/FlatButtonView.kt: -------------------------------------------------------------------------------- 1 | package ru.yoomoney.sdk.kassa.payments.ui 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import ru.yoomoney.sdk.gui.widget.button.PrimaryButtonView 6 | import ru.yoomoney.sdk.kassa.payments.R 7 | import ru.yoomoney.sdk.kassa.payments.ui.color.InMemoryColorSchemeRepository 8 | 9 | internal class FlatButtonView 10 | @JvmOverloads constructor( 11 | context: Context, 12 | attrs: AttributeSet? = null, 13 | defStyleAttr: Int = R.attr.ym_FlatButton_Style 14 | ) : PrimaryButtonView(context, attrs, defStyleAttr) { 15 | 16 | init { 17 | iconStateColor = InMemoryColorSchemeRepository.typeColorStateList(context) 18 | setTextColor(InMemoryColorSchemeRepository.typeColorStateList(context)) 19 | } 20 | } -------------------------------------------------------------------------------- /library/src/debug/res/xml/ym_network_security_config.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | jenkins-ot.test.yamoney.ru 11 | iva-test-cms1.yamoney.ru 12 | stubohub.appb2b1.cloud.yooteam.ru 13 | payment-api-v3.appb2b1.cloud.yooteam.ru 14 | 15 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_credit_bank_of_moscow_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_rosbank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -printconfiguration ../all-proguard-rules.txt -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_russian_regional_development_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_cardbrand_switch.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_scanner_m.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_cardbrand_diners_club.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2020 NBCO YooMoney LLC 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the “Software”), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 8 | following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial 11 | portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 15 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 16 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 17 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 18 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /library/src/test/resources/robolectric.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # Copyright © 2020 NBCO YooMoney LLC 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | # associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | # of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | # following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial 12 | # portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | # OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | # OTHER DEALINGS IN THE SOFTWARE. 20 | # 21 | 22 | sdk=29 -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_expobank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_raiffeisenbank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_cardbrand_american_express.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | include ':demo', ':library', 'sample' 23 | include ':librarytests' 24 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_skb_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_bank_souyz_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_otkritie_roket_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /library/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/Executor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | internal interface Executor: (() -> Unit) -> Unit -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/PaymentId.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment 23 | 24 | internal typealias PaymentMethodId = String -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_card_type_mc_l.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 14 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_transkapitalbank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_home_credit_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/logout/LogoutRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.logout 23 | 24 | internal interface LogoutRepository { 25 | suspend fun logout() 26 | } 27 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_alfa_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/tmx/TmxSessionIdStorage.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2018 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.tmx 23 | 24 | internal class TmxSessionIdStorage { 25 | var tmxSessionId: String? = null 26 | } 27 | -------------------------------------------------------------------------------- /sample/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/errorFormatter/ErrorFormatter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.errorFormatter 23 | 24 | internal interface ErrorFormatter { 25 | fun format(e: Throwable): CharSequence 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/contract/SelectPaymentMethodUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.contract 23 | 24 | internal interface SelectPaymentMethodUseCase { 25 | suspend fun select(): Contract.Action 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/ConfigUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList 23 | 24 | internal interface ConfigUseCase { 25 | fun loadConfig(): PaymentOptionList.Action 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/unbind/UnbindCardUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.unbind 23 | 24 | internal interface UnbindCardUseCase { 25 | suspend fun unbindCard(bindingId: String): UnbindCard.Action 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/userAuth/User.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.userAuth 23 | 24 | internal sealed class User { 25 | data class Authorized(val token: String): User() 26 | object Empty: User() 27 | } -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | @dimen/ym_space_3xl 24 | @dimen/ym_space_2xl 25 | -------------------------------------------------------------------------------- /sensitive.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | ext { 23 | merchantToken = "live_MTkzODU2VY5GiyQq2GMPsCQ0PW7f_RSLtJYOT-mp_CA" 24 | shopId = "193856" 25 | cliendId = "hitm6hg51j1d3g1u3ln040bajiol903b" 26 | metricaKey = '07742363-987c-4a90-8182-35fd3e042080' 27 | } 28 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/metrics/bankCard/BankCardAnalyticsLogger.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.metrics.bankCard 23 | 24 | internal interface BankCardAnalyticsLogger { 25 | fun onNewEvent(event: BankCardEvent) 26 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_asian_pacific_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/logging/Logger.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.logging 23 | 24 | internal interface Logger : (String, Exception?) -> Unit { 25 | override fun invoke(message: String, error: Exception?) 26 | } 27 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # Copyright © 2020 NBCO YooMoney LLC 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | # associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | # of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | # following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial 12 | # portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | # OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | # OTHER DEALINGS IN THE SOFTWARE. 20 | # 21 | 22 | #Mon Oct 04 15:46:42 MSK 2021 23 | distributionBase=GRADLE_USER_HOME 24 | distributionPath=wrapper/dists 25 | zipStoreBase=GRADLE_USER_HOME 26 | zipStorePath=wrapper/dists 27 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/http/HostProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.http 23 | 24 | internal interface HostProvider { 25 | fun host(): String 26 | fun paymentAuthorizationHost(): String 27 | fun authHost(): String? 28 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/userAuth/GetTransferDataUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.userAuth 23 | 24 | internal interface GetTransferDataUseCase { 25 | suspend fun getTransferAuxToken(cryptogram: String): MoneyAuth.Action 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/PaymentOptionsResponse.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | internal data class PaymentOptionsResponse( 25 | val paymentOptions: List, 26 | val shopProperties: ShopProperties 27 | ) -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/secure/Storage.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.secure 23 | 24 | internal interface Storage { 25 | fun get(key: String): T? 26 | fun getOrCreate(key: String): T 27 | fun remove(key: String) 28 | } 29 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/navigation/Router.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.navigation 23 | 24 | import androidx.lifecycle.LiveData 25 | 26 | internal interface Router { 27 | val screensData: LiveData 28 | fun navigateTo(screen: Screen) 29 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/PaymentMethodsUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.PaymentMethodType 25 | 26 | internal fun getAllPaymentMethods() = setOf(*PaymentMethodType.values()) 27 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/CurrentUserRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.CurrentUser 25 | 26 | internal interface CurrentUserRepository { 27 | var currentUser: CurrentUser 28 | } 29 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/ProcessPaymentAuthUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | internal interface ProcessPaymentAuthUseCase { 25 | suspend fun process(passphrase: String?, linkWalletToApp: Boolean): PaymentAuth.Action 26 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/userAuth/AuthorizeUserRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.userAuth 23 | import ru.yoomoney.sdk.kassa.payments.model.Result 24 | 25 | internal interface AuthorizeUserRepository { 26 | fun authorizeUser(): Result 27 | } 28 | -------------------------------------------------------------------------------- /library/src/main/res/color/ym_btn_primary.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/res/layout/ym_fragment_money_auth.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/Language.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import java.util.Locale 25 | 26 | internal fun getLanguage(): String { 27 | return Locale.getDefault().language.let { 28 | if (it == "ru") it else "en" 29 | } 30 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/extensions/CharSequenceExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.extensions 23 | 24 | private val phoneMask = Regex("\\+7 \\d{3} \\d{3}-\\d{2}-\\d{2}") 25 | 26 | internal val CharSequence.isPhoneNumber: Boolean 27 | get() = matches(phoneMask) 28 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/CheckPaymentAuthRequiredGateway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment 23 | 24 | internal interface CheckPaymentAuthRequiredGateway { 25 | fun checkPaymentAuthRequired(): Boolean 26 | fun checkUserAccountRemember(): Boolean 27 | } 28 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/loadOptionList/PaymentOptionListIsEmptyException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.loadOptionList 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.SdkException 25 | 26 | internal class PaymentOptionListIsEmptyException : SdkException() -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_btn_primary_red_enabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/ContextExtention.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import android.content.Context 25 | import android.content.pm.ApplicationInfo 26 | 27 | internal fun Context.isBuildDebug() = applicationInfo.flags != 0 && ApplicationInfo.FLAG_DEBUGGABLE != 0 -------------------------------------------------------------------------------- /library/src/main/res/drawable-sw600dp/ym_dialog_background.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_btn_primary_green_disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_btn_primary_green_enabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_btn_primary_red_disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_edit_text_cursor.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_bank_avangard_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 18 | 21 | 25 | 28 | 32 | 33 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_globex_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 18 | 21 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /library/src/main/res/values/untranslateable_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | +7 987 654-32-10 25 | bottom sheet transition 26 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/ShopProperties.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | internal data class ShopProperties( 25 | val isSafeDeal: Boolean, 26 | val isMarketplace: Boolean 27 | ) 28 | 29 | internal val ShopProperties.isSplitPayment get() = isSafeDeal || isMarketplace -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/FileExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import java.io.InputStream 25 | import java.util.Scanner 26 | 27 | internal fun InputStream.readText(): String { 28 | return Scanner(this) 29 | .useDelimiter("\\A") 30 | .next() 31 | } -------------------------------------------------------------------------------- /library/src/main/res/values-sw600dp/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/tokenize/TokenizeUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.tokenize 23 | 24 | import ru.yoomoney.sdk.kassa.payments.payment.tokenize.TokenizeInputModel 25 | 26 | internal interface TokenizeUseCase { 27 | suspend fun tokenize(model: TokenizeInputModel): Tokenize.Action 28 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/userAuth/UserAuthInfoRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.userAuth 23 | 24 | internal interface UserAuthInfoRepository { 25 | var userAuthToken: String? 26 | var userAuthName: String? 27 | var userAvatarUrl: String? 28 | var passportAuthToken: String? 29 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_background_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/metrics/TokenizeSchemeParamProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.metrics 23 | 24 | internal open class TokenizeSchemeParamProvider : () -> TokenizeScheme? { 25 | var tokenizeScheme: TokenizeScheme? = null 26 | 27 | override operator fun invoke() = tokenizeScheme 28 | } 29 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/config/ConfigRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.config 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.Config 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal interface ConfigRepository { 28 | fun getConfig(): Config 29 | fun loadConfig(): Result 30 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/PaymentAuthTokenRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | internal interface PaymentAuthTokenRepository { 25 | var paymentAuthToken: String? 26 | val isPaymentAuthPersisted: Boolean 27 | var isUserAccountRemember: Boolean 28 | fun persistPaymentAuth() 29 | } 30 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/unbind/UnbindCardUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList.unbind 23 | 24 | import ru.yoomoney.sdk.kassa.payments.paymentOptionList.PaymentOptionList 25 | 26 | internal interface UnbindCardUseCase { 27 | suspend fun unbindCard(bindingId: String): PaymentOptionList.Action 28 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/extensions/ViewAnimatorExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | @file:JvmName("ViewAnimatorExtensions") 23 | 24 | package ru.yoomoney.sdk.kassa.payments.extensions 25 | 26 | import android.view.View 27 | import android.widget.ViewAnimator 28 | 29 | internal fun ViewAnimator.showChild(child: View) { 30 | displayedChild = indexOfChild(child) 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/RequestPaymentAuthUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.Amount 25 | 26 | internal interface RequestPaymentAuthUseCase { 27 | suspend fun startPaymentAuth(linkWalletToApp: Boolean, amount: Amount): PaymentAuth.Action 28 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/SmsSessionRetryRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.AuthTypeState 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal interface SmsSessionRetryRepository { 28 | fun retrySmsSession(): Result 29 | } 30 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_dialog_background.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /library/src/main/res/layout/ym_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 23 | 24 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_bin_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 16 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/unbindCard/UnbindCardGateway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.unbindCard 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.Result 25 | import ru.yoomoney.sdk.kassa.payments.model.SuccessUnbinding 26 | 27 | internal interface UnbindCardGateway { 28 | fun unbindCard(bindingId: String): Result 29 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_mts_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/di/ViewModelKey.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.di 23 | 24 | import dagger.MapKey 25 | 26 | @Target( 27 | AnnotationTarget.FUNCTION, 28 | AnnotationTarget.PROPERTY_GETTER, 29 | AnnotationTarget.PROPERTY_SETTER 30 | ) 31 | @Retention(AnnotationRetention.RUNTIME) 32 | @MapKey 33 | internal annotation class ViewModelKey(val key: String) 34 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_confirm_code_input_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_rosgosstrakh_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/logging/MsdkLogger.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.logging 23 | 24 | import android.util.Log 25 | 26 | internal class MsdkLogger : Logger { 27 | override fun invoke(message: String, error: Exception?) { 28 | Log.d(TAG, message, error) 29 | } 30 | 31 | companion object { 32 | const val TAG = "YooKassa.SDK" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 9 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/logout/LogoutUseCaseImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.logout 23 | 24 | internal interface LogoutUseCase { 25 | suspend fun logout() 26 | } 27 | 28 | internal class LogoutUseCaseImpl( 29 | private val logoutRepository: LogoutRepository 30 | ): LogoutUseCase { 31 | override suspend fun logout() { 32 | logoutRepository.logout() 33 | } 34 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/tokenize/PaymentOptionInfoGateway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.tokenize 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.PaymentOption 25 | import ru.yoomoney.sdk.kassa.payments.model.PaymentOptionInfo 26 | 27 | internal interface PaymentOptionInfoGateway { 28 | fun getPaymentOptionInfo(paymentOption: PaymentOption): PaymentOptionInfo? 29 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_cardbrand_mir.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 13 | 16 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/PaymentMethodRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment 23 | 24 | interface PaymentMethodRepository { 25 | var paymentOptionId: Int? 26 | var instrumentId: String? 27 | } 28 | 29 | internal data class PaymentMethodRepositoryImpl( 30 | override var paymentOptionId: Int?, 31 | override var instrumentId: String? 32 | ) : PaymentMethodRepository -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/loadPaymentInfo/PaymentMethodInfoGateway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.loadPaymentInfo 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.PaymentMethodBankCard 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal interface PaymentMethodInfoGateway { 28 | fun getPaymentMethodInfo(paymentMethodId: String): Result 29 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/CardBrand.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | internal enum class CardBrand { 25 | MASTER_CARD, 26 | VISA, 27 | MIR, 28 | AMERICAN_EXPRESS, 29 | JCB, 30 | CUP, 31 | DINERS_CLUB, 32 | BANK_CARD, 33 | DISCOVER_CARD, 34 | INSTA_PAYMENT, 35 | INSTA_PAYMENT_TM, 36 | LASER, 37 | DANKORT, 38 | SOLO, 39 | SWITCH, 40 | UNKNOWN; 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/res/values-sw600dp/screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | true 25 | 450dp 26 | 394dp 27 | -1px 28 | 29 | -1px 30 | 31 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_chevron_right.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_bottom_sheet_line.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/PaymentAuthTypeRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.Amount 25 | import ru.yoomoney.sdk.kassa.payments.model.AuthTypeState 26 | import ru.yoomoney.sdk.kassa.payments.model.Result 27 | 28 | internal interface PaymentAuthTypeRepository { 29 | fun getPaymentAuthType(linkWalletToApp: Boolean, amount: Amount): Result 30 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/ShopPropertiesRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.ShopProperties 25 | 26 | internal interface ShopPropertiesRepository { 27 | var shopProperties: ShopProperties 28 | } 29 | 30 | internal class ShopPropertiesRepositoryImpl : ShopPropertiesRepository { 31 | override var shopProperties: ShopProperties = ShopProperties(false, false) 32 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/userAuth/MockAuthorizeUserRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.userAuth 23 | 24 | import android.os.SystemClock 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal object MockAuthorizeUserRepository : AuthorizeUserRepository { 28 | 29 | override fun authorizeUser(): Result { 30 | SystemClock.sleep(1000L) 31 | return Result.Success(User.Authorized("user auth token")) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/MockSmsSessionRetryRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.AuthTypeState 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal class MockSmsSessionRetryRepository : SmsSessionRetryRepository { 28 | override fun retrySmsSession(): Result { 29 | return Result.Success(AuthTypeState.SMS(15, 4, 3, 3)) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/TokenizationResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments 23 | 24 | import androidx.annotation.Keep 25 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.PaymentMethodType 26 | 27 | /** 28 | * Result for payment tokenization. 29 | * Can be obtained with [Checkout.createTokenizationResult]. 30 | */ 31 | @Keep 32 | data class TokenizationResult( 33 | @Keep val paymentToken: String, 34 | @Keep val paymentMethodType: PaymentMethodType 35 | ) 36 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/selectOption/SelectPaymentOptionUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.selectOption 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.PaymentInstrumentBankCard 25 | import ru.yoomoney.sdk.kassa.payments.model.PaymentOption 26 | 27 | internal data class SelectedPaymentMethodOutputModel( 28 | val paymentOption: PaymentOption, 29 | val instrument: PaymentInstrumentBankCard?, 30 | val walletLinkingPossible: Boolean 31 | ) 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/di/PaymentOptionsListFormatter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.di 23 | 24 | import javax.inject.Qualifier 25 | 26 | @Qualifier 27 | @kotlin.annotation.Retention(AnnotationRetention.RUNTIME) 28 | @Target( 29 | AnnotationTarget.FIELD, 30 | AnnotationTarget.VALUE_PARAMETER, 31 | AnnotationTarget.FUNCTION, 32 | AnnotationTarget.PROPERTY_GETTER, 33 | AnnotationTarget.PROPERTY_SETTER 34 | ) 35 | internal annotation class PaymentOptionsListFormatter -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/config/MockConfigRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.config 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.Config 25 | import ru.yoomoney.sdk.kassa.payments.model.Result 26 | 27 | internal class MockConfigRepository( 28 | private val getDefaultConfig: Config 29 | ): ConfigRepository { 30 | 31 | override fun getConfig(): Config = getDefaultConfig 32 | 33 | override fun loadConfig(): Result = Result.Success(getDefaultConfig) 34 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/PaymentInstrumentBankCard.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | import android.os.Parcelable 25 | import kotlinx.android.parcel.Parcelize 26 | 27 | @Parcelize 28 | internal data class PaymentInstrumentBankCard( 29 | val paymentInstrumentId: String, 30 | val last4: String, 31 | val first6: String, 32 | val cscRequired: Boolean, 33 | val cardType: CardBrand 34 | ): Parcelable { 35 | val cardNumber = "$first6••••••$last4" 36 | } -------------------------------------------------------------------------------- /library/src/main/res/menu/ym_menu_activity_webview.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 25 | 26 | 33 | 34 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/googlePay/GooglePayRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.googlePay 23 | 24 | import android.content.Intent 25 | import androidx.fragment.app.Fragment 26 | 27 | internal interface GooglePayRepository { 28 | fun checkGooglePayAvailable(): Boolean 29 | fun startGooglePayTokenize(fragment: Fragment, paymentOptionId: Int) 30 | fun handleGooglePayTokenize(requestCode: Int, resultCode: Int, data: Intent?): GooglePayTokenizationResult 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/ConfigUseCaseImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList 23 | 24 | import ru.yoomoney.sdk.kassa.payments.config.ConfigRepository 25 | 26 | internal class ConfigUseCaseImpl( 27 | private val configRepository: ConfigRepository 28 | ) : ConfigUseCase { 29 | 30 | override fun loadConfig(): PaymentOptionList.Action { 31 | configRepository.loadConfig() 32 | return PaymentOptionList.Action.ConfigLoadFinish 33 | } 34 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/SimpleTextWatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import android.text.Editable 25 | import android.text.TextWatcher 26 | 27 | internal interface SimpleTextWatcher : TextWatcher { 28 | 29 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} 30 | 31 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {} 32 | 33 | override fun afterTextChanged(s: Editable) {} 34 | } 35 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/navigation/AppRouter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.navigation 23 | 24 | import android.util.Log 25 | import androidx.lifecycle.MutableLiveData 26 | 27 | private val TAG = AppRouter::class.java.simpleName 28 | 29 | internal class AppRouter: Router { 30 | override val screensData = MutableLiveData() 31 | 32 | override fun navigateTo(screen: Screen) { 33 | Log.d(TAG, "Navigating to $screen") 34 | screensData.postValue(screen) 35 | } 36 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/unbind/MockUnbindCardGateway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.unbind 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.Result 25 | import ru.yoomoney.sdk.kassa.payments.model.SuccessUnbinding 26 | import ru.yoomoney.sdk.kassa.payments.payment.unbindCard.UnbindCardGateway 27 | 28 | internal class MockUnbindCardGateway: UnbindCardGateway { 29 | override fun unbindCard(bindingId: String): Result { 30 | return Result.Success(SuccessUnbinding) 31 | } 32 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_unknown_list.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /library/src/main/res/layout/ym_view_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 27 | 28 | 33 | 34 | -------------------------------------------------------------------------------- /library/src/main/java/androidx/lifecycle/ViewModelKeyedFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2022 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package androidx.lifecycle 23 | 24 | import javax.inject.Provider 25 | 26 | internal class ViewModelKeyedFactory( 27 | private val creators: Map> 28 | ) : YooKassaKeyedFactory() { 29 | 30 | override fun create(key: String, modelClass: Class): T { 31 | val creator = creators[key] ?: error("unknown model class $modelClass") 32 | @Suppress("UNCHECKED_CAST") 33 | return creator.get() as T 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/ui/ViewExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.ui 23 | 24 | import android.view.View 25 | import android.view.View.MeasureSpec.EXACTLY 26 | import android.view.View.MeasureSpec.UNSPECIFIED 27 | import android.view.View.MeasureSpec.makeMeasureSpec 28 | 29 | internal fun View.getViewHeight(): Int { 30 | measure( 31 | makeMeasureSpec(context.getScreenWidth(), EXACTLY), 32 | makeMeasureSpec(0, UNSPECIFIED) 33 | ) 34 | return measuredHeight.coerceAtMost(context.getScreenHeight()) 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_more_options.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/extensions/ColorExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.extensions 23 | 24 | import androidx.core.graphics.ColorUtils 25 | 26 | internal fun Int.highlight(): Int { 27 | val hsl = FloatArray(3) 28 | ColorUtils.colorToHSL(this, hsl) 29 | if (hsl[2] > 0.8) { 30 | hsl[2] -= 0.15f 31 | } else { 32 | hsl[2] += 0.15f 33 | } 34 | return ColorUtils.HSLToColor(hsl) 35 | } 36 | 37 | internal fun Int.isLightColor(): Boolean { 38 | return ColorUtils.calculateLuminance(this) > 0.5 39 | } 40 | -------------------------------------------------------------------------------- /library/buildTestDependencies.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2022 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | dependencies { 23 | testImplementation "junit:junit:$junit" 24 | testImplementation 'androidx.test:core:1.4.0' 25 | testImplementation "org.mockito:mockito-core:$mockito_version" 26 | testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" 27 | testImplementation 'org.robolectric:robolectric:4.3.1' 28 | testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0" 29 | testImplementation 'org.assertj:assertj-core:3.15.0' 30 | testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0" 31 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/extensions/AmountExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | @file:JvmName("AmountExtensions") 23 | 24 | package ru.yoomoney.sdk.kassa.payments.extensions 25 | 26 | import android.text.SpannableStringBuilder 27 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.Amount 28 | 29 | internal fun Amount.format(): CharSequence { 30 | val formatted = currency.toNumberFormat().format(value) 31 | 32 | return when { 33 | currency.isRub -> SpannableStringBuilder(formatted).append(' ').appendRoubleSpan() 34 | else -> formatted 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/PaymentOptionListItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList 23 | 24 | import android.graphics.drawable.Drawable 25 | 26 | internal data class PaymentOptionListItem( 27 | val optionId: Int, 28 | val instrumentId: String? = null, 29 | val urlLogo: String?, 30 | val logo: Drawable, 31 | val title: CharSequence, 32 | val additionalInfo: CharSequence? = null, 33 | val canLogout: Boolean = false, 34 | val hasOptions: Boolean, 35 | val isWalletLinked: Boolean 36 | ) 37 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/extensions/FragmentManagerExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | @file:JvmName("FragmentManagerExtensions") 23 | 24 | package ru.yoomoney.sdk.kassa.payments.extensions 25 | 26 | import android.annotation.SuppressLint 27 | import androidx.fragment.app.FragmentManager 28 | import androidx.fragment.app.FragmentTransaction 29 | 30 | @SuppressLint("CommitTransaction") 31 | internal inline fun FragmentManager.inTransaction(block: FragmentTransaction.() -> Unit) { 32 | with (beginTransaction()) { 33 | block() 34 | commitAllowingStateLoss() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/loadOptionList/PaymentOptionListRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.loadOptionList 23 | 24 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.Amount 25 | import ru.yoomoney.sdk.kassa.payments.model.CurrentUser 26 | import ru.yoomoney.sdk.kassa.payments.model.PaymentOptionsResponse 27 | import ru.yoomoney.sdk.kassa.payments.model.Result 28 | 29 | internal interface PaymentOptionListRepository { 30 | fun getPaymentOptions(amount: Amount, currentUser: CurrentUser): Result 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/metrics/ErrorScreenReporter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.metrics 23 | 24 | interface ErrorScreenReporter { 25 | fun report() 26 | } 27 | 28 | internal class ErrorScreenReporterImpl( 29 | private val getAuthType: () -> AuthType, 30 | private val getTokenizeScheme: () -> TokenizeScheme?, 31 | private val reporter: Reporter 32 | ): ErrorScreenReporter { 33 | 34 | override fun report() { 35 | reporter.report("screenError", getTokenizeScheme()?.let { listOf(getAuthType(), it) } ?: listOf(getAuthType())) 36 | } 37 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/payment/googlePay/GooglePayTokenizationResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.payment.googlePay 23 | 24 | import ru.yoomoney.sdk.kassa.payments.model.GooglePayInfo 25 | 26 | internal sealed class GooglePayTokenizationResult 27 | internal data class GooglePayTokenizationSuccess( 28 | val paymentOptionId: Int, 29 | val paymentOptionInfo: GooglePayInfo 30 | ) : GooglePayTokenizationResult() 31 | 32 | internal class GooglePayTokenizationCanceled : GooglePayTokenizationResult() 33 | internal class GooglePayNotHandled : GooglePayTokenizationResult() -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentAuth/MockPaymentAuthTypeRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentAuth 23 | 24 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.Amount 25 | import ru.yoomoney.sdk.kassa.payments.model.AuthTypeState 26 | import ru.yoomoney.sdk.kassa.payments.model.Result 27 | 28 | internal class MockPaymentAuthTypeRepository : PaymentAuthTypeRepository { 29 | override fun getPaymentAuthType(linkWalletToApp: Boolean, amount: Amount): Result { 30 | return Result.Success(AuthTypeState.SMS(15, 4, 3, 3)) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/model/CurrentUser.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.model 23 | 24 | internal sealed class CurrentUser 25 | 26 | internal object AnonymousUser : CurrentUser() { 27 | override fun toString() = javaClass.simpleName 28 | } 29 | internal class AuthorizedUser() : CurrentUser() { 30 | override fun equals(other: Any?): Boolean { 31 | if (this === other) return true 32 | if (javaClass != other?.javaClass) return false 33 | return true 34 | } 35 | 36 | override fun hashCode(): Int { 37 | return javaClass.hashCode() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/FragmentExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import androidx.fragment.app.Fragment 25 | import androidx.lifecycle.ViewModel 26 | import androidx.lifecycle.ViewModelProvider 27 | import androidx.lifecycle.YooKassaViewModelProvider 28 | 29 | internal inline fun Fragment.viewModel( 30 | key: String, 31 | noinline viewModelFactory: () -> ViewModelProvider.Factory 32 | ): Lazy { 33 | return lazy { 34 | YooKassaViewModelProvider(this.viewModelStore, viewModelFactory()).get(key, T::class.java) 35 | } 36 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/di/ViewModelKeyedFactoryModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.di 23 | 24 | import androidx.lifecycle.ViewModel 25 | import androidx.lifecycle.ViewModelKeyedFactory 26 | import androidx.lifecycle.ViewModelProvider 27 | import dagger.Module 28 | import dagger.Provides 29 | import javax.inject.Provider 30 | 31 | @Module 32 | internal class ViewModelKeyedFactoryModule { 33 | 34 | @Provides 35 | fun viewModelKeyedFactory(creators: Map>): ViewModelProvider.Factory { 36 | return ViewModelKeyedFactory(creators) 37 | } 38 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/paymentOptionList/PaymentOptionView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.paymentOptionList 23 | 24 | import android.content.Context 25 | import android.util.AttributeSet 26 | import android.view.View 27 | import android.widget.FrameLayout 28 | import ru.yoomoney.sdk.kassa.payments.R 29 | 30 | internal class PaymentOptionView @JvmOverloads constructor( 31 | context: Context, 32 | attrs: AttributeSet? = null, 33 | defStyleAttr: Int = 0 34 | ) : FrameLayout(context, attrs, defStyleAttr) { 35 | init { 36 | View.inflate(context, R.layout.ym_item_payment_option, this) 37 | } 38 | } -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/utils/PatternInputFilter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2020 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.utils 23 | 24 | import android.text.InputFilter 25 | import android.text.Spanned 26 | 27 | internal class PatternInputFilter(private val pattern: String) : InputFilter { 28 | 29 | override fun filter( 30 | source: CharSequence, 31 | start: Int, 32 | end: Int, 33 | dest: Spanned, 34 | dstart: Int, 35 | dend: Int 36 | ): CharSequence { 37 | return source.subSequence(start, end).toString().replace(pattern.toRegex(), "").trim { it <= ' ' } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/ru/yoomoney/sdk/kassa/payments/di/OkHttpModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * Copyright © 2021 NBCO YooMoney LLC 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | * associated documentation files (the “Software”), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial 12 | * portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 18 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 | * OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package ru.yoomoney.sdk.kassa.payments.di 23 | 24 | import android.content.Context 25 | import dagger.Module 26 | import dagger.Provides 27 | import okhttp3.OkHttpClient 28 | import ru.yoomoney.sdk.kassa.payments.checkoutParameters.TestParameters 29 | import ru.yoomoney.sdk.kassa.payments.http.newHttpClient 30 | 31 | @Module 32 | internal open class OkHttpModule { 33 | @Provides 34 | open fun okHttpClient(context: Context, testParameters: TestParameters): OkHttpClient { 35 | return newHttpClient(context, testParameters.showLogs, testParameters.hostParameters.isDevHost) 36 | } 37 | } -------------------------------------------------------------------------------- /library/src/main/res/drawable/ym_ic_moskovskiy_industrialnyi_bank_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | --------------------------------------------------------------------------------