-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
138 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
view/frontend/web/js/view/payment/method-renderer/tpay-card-method.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/** | ||
* | ||
* @category payment gateway | ||
* @package Tpaycom_Magento2.3 | ||
* @author Tpay.com | ||
* @copyright (https://tpay.com) | ||
*/ | ||
define( | ||
[ | ||
'Magento_Checkout/js/view/payment/default', | ||
'jquery', | ||
'Magento_Checkout/js/model/totals' | ||
], | ||
function (Component, $) { | ||
'use strict'; | ||
|
||
return Component.extend({ | ||
defaults: { | ||
template: 'tpaycom_magento2basic/payment/card-tpay-form' | ||
}, | ||
|
||
redirectAfterPlaceOrder: false, | ||
|
||
getCode: function () { | ||
return 'tpaycom_magento2basic_cards'; | ||
}, | ||
|
||
afterPlaceOrder: function () { | ||
$("#card_number").val(''); | ||
$("#cvc").val(''); | ||
$("#expiry_date").val(''); | ||
$("#loading_scr").fadeIn(); | ||
window.location.replace(window.checkoutConfig.tpay.payment.redirectUrl); | ||
}, | ||
|
||
showPaymentChannels: function () { | ||
return window.checkoutConfig.tpay.payment.showPaymentChannels; | ||
}, | ||
|
||
getTerms: function () { | ||
return window.checkoutConfig.tpay.payment.getTerms; | ||
}, | ||
|
||
getLogoUrl: function () { | ||
return window.checkoutConfig.tpay.payment.tpayLogoUrl; | ||
}, | ||
|
||
blikStatus: function () { | ||
return window.checkoutConfig.tpay.payment.blikStatus; | ||
}, | ||
|
||
addCSS: function () { | ||
return window.checkoutConfig.tpay.payment.addCSS; | ||
}, | ||
|
||
cardFetchJavaScripts: function () { | ||
return window.checkoutConfig.tpaycards.payment.fetchJavaScripts; | ||
}, | ||
cardGetRSAkey: function () { | ||
return window.checkoutConfig.tpaycards.payment.getRSAkey; | ||
}, | ||
cardGetLogoUrl: function () { | ||
return window.checkoutConfig.tpaycards.payment.tpayLogoUrl; | ||
}, | ||
cardGetTpayLoadingGif: function () { | ||
return window.checkoutConfig.tpaycards.payment.getTpayLoadingGif; | ||
}, | ||
cardAddCSS: function () { | ||
return window.checkoutConfig.tpaycards.payment.addCSS; | ||
}, | ||
|
||
cardShowSaveBox: function () { | ||
if (window.checkoutConfig.tpaycards.payment.isCustomerLoggedIn | ||
&& window.checkoutConfig.tpaycards.payment.isSavingEnabled) { | ||
$('#tpay-card-save-checkbox').css('display', 'block'); | ||
} | ||
}, | ||
|
||
getData: function () { | ||
var savedId = 'new'; | ||
$('input[id^=cardN]').each(function () { | ||
if ($(this).is(":checked")) { | ||
savedId = $(this).val(); | ||
} | ||
}); | ||
var parent = this._super(), | ||
paymentData = {}; | ||
paymentData['group'] = $('#tpay-channel-input').val(); | ||
paymentData['blik_code'] = $('#blik_code').val(); | ||
paymentData['accept_tos'] = $('#accept_tos').is(':checked'); | ||
|
||
paymentData['card_data'] = $('input[name="card_data"]').val(); | ||
paymentData['card_save'] = $('input[name="card_save"]').is(":checked"); | ||
paymentData['card_id'] = savedId; | ||
paymentData['card_vendor'] = $('input[name="card_vendor"]').val(); | ||
paymentData['short_code'] = $('input[name="card_short_code"]').val(); | ||
|
||
return $.extend(true, parent, {'additional_data': paymentData}); | ||
}, | ||
|
||
isActive: function () { | ||
return true; | ||
}, | ||
}); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.