diff --git a/Charge.php b/Charge.php index c7a3933..334c3c4 100644 --- a/Charge.php +++ b/Charge.php @@ -1,5 +1,6 @@ mixed) */ - protected function pCharge() {$s = $this->s(); return [ + protected function pCharge() {$s = $this->s(); $o = $this->m()->option(); return [ /** * 2017-09-16 * Note 1. @@ -157,7 +158,7 @@ protected function pCharge() {$s = $this->s(); return [ * ». * Type: normalizedString, 5 characters. */ - ,'paymentType' => $this->m()->option() + ,'paymentType' => $o /** * 2017-09-16 * «ID of the payment form, issued during activation of Yandex.Checkout». @@ -304,5 +305,21 @@ protected function pCharge() {$s = $this->s(); return [ * https://tech.yandex.ru/money/doc/payment-solution/payment-form/payment-form-http-docpage */ ,'shopSuccessUrl' - ], $this->customerReturnRemote());} + ], $this->customerReturnRemote()) + + ($o && Option::LOAN !== $o ? [] : [ + /** + * 2017-09-25 «Provide the 1 year only loan term?» + * In English: + * «If this parameter is set to true, the bank is passed a fixed loan term of 12 months. + * This is necessary for displaying the monthly loan repayment next to the product price. + * For example, "Refrigerator for 3000 rubles a month". + * This makes the monthly payment equal to 10% of the price.» + * In Russian: + * «Если этот параметр равен true, в банк передается фиксированный срок кредита — 12 месяцев. + * Это нужно для отображения ежемесячного платежа по кредиту рядом со стоимостью товара. + * Например: «Холодильник за 3000 рублей в месяц». + * Ежемесячный платеж в таком случае равен 10% от стоимости.» + */ + 'fixed_term' => $s->b('provide1YearOnlyLoanTerm') + ]);} } \ No newline at end of file diff --git a/Source/Option.php b/Source/Option.php index 4593574..ea29cfa 100644 --- a/Source/Option.php +++ b/Source/Option.php @@ -34,4 +34,10 @@ function(array $a) {return dfa_deep($a, 'title/' . df_lang_ru_en());} dfa($a, 'hideOnCheckout') );}) ));} + + /** + * 2017-09-25 + * @used-by \Dfe\YandexKassa\Charge::pCharge() + */ + const LOAN = 'KV'; } \ No newline at end of file diff --git a/composer.json b/composer.json index 0ccd22a..82e6abf 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/yandex-kassa" - ,"version": "0.2.4" + ,"version": "0.2.5" ,"description": "The «Yandex.Kassa» (Яндекс.Касса, Yandex.Checkout) payment extension for Magento 2." ,"type": "magento2-module" ,"homepage": "https://mage2.pro/c/extensions/yandex-kassa" diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 08fba57..edc6118 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -231,13 +231,32 @@ + + Df\Config\Backend\Checkbox + instant loans (KupiVkredit - Tinkoff Bank). +
If it is checked, then the bank is passed a fixed loan term of 12 months. +
This is necessary for displaying the monthly loan repayment next to the product price. +
For example, «Refrigerator for 3000 rubles a month». +
This makes the monthly payment equal to 10% of the price.]]>
+ 1 +
+ Df\Config\Backend\Checkbox @@ -248,7 +267,7 @@ id='min_order_total' translate='label' type='text' - sortOrder='19' + sortOrder='27' showInDefault='1' showInWebsite='1' showInStore='1' @@ -262,7 +281,7 @@ id='max_order_total' translate='label' type='text' - sortOrder='20' + sortOrder='28' showInDefault='1' showInWebsite='1' showInStore='1' @@ -276,7 +295,7 @@ id='country_restriction' translate='label' type='select' - sortOrder='21' + sortOrder='29' showInDefault='1' showInWebsite='1' showInStore='1' @@ -289,7 +308,7 @@ id='countries' translate='label' type='Df\Framework\Form\Element\Multiselect' - sortOrder='22' + sortOrder='30' showInDefault='1' showInWebsite='1' showInStore='1'