Skip to content

Commit d09e95d

Browse files
authored
Merge pull request #173 from paynl/v4
RC4 - Using new PHP-SDK
2 parents a017285 + 3e10184 commit d09e95d

820 files changed

Lines changed: 63022 additions & 20906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/js/payorder.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,26 @@ function submitPinRefund($) {
2424
doAjaxRequest($, amount, 'refund')
2525
}
2626

27-
function submitPinTransaction($) {
27+
function submitPinTransaction($)
28+
{
2829
var amount = parseFloat(paynl_order.order_total.toString().replace(',', '.'));
2930
if (amount == 0) {
3031
alert(paynl_order.texts.i18n_pinmoment_error_zero);
3132
return;
3233
}
33-
3434
doAjaxRequest($, amount, 'pinmoment')
3535
}
3636

37-
function doAjaxRequest($, amount, type) {
37+
function doAjaxRequest($, amount, type)
38+
{
3839
var terminal = $('#pin_terminal').val();
3940
var ajaxurl = '/?wc-api=Wc_Pay_Gateway_Pinrefund';
4041
var data = {
4142
'amount': amount,
4243
'terminal': terminal,
4344
'order_id': paynl_order.order_id,
44-
'returnUrl': window.location.href
45+
'returnUrl': window.location.href,
46+
'type': type
4547
};
4648

4749
$.ajax({
@@ -62,6 +64,9 @@ function doAjaxRequest($, amount, type) {
6264
})
6365
}
6466

67+
/**
68+
* Button for: retour-pin
69+
*/
6570
function addButton($) {
6671
let buttonPlaced = $('#paynl-pin-refund').length > 0;
6772
paynl_order.max_amount = parseFloat(paynl_order.max_amount);
@@ -78,9 +83,15 @@ function addButton($) {
7883
}
7984

8085

81-
function addPinButton($) {
86+
/**
87+
* Button for payment an order by "pin" from out the order
88+
* @param $
89+
*/
90+
function addPinButton($)
91+
{
8292
let buttonPlaced = $('#paynl-pin-transaction').length > 0;
8393
paynl_order.order_total = parseFloat(paynl_order.order_total);
94+
8495
if (!buttonPlaced && paynl_order.order_total > 0) {
8596
$('.wc-order-bulk-actions').prepend('<button style="background-color:#2271B1;;float: right; margin-left: 5px;" type="button" id="paynl-pin-transaction" class="button button-primary do-api-pin-transaction">' + paynl_order.texts.i18n_pinmoment_title + '</button>');
8697
$('#paynl-pin-transaction').click(function () {
@@ -95,10 +106,10 @@ function getTerminalOptions($) {
95106
var options = '';
96107
paynl_order.terminals.forEach((element) => {
97108
var selected = '';
98-
if (element.id == paynl_order.default_terminal) {
109+
if (element.code == paynl_order.default_terminal) {
99110
selected = 'selected="selected"';
100111
}
101-
options += '<option value="' + element.id + '" ' + selected + '>' + element.name + '</option>';
112+
options += '<option value="' + element.code + '" ' + selected + '>' + element.name + '</option>';
102113
})
103114

104115
return options;
35.4 KB
Loading
Lines changed: 6 additions & 0 deletions
Loading
34.5 KB
Loading
Lines changed: 7 additions & 0 deletions
Loading

composer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
2-
"name": "paynl/woocommerce-plugin",
3-
"description": "Pay. woocommerce plugin",
2+
"name": "paynl/woocommerce-plugin",
3+
"description": "Pay. woocommerce plugin",
4+
"license": "MIT",
45
"require": {
5-
"paynl/sdk": "^1.2"
6-
},
7-
"license": "MIT",
8-
"authors": [
9-
{
10-
"name": "Andy Pieters",
11-
"email": "andy@pay.nl"
12-
}
13-
]
6+
"paynl/php-sdk": "^1.0"
7+
}
148
}

0 commit comments

Comments
 (0)