Posted on

Request an image as payment method

I need a payment method that allows the uploading of images as a payment method and save those images so that I can later send them to 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.

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>

<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”>

<!– ko foreach: getRegion(‘messages’) –>
<!– ko template: getTemplate() –>
<!– /ko –>
<div class=”payment-method-billing-address”>
<!– ko foreach: $parent.getRegion(getBillingAddressFormName()) –>
<!– ko template: getTemplate() –>
<!– /ko –>
<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>

But from here I don’t know what to do to save the image, I need help 🙁

Leave a Reply

Your email address will not be published.