Changeset 2502108
- Timestamp:
- 03/23/2021 10:04:28 PM (5 years ago)
- Location:
- helcim-commerce-for-woocommerce/trunk
- Files:
-
- 4 edited
-
class-wc-commerce-helcim.php (modified) (7 diffs)
-
index.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
helcim-commerce-for-woocommerce/trunk/class-wc-commerce-helcim.php
r2489884 r2502108 11 11 * @class WC_Commerce_Helcim_JS 12 12 * @extends WC_Payment_Gateway 13 * @version 1.2. 113 * @version 1.2.2 14 14 * @author Helcim Inc. 15 15 */ … … 37 37 $this->commerce_url = 'https://secure.myhelcim.com/api/'; 38 38 $this->helcimjs_url = 'https://secure.myhelcim.com/js/version2.js'; 39 $this->version = '1.2. 1';39 $this->version = '1.2.2'; 40 40 41 41 // LOAD SETTINGS … … 339 339 // SET DEFAULT 340 340 $helcim_args = array( 341 'accountId' => $this->accountId, 342 'apiToken' => $this->apiToken, 343 'transactionType' => $this->transactionType, 344 'terminalId' => $this->terminalId, 345 'test' => $this->isTest(), 346 'ecommerce' => 1, 347 'cvvIndicator' => 1, 348 'ipAddress' => $ipAddress 349 ); 341 'accountId' => $this->accountId, 342 'apiToken' => $this->apiToken, 343 'transactionType' => $this->transactionType, 344 'terminalId' => $this->terminalId, 345 'test' => $this->isTest(), 346 'ecommerce' => 1, 347 'cvvIndicator' => 1, 348 'ipAddress' => $ipAddress, 349 'thirdParty' => 'woocommerce' 350 ); 350 351 351 352 // ADD IP TO CHECK WITH … … 355 356 $helcim_args['amount'] = number_format($order->get_total(),2,'.',''); 356 357 $helcim_args['currency'] = get_woocommerce_currency(); 357 $helcim_args['amountShipping']= number_format($shippingAmount,2,'.',''); 358 $helcim_args['amountTax'] = number_format($order->get_total_tax(),2,'.',''); 359 $helcim_args['amountDiscount'] = number_format('-'.$discountAmount + $refundAmount,2,'.',''); 360 // $helcim_args['shippingMethod'] = ''; 361 // $helcim_args['taxDetails'] = ''; 362 363 // ORDER INFO 364 $helcim_args['orderNumber'] = $this->set_order_number($order->get_order_number()); 365 $helcim_args['comments'] = $order->get_customer_note(); 366 367 // CHECK 368 if($this->isJS()){ 369 $createAccount = 0; 370 if ($_POST['createaccount']) { 371 $createAccount = (int)$_POST['createaccount']; 372 } 373 374 if ($createAccount == 1) { 375 $helcim_args['updateCustomerCode'] = true; 358 $helcim_args['amountShipping'] = number_format($shippingAmount, 2, '.', ''); 359 $helcim_args['amountTax'] = number_format($order->get_total_tax(), 2, '.', ''); 360 $helcim_args['amountDiscount'] = number_format('-' . $discountAmount + $refundAmount, 2, '.', ''); 361 // $helcim_args['shippingMethod'] = ''; 362 // $helcim_args['taxDetails'] = ''; 363 364 // ORDER INFO 365 $helcim_args['orderNumber'] = $this->set_order_number($order->get_order_number()); 366 $helcim_args['comments'] = $order->get_customer_note(); 367 368 // CUSTOMER INFO 369 if (get_current_user_id()) { 370 $helcim_args['customerCode'] = get_current_user_id(); 371 } 372 373 // CHECK 374 if ($this->isJS()) { 375 // look for generated customer code from verify transaction not matching user's id 376 if (isset($_POST['customerCode'], $helcim_args['customerCode']) 377 && $_POST['customerCode'] !== $helcim_args['customerCode']) { 378 $helcim_args['customerCodeOld'] = $_POST['customerCode']; 376 379 } 377 380 378 // CARD INFO 379 if(isset($_POST['cardToken'])){ $helcim_args['cardToken'] = $_POST['cardToken']; } 380 $helcim_args['cardF4L4Skip'] = 1; 381 382 }elseif($this->isDirect()){ 381 // CARD INFO 382 if (isset($_POST['cardToken'])) { 383 $helcim_args['cardToken'] = $_POST['cardToken']; 384 } 385 $helcim_args['cardF4L4Skip'] = 1; 386 }elseif($this->isDirect()){ 383 387 384 388 // CARD INFO … … 391 395 392 396 } 393 394 // CUSTOMER INFO395 if(get_current_user_id()){ $helcim_args['customerCode'] = get_current_user_id(); }396 397 397 398 // GO THROUGH EACH … … 468 469 * @return array 469 470 */ 470 public function process_payment( $order_id ) {471 472 global $woocommerce;473 474 // GET ORDER475 $order = new WC_Order( $order_id);476 477 // BUILD POST DATA478 $helcim_args = $this->build_post_data($order);479 480 // CREATE POST STRING481 $postString = http_build_query($helcim_args);482 483 // SET CURL OPTIONS484 $curlOptions = array(485 CURLOPT_RETURNTRANSFER => 1,471 public function process_payment( $order_id ) 472 { 473 global $woocommerce; 474 475 // GET ORDER 476 $order = wc_get_order($order_id); 477 478 // BUILD POST DATA 479 $helcim_args = $this->build_post_data($order); 480 481 // CREATE POST STRING 482 $postString = http_build_query($helcim_args); 483 484 // SET CURL OPTIONS 485 $curlOptions = array( 486 CURLOPT_RETURNTRANSFER => 1, 486 487 CURLOPT_AUTOREFERER => TRUE, 487 488 CURLOPT_FRESH_CONNECT => TRUE, … … 788 789 * @return void 789 790 */ 790 public function validate_fields(){ 791 792 // SET GLOBAL 793 global $woocommerce; 794 795 // CHECK METHOD 796 if($this->isJS() and @$_POST['createaccount'] != 1){ 797 798 // HELCIM JS METHOD 799 800 // CHECK FOR RESPONSE 801 if(isset($_POST['response']) and $_POST['response'] == 1){ 802 803 // CHECK 804 if(!isset($_POST['cardToken'])){ 805 806 // SET NOTICE 791 public function validate_fields() 792 { 793 // SET GLOBAL 794 global $woocommerce; 795 796 // CHECK METHOD 797 if ($this->isJS()) { 798 // HELCIM JS METHOD 799 800 // CHECK FOR RESPONSE 801 if (isset($_POST['response']) and $_POST['response'] == 1) { 802 // CHECK 803 if (!isset($_POST['cardToken'])) { 804 // SET NOTICE 807 805 wc_add_notice('Failed Tokenizing Card','error'); 808 806 -
helcim-commerce-for-woocommerce/trunk/index.php
r2489884 r2502108 4 4 Plugin URI: https://www.helcim.com/ 5 5 Description: Helcim Commerce for WooCommerce 6 Version: 1.2. 16 Version: 1.2.2 7 7 Author: Helcim Inc. 8 8 Author URI: https://www.helcim.com/ -
helcim-commerce-for-woocommerce/trunk/readme.txt
r2489884 r2502108 3 3 Tags: helcim, helcim commerce, woocommerce, woocommerce payments, woocommerce payment gateway, payment gateway, shopping cart, wordpress payment gateway, woocommerce shopping cart, wordpress shopping cart, payment gateway for woocommerce, payments, credit cards, accept credit cards, recurring billing, woocommerce gateway, woocommerce payment plugin, woocommerce credit cards, accept credit cards woocommerce, credit card gateway woocommerce, accept credit cards on woocommerce, process payments, process credit cards, accept visa, accept mastercard,checkout, accept payments, merchant account, merchant services 4 4 Requires at least: 4.7.3 5 Tested up to: 5. 6.25 Tested up to: 5.7.0 6 6 7 7 == Description == … … 19 19 20 20 **REQUIREMENTS:** 21 - WooCommerce 2.6.14 to 5. 0.021 - WooCommerce 2.6.14 to 5.1.0 22 22 - [US Merchant Account Sign Up](https://admin.helcim.com/signup/ "Unlock Payment Gateway") 23 23 … … 72 72 73 73 == Changelog == 74 75 = 1.2.2 = 76 * Optimized Plugin 77 * Updated plugin to work with Create an Account on Checkout 78 * Tested upto woocommerce v5.1.0 74 79 75 80 = 1.2.1 = -
helcim-commerce-for-woocommerce/trunk/uninstall.php
r2489884 r2502108 5 5 * Uninstalls Helcim Gateway. 6 6 * 7 * @version 1.2. 17 * @version 1.2.2 8 8 * @author Helcim Inc. 9 9 */
Note: See TracChangeset
for help on using the changeset viewer.