cancel
Showing results for 
Search instead for 
Did you mean: 

custom data in payment method

custom data in payment method

Hi, 

I need to feed the select field 

select.PNG

in that select I need to put the values 3,6,10,12

 

I tryed with this code, but is not working.

 

 

"Form.html"

    <div class="payment-method-content">
        <!-- ko foreach: getRegion('messages') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <div class="payment-method-billing-address">
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

        <!-- Render the native credit card form. -->
        <form class="form" data-bind="attr: {'id': getCode() + '-form'}">
            <!-- ko template: 'Magento_Payment/payment/cc-form' --><!-- /ko -->
        </form>

        <div class="checkout-agreements-block">
            <!-- ko foreach: $parent.getRegion('before-place-order') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <div class="control">
                <select name="payment[cuota]"
                        class="select"
                        data-bind="options: getQuotaResults(),
                                  optionsValue: 'value',
                                  optionsText: 'cuota',
                                  optionsCaption: $t('Cuotas'),
                                  value: QuotasResults">
                </select>
        </div>
        <div class="actions-toolbar">
            <div class="primary">
                <button data-role="review-save"
                        type="submit"
                        data-bind="
                        attr: {title: $t('Place Order')},
                        enable: (getCode() == isChecked()),
                        click: placeOrder,
                        css: {disabled: !isPlaceOrderActionAllowed()}
                        "
                        class="action primary checkout"
                        disabled>
                    <span data-bind="i18n: 'Place Order'"></span>
                </button>
            </div>
        </div>
    </div>

render .js

 getQuotaResults: function() {
                return _.map(window.checkoutConfig.payment.llamacoin.QuotasResults, function(value, key) {
                    return {
                        'value': key,
                        'cuota': value
                    }
                });
            }

ConfigProvider.php

 public function getConfig()
    {
        return [
            'payment' => [
                self::CODE => [
                    'QuotasResults' => [
                        '3' => '3',
                        '6' => '6',
'12' => '12' ] ] ] ]; }

 Can you help me, what I need to do?