0

I need a payment method that allows the uploading of images as a payment method and saves those images so that I can later send them to a call and the seller can see them.

Actually, I'm new to Magento and I don't know much, but I've already thought the first step for my goal, and this is what I've done so far.

I have already made the payment method, and I have already done the part of requesting the image.

enter image description here

This is my code for this:

<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
<div class="payment-method-title field choice">
    <input type="radio" name="payment[method]" class="radio" data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
    <label class="label" data-bind="attr: {'for': getCode()}">
        <span data-bind="text: getTitle()"></span>
    </label>
</div>

<div class="payment-method-content">
    <form class="pagoAgriconecta" method="post" action="" enctype="multipart/form-data" data-mage-init='{"validation":{}}'>
        <p>Puedes subir tu documento de pago, en formato de imagen:</p>
        <input type="file" name="filePay" id="filePay" style="margin-bottom: 10px;">
        <input class="action primary" type="submit" value="Subir documento" name="submit">
    </form>

    <!-- 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>
    <div class="actions-toolbar">
        <div class="primary">
            <button class="action primary checkout" type="submit" data-bind="
                    click: placeOrder,
                    attr: {title: $t('Place Order')}
                    ">
                <span data-bind="i18n: 'Place Order'"></span>
            </button>
        </div>
    </div>
</div>

But from here I don't know what to do to save the image, I need help :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.