Changeset 2871716
- Timestamp:
- 02/27/2023 02:00:51 PM (3 years ago)
- Location:
- beyond-pay-for-gravity-forms/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
README.txt (modified) (4 diffs)
-
beyond-pay-gravity-forms.php (modified) (4 diffs)
-
includes/gf-beyond-pay.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
beyond-pay-for-gravity-forms/trunk/README.md
r2585899 r2871716 136 136 ## Changelog 137 137 138 ### 1.2.1 139 * Updated to support WordPress 6.1.1 and Gravity Forms 2.7 140 141 ### 1.1.3 142 * Updated tested up to tag. 143 144 ### 1.1.2 145 * Fixed an issue with stylesheet link. 146 138 147 ### 1.1.1 139 148 * Initial public release. -
beyond-pay-for-gravity-forms/trunk/README.txt
r2726686 r2871716 3 3 Tags: credit card, payment, gravity forms, payment gateway, donation 4 4 Requires at least: 4.7 5 Tested up to: 6. 06 Stable tag: 1. 1.35 Tested up to: 6.1.1 6 Stable tag: 1.2.1 7 7 Requires PHP: 7.0 8 8 License: MIT … … 30 30 1. Select the **Beyond Pay** tab on the left navigation bar. 31 31 1. Proceed to configure payment method options available on this page (see [screenshot](#beyond-pay-for-gravity-forms-configuration-settings)): 32 - **Enable Test Mode** - controls whether transactions are sent to the Test/Sandbox or the Live/Production Beyond Pay Gateway environment and which type of API keys are expected; defaults to Live 32 - **Enable Test Mode** - controls whether transactions are sent to the Test/Sandbox or the Live/Production Beyond Pay Gateway environment and which type of API keys are expected; defaults to Live 33 33 - **PublicKey, PrivateKey, Username, Password, MerchantCode,** and **MerchantAccountCode** - these are the credentials by which the plugin authenticates to the Beyond Pay Gateway in order to process payments; for Test Mode, you can [request Beyond Pay Gateway sandbox API keys](https://forms.office.com/Pages/ResponsePage.aspx?id=Q9V6UxGq3USJSkGsz2Jk7yRG7q939HJFkFXKp4lfZo1URUJXWFhEMDlDTUs3OVlROEMxOExJQzZGNSQlQCN0PWcu) while live credentials are provided by Beyond once the merchant processing account is approved 34 34 - **Transaction Mode** - controls how authorizations and payment captures are managed … … 87 87 = Is it secure and/or compliant to accept credit cards directly on my website? = 88 88 89 Yes! Beyond Pay Gateway secures card data by hosting the actual payment fields and presenting them in an iframe so that the fields only *appear* to be part of Gravity Forms. 89 Yes! Beyond Pay Gateway secures card data by hosting the actual payment fields and presenting them in an iframe so that the fields only *appear* to be part of Gravity Forms. 90 90 91 91 Once card data is collected, then the information is further secured by *tokenization*: a process in which the sensitive card data is exchanged for a non-sensitive representation, or "token." This ensures that cardholder data is not sent from the consumer's browser to the merchant's web server, and only the surrogate token value comes into contact with the merchant's systems. … … 113 113 == Changelog == 114 114 115 = 1.2.1 = 116 * Updated to support WordPress 6.1.1 and Gravity Forms 2.7 117 115 118 = 1.1.3 = 116 119 * Updated tested up to tag. -
beyond-pay-for-gravity-forms/trunk/beyond-pay-gravity-forms.php
r2726686 r2871716 6 6 * Author: Beyond 7 7 * Author URI: https://getbeyond.com 8 * Version: 1. 1.38 * Version: 1.2.1 9 9 * Text Domain: beyond-pay-for-gravityforms 10 * Tested up to: 6. 011 * 10 * Tested up to: 6.1.1 11 * 12 12 * Copyright (c) 2020 Above and Beyond Business Tools and Services for Entrepreneurs, Inc. 13 13 * … … 16 16 17 17 GFForms::include_payment_addon_framework(); 18 18 19 19 add_action( 'gform_loaded', 'load_beyond_pay_gf', 5 ); 20 20 21 21 function load_beyond_pay_gf() { 22 22 23 23 if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) { 24 24 return; 25 25 } 26 26 27 27 /** Check if the class wasn't loaded by a different plugin */ 28 28 if(!class_exists('BeyondPay\\BeyondPayRequest')) { … … 31 31 require_once( dirname(__FILE__) . '/includes/gf-beyond-pay.php'); 32 32 require_once( dirname(__FILE__) . '/includes/gf-field-beyond-pay.php'); 33 33 34 34 GFBeyondPay::register( 'GFBeyondPay' ); 35 35 GF_Fields::register(new GF_Field_Beyond_Pay()); … … 42 42 Beyond Pay Invoice Num: 43 43 <span id='gform_beyond_pay_invnum'><?php echo esc_html($order_id); ?></span> 44 </div><?php 44 </div><?php 45 45 } 46 46 if($requires_capture && $entry['payment_status'] === 'Authorized'){ -
beyond-pay-for-gravity-forms/trunk/includes/gf-beyond-pay.php
r2585899 r2871716 31 31 return self::$_instance; 32 32 } 33 33 34 34 public function init() { 35 35 parent::init(); … … 37 37 add_filter('gform_validation_message', array($this, 'add_payment_error_description'), 10, 1 ); 38 38 } 39 39 40 40 public function init_admin() { 41 41 parent::init_admin(); … … 50 50 if($field['name'] === 'transactionType'){ 51 51 $field['choices'] = array_filter( 52 $field['choices'], 52 $field['choices'], 53 53 function ($v) {return $v['value']!=='subscription';} 54 54 ); … … 59 59 return $out; 60 60 } 61 61 62 62 public function get_menu_icon() { 63 63 return 'gform-icon--credit-card'; 64 64 } 65 65 66 66 public function plugin_settings_fields() { 67 67 return array( … … 82 82 'label' => 'Test Public Key', 83 83 'type' => 'text', 84 'class' => 'beyond_pay_setting_test_only' 84 'class' => 'beyond_pay_setting_test_only', 85 'size' => '50', 85 86 ), 86 87 array( 87 88 'name' => 'test_private_key', 88 89 'label' => 'Test Private Key', 89 'type' => 'password', 90 'class' => 'beyond_pay_setting_test_only' 90 'type' => 'text', 91 'input_type' => 'password', 92 'class' => 'beyond_pay_setting_test_only', 93 'size' => '50', 91 94 ), 92 95 array( … … 99 102 'name' => 'test_password', 100 103 'label' => 'Test Password', 101 'type' => 'password', 104 'type' => 'text', 105 'input_type' => 'password', 102 106 'class' => 'beyond_pay_setting_test_only' 103 107 ), … … 106 110 'label' => 'Live Public Key', 107 111 'type' => 'text', 108 'class' => 'beyond_pay_setting_live_only' 112 'class' => 'beyond_pay_setting_live_only', 113 'size' => '50', 109 114 ), 110 115 array( 111 116 'name' => 'private_key', 112 117 'label' => 'Live Private Key', 113 'type' => 'password', 114 'class' => 'beyond_pay_setting_live_only' 118 'type' => 'text', 119 'input_type' => 'password', 120 'class' => 'beyond_pay_setting_live_only', 121 'size' => '50', 115 122 ), 116 123 array( … … 123 130 'name' => 'password', 124 131 'label' => 'Live Password', 125 'type' => 'password', 132 'type' => 'text', 133 'input_type' => 'password', 126 134 'class' => 'beyond_pay_setting_live_only' 127 135 ), … … 187 195 ); 188 196 } 189 197 190 198 public function scripts() { 191 199 $assets_dir = dirname($this->get_base_url()) . '/assets/js/'; … … 249 257 ) 250 258 ) 251 259 252 260 ); 253 261 254 262 return array_merge( parent::scripts(), $scripts ); 255 263 } 256 264 257 265 public function authorize( $feed, $submission_data, $form, $entry ) { 258 266 $amount = $submission_data['payment_amount']; 259 267 $token = rgpost('beyond_pay_token'); 260 268 261 269 $request = new \BeyondPay\BeyondPayRequest(); 262 270 $request->RequestType = "004"; … … 272 280 $request->requestMessage->TransIndustryType = "EC"; 273 281 274 $transaction_mode = $this->get_plugin_setting('transaction_mode') === 'sale' 275 ? 'sale' 282 $transaction_mode = $this->get_plugin_setting('transaction_mode') === 'sale' 283 ? 'sale' 276 284 : 'sale-auth'; 277 285 $request->requestMessage->TransactionType = $transaction_mode; … … 279 287 $request->requestMessage->Amount = round($amount * 100); 280 288 $request->requestMessage->HolderType = "O"; 281 289 282 290 $request->requestMessage->AccountHolderName = trim($submission_data['name']); 283 291 $request->requestMessage->AccountStreet = trim($submission_data['address']); … … 315 323 } 316 324 $item_count += $i['quantity']; 317 325 318 326 $itemParsed = new \BeyondPay\Item(); 319 327 $itemParsed->ItemCode = "1234"; … … 330 338 $request->requestMessage->Item = $itemsParsed; 331 339 } 332 340 333 341 $conn = new \BeyondPay\BeyondPayConnection(); 334 342 335 343 $api_url = $test_mode ? 336 "https://api-test.getbeyondpay.com/paymentservice/requesthandler.svc" : 344 "https://api-test.getbeyondpay.com/paymentservice/requesthandler.svc" : 337 345 "https://api.getbeyondpay.com/PaymentService/RequestHandler.svc"; 338 346 try{ … … 383 391 return []; 384 392 } 385 393 386 394 public function billing_info_fields() { 387 395 … … 395 403 return $fields; 396 404 } 397 405 398 406 public function get_credit_card_field( $form ) { 399 407 $fields = GFAPI::get_fields_by_type( $form, array( 'beyond_pay' ) ); 400 408 return empty( $fields ) ? false : $fields[0]; 401 409 } 402 410 403 411 public function update_entry_payment_info($entry, $payment_result = array()){ 404 412 if ( … … 413 421 $form = GFAPI::get_form( $entry['form_id'] ); 414 422 $ccField = $this->get_credit_card_field($form); 415 $cc_description = 423 $cc_description = 416 424 $payment_result['card_type']. 417 425 ' ************'.substr($payment_result['pan_token'],-4). … … 424 432 } 425 433 } 426 434 427 435 public function capture_authorised_payment(){ 428 436 $form_id = rgpost('form_id'); … … 439 447 $test_mode = !empty($this->get_plugin_setting('enable-test-mode')); 440 448 $api_url = $test_mode ? 441 "https://api-test.getbeyondpay.com/paymentservice/requesthandler.svc" : 449 "https://api-test.getbeyondpay.com/paymentservice/requesthandler.svc" : 442 450 "https://api.getbeyondpay.com/PaymentService/RequestHandler.svc"; 443 451 $login = $this->get_plugin_setting(($test_mode ? 'test_' : '').'login'); … … 494 502 return $html; 495 503 } 496 504 497 505 public function add_payment_error_description($message) { 498 506 if(!empty($this->response_error)){
Note: See TracChangeset
for help on using the changeset viewer.