forked from craigchristenson/opencart-2checkout
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added subscription support - added sha2/3 support on IPN and API - added one step inline support
- Loading branch information
Craig Christenson
committed
Feb 11, 2024
1 parent
52f2e1f
commit fd793bf
Showing
21 changed files
with
1,640 additions
and
986 deletions.
There are no files selected for viewing
Binary file not shown.
609 changes: 353 additions & 256 deletions
609
upload/admin/controller/extension/payment/twocheckout_cplus.php
Large diffs are not rendered by default.
Oops, something went wrong.
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
54 changes: 30 additions & 24 deletions
54
upload/admin/language/en-gb/extension/payment/twocheckout_cplus.php
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
64 changes: 64 additions & 0 deletions
64
upload/admin/view/template/extension/payment/twocheckout_cplus_recurring_buttons.twig
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,64 @@ | ||
<div id="twocheckout_cplus_buttons" class="form-control-static buttons clearfix"> | ||
{% if order_recurring_id and false %} | ||
<div class="pull-right"> | ||
<button type="button" id="button-cancel" data-loading-text="{{ text_loading }}" class="btn btn-danger">{{ button_text }}</button> | ||
</div> | ||
{% endif %} | ||
</div> | ||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
let addOrderHistory = function(success_callback) { | ||
$.ajax({ | ||
url: '{{ catalog }}index.php?route=api/order/history&api_token={{ api_token }}&order_id={{ order_id }}', | ||
type: 'post', | ||
dataType: 'json', | ||
data: 'order_status_id={{ order_status_id }}¬ify={{ notify }}&override=0&append=0&comment=' + encodeURIComponent("{{ comment }}"), | ||
success: function(json) { | ||
if (json['error']) { | ||
$('#twocheckout_cplus_buttons').before('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>'); | ||
} | ||
if (json['success']) { | ||
success_callback(); | ||
} | ||
}, | ||
error: function(xhr, ajaxOptions, thrownError) { | ||
$('#twocheckout_cplus_buttons').before('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + thrownError + "<br />" + xhr.statusText + "<br />" + xhr.responseText + ' <button type="button" class="close" data-dismiss="alert">×</button></div>'); | ||
} | ||
}); | ||
} | ||
$(document).delegate('#button-cancel', 'click', function() { | ||
if (!confirm("{{ text_confirm_cancel }}")) { | ||
return false; | ||
} | ||
$.ajax({ | ||
url: '{{ cancel }}', | ||
dataType: 'json', | ||
beforeSend: function() { | ||
$('#button-cancel').button('loading'); | ||
}, | ||
success: function(json) { | ||
$('.alert').remove(); | ||
if (json['success']) { | ||
addOrderHistory(function() { | ||
$('#twocheckout_cplus_buttons').before('<div class="alert alert-success">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); | ||
$('#button-cancel').hide(); | ||
}); | ||
} | ||
if (json['error']) { | ||
$('#twocheckout_cplus_buttons').before('<div class="alert alert-danger">' + json['error'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); | ||
$('#button-cancel').button('reset'); | ||
} | ||
}, | ||
error: function(xhr, ajaxOptions, thrownError) { | ||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); | ||
} | ||
}); | ||
}); | ||
}); | ||
</script> |
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.