forked from globalpayments/globalpayments-woocommerce
-
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.
- Loading branch information
1 parent
4b6f337
commit 354cb5c
Showing
641 changed files
with
94,961 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Global Payments | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -1 +1,19 @@ | ||
# globalpayments-woocommerce | ||
# Global Payments Gateway Provider for WooCommerce | ||
|
||
This extension allows WooCommerce to use the available Global Payments payment gateways. All card data is tokenized using the respective gateway's tokenization service. | ||
|
||
## Installation | ||
|
||
This module installs as a standard WordPress module. | ||
|
||
## Usage | ||
|
||
Download the contents and extract to your WordPress plugin folder. Activate. | ||
|
||
## Contributing | ||
|
||
1. Fork it | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create new Pull Request |
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,75 @@ | ||
<?php | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
?> | ||
|
||
<fieldset> | ||
<div class="securesubmit-content gift-card-content"> | ||
<div class="form-row form-row-wide" id="gift-card-row"> | ||
<label id="gift-card-label" for="gift-card-number"><?php _e('Use a gift card', 'wc_securesubmit'); ?></label> | ||
<div id="gift-card-input"> | ||
<input type="tel" placeholder="Gift card" id="gift-card-number" value="" class="input-text"> | ||
<input type="tel" placeholder="PIN" id="gift-card-pin" value="" class="input-text"> | ||
<p id="gift-card-error"></p> | ||
<p id="gift-card-success"></p> | ||
</div> | ||
<button id="apply-gift-card" class="button"><?php _e('Apply', 'wc_securesubmit'); ?></button> | ||
|
||
<?php | ||
$html = '<script data-cfasync="false" type="text/javascript">'; | ||
$html .= 'if( typeof ajaxurl === "undefined") { '; | ||
$html .= 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'; | ||
$html .= '}'; | ||
$html .= '</script>'; | ||
|
||
echo $html; | ||
?> | ||
|
||
<script data-cfasync="false"> | ||
|
||
jQuery("#apply-gift-card").on('click', function (event) { | ||
event.preventDefault(); | ||
applyGiftCard(); | ||
}); | ||
|
||
function applyGiftCard () { | ||
var httpRequest = new XMLHttpRequest(); | ||
|
||
var gift_card_number = document.getElementById('gift-card-number').value; | ||
var gift_card_pin = document.getElementById('gift-card-pin').value; | ||
|
||
var post_string = 'action=use_gift_card&gift_card_number=' + gift_card_number + '&gift_card_pin=' + gift_card_pin; | ||
|
||
httpRequest.open('POST', ajaxurl, false); | ||
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | ||
httpRequest.send(post_string); | ||
|
||
jQuery('body').trigger('update_checkout'); | ||
}; | ||
|
||
jQuery(document).on( 'click', '.securesubmit-remove-gift-card', function (event) { | ||
event.preventDefault(); | ||
|
||
var removedCardID = jQuery(this).attr('id'); | ||
|
||
jQuery.ajax({ | ||
url: ajaxurl, | ||
type: "POST", | ||
data: { | ||
action: 'remove_gift_card', | ||
securesubmit_card_id: removedCardID | ||
} | ||
}).done(function () { | ||
jQuery('body').trigger('update_checkout'); | ||
jQuery(".button[name='update_cart']") | ||
.prop("disabled", false) | ||
.trigger("click"); | ||
}); | ||
}); | ||
|
||
</script> | ||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
</fieldset> |
21 changes: 21 additions & 0 deletions
21
assets/frontend/css/globalpayments-secure-payment-fields.css
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,21 @@ | ||
.globalpayments iframe { | ||
min-height: 3.6rem; | ||
width: 100%; | ||
} | ||
|
||
div[id^="GlobalPayments-overlay-"] { | ||
z-index: 1001 !important; | ||
} | ||
|
||
.woocommerce-globalpayments-validation-error { | ||
margin-bottom:2.617924em; | ||
background-color:#e2401c; | ||
margin-left:0; | ||
border-radius:2px; | ||
color:#fff; | ||
clear:both; | ||
border-left:.6180469716em solid rgba(0,0,0,.15); | ||
padding:1em 2em 1em 3.5em; | ||
position:relative; | ||
list-style:none outside | ||
} |
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,27 @@ | ||
#gift-card-label { | ||
display: table-row; | ||
text-transform: uppercase; | ||
font-size: 13px; | ||
letter-spacing: 1px; | ||
white-space: nowrap; | ||
} | ||
|
||
#gift-card-input { | ||
display: table-cell; | ||
position: relative; | ||
width: 100%; | ||
} | ||
|
||
#apply-gift-card { | ||
display: table-cell; | ||
white-space: nowrap; | ||
margin-left: 1em; | ||
} | ||
|
||
#gift-card-number { | ||
width: 70%; | ||
} | ||
|
||
#gift-card-pin { | ||
width: 26%; | ||
} |
Oops, something went wrong.