Skip to content

Commit

Permalink
RWC-60, includes fixes for RWC-40, RWC-75
Browse files Browse the repository at this point in the history
Resurs gateway script must not trig on click as it gets stuck in internal loops. Correct is to trigger update_checkout on change.
The default payment method in checkout also handles customer API calls by itself. This makes the plugin always leave the correct information based on that payment method.
apiData contains order information until orders are completed.
is_available is also checking min-max amounts before activating it.
Logging full procedure, detailed - for merchants - or not at all (standard).
Orders are always cancelled on unkown errors or signing failures.
Orders are internally marked as signed if they are signed. They are not marked if signing wasn't required.
Fully supporting simplified flow from bookPayment to last bookSignedPayment.
Urls created for Resurs Bank are written for less data loss.
Order rows are entirely written with WooCommerce in mind.
Coupons are added per coupon instead of the total. This may make it easier to annul separate coupons if they are present (future feature?).
PHP inspections updated.
Redundant trys located in Api::getPayment.
Old filters for v2.x is not consequent with prefixing. That caused problems with RWC-40.
Updated RWC-75: Rounding panic is safe.
  • Loading branch information
Tornevall committed Jul 22, 2020
1 parent 81f7078 commit ef3619d
Show file tree
Hide file tree
Showing 18 changed files with 4,342 additions and 431 deletions.
21 changes: 13 additions & 8 deletions js/resursbank_checkout.js
Expand Up @@ -6,17 +6,18 @@ $rQuery(document).ready(function ($) {
getResursHookedBillingFields();
});

function getResursGateway() {
function getResursGateway()
{
resursGateway = {
init: function() {
init: function () {
var that = this;
$rQuery(document).ajaxStop(function () {
that.register_payment_update();
});
},
register_payment_update: function() {
register_payment_update: function () {
$rQuery('input[id*="payment_method_"]').each(function () {
$rQuery('#' + this.id).on('click', function () {
$rQuery('#' + this.id).on('change', function () {
$rQuery('body').trigger('update_checkout');
});
});
Expand All @@ -39,7 +40,8 @@ var inheritTo = {
* Hook key pressing into regular billing address fields and inherit data to Resurs fields.
* @since 0.0.1.0
*/
function getResursHookedBillingFields() {
function getResursHookedBillingFields()
{
for (var inheritKey in inheritTo) {
var inheritField = $rQuery('#' + inheritKey);
if (inheritField.length) {
Expand All @@ -65,7 +67,8 @@ function getResursHookedBillingFields() {
* @param o
* @since 0.0.1.0
*/
function setBillingInherit(o) {
function setBillingInherit(o)
{
var inheritTo = {
'trbwc_phone': 'billing_phone',
'trbwc_mobile': 'billing_phone',
Expand All @@ -86,7 +89,8 @@ function setBillingInherit(o) {
* @param thisValue
* @since 0.0.1.0
*/
function getResursFields(findElement, thisValue) {
function getResursFields(findElement, thisValue)
{
var selectElement = $rQuery(findElement);
if (selectElement.length) {
for (var elementId = 0; elementId < selectElement.length; elementId++) {
Expand All @@ -101,6 +105,7 @@ function getResursFields(findElement, thisValue) {
* @param updateValue
* @since 0.0.1.0
*/
function setResursUpdateField(updateElement, updateValue) {
function setResursUpdateField(updateElement, updateValue)
{
updateElement.value = updateValue;
}
Binary file added language/trbwc-da_DK.mo
Binary file not shown.

0 comments on commit ef3619d

Please sign in to comment.