Changeset 2630470
- Timestamp:
- 11/16/2021 05:40:08 AM (4 years ago)
- Location:
- chaiport-payment/trunk
- Files:
-
- 2 edited
-
chaiportGateway.php (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chaiport-payment/trunk/chaiportGateway.php
r2621939 r2630470 4 4 * Plugin URI: https://www.beta-docs.chaipay.io/plugins_and_sdks/woocommerce-plugin.html 5 5 * Description: Single Payment 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Requires at least: 5.6 8 8 * Author: Chai Finance … … 106 106 $publicKey = ($options["testmode"] == "yes" ? $options["test_publishable_key"] : $options["publishable_key"]); 107 107 $privateKey = ($options["testmode"] == "yes" ? $options["test_private_key"] : $options["private_key"]); 108 $orderStatusType = $options["payment_process_action"]; 108 109 $getOrderStatusUrl = $chaiApiUrl . $chaiPortId; 109 110 $header = array( … … 126 127 if ($order->get_status() != "completed") { 127 128 if ($status == "Success") { 128 $order->update_status('wc-processing'); 129 if ($orderStatusType == "Processing") { 130 $order->update_status('wc-processing'); 131 } else { 132 $order->update_status('wc-completed'); 133 } 129 134 $note .= "Transaction Status: " . $status . "\n"; 130 135 $note .= "Order reference: " . $orderRef . "\n"; … … 291 296 $order = wc_get_order($orderId); 292 297 293 // fetching the plugin setting to extract keys 298 // fetching the plugin setting to extract keys & other settings 294 299 $options = get_option('woocommerce_chaiport_settings'); 295 300 $privateKey = ($options["testmode"] == "yes" ? $options["test_private_key"] : $options["private_key"]); 301 $orderStatusType = $options["payment_process_action"]; 296 302 297 303 // validating signature … … 321 327 322 328 if ($status == "Success") { 323 $order->update_status('wc-processing'); 329 if ($orderStatusType == "Processing") { 330 $order->update_status('wc-processing'); 331 } else { 332 $order->update_status('wc-completed'); 333 } 324 334 $note .= "Transaction Status: " . $status . "\n"; 325 335 $note .= "Order reference: " . $orderRef; … … 373 383 $order = wc_get_order($orderId); 374 384 375 // fetching the plugin setting to extract keys 385 // fetching the plugin setting to extract keys & other settings 376 386 $options = get_option('woocommerce_chaiport_settings'); 377 387 $publicKey = ($options["testmode"] == "yes" ? $options["test_publishable_key"] : $options["publishable_key"]); 378 388 $privateKey = ($options["testmode"] == "yes" ? $options["test_private_key"] : $options["private_key"]); 389 $orderStatusType = $options["payment_process_action"]; 379 390 380 391 // validating signature … … 388 399 389 400 if ($status == "Success") { 390 $status = $order->update_status('wc-processing'); 401 if ($orderStatusType == "Processing") { 402 $order->update_status('wc-processing'); 403 } else { 404 $order->update_status('wc-completed'); 405 } 391 406 $note .= "Transaction Status: " . $status . "\n"; 392 407 $note .= "Order reference: " . $orderRef; … … 468 483 $this->publishable_key = $this->testmode ? $this->get_option('test_publishable_key') : $this->get_option('publishable_key'); 469 484 $this->webhook_url = $webhookUrl; 485 $this->payment_process_action = $this->get_option('payment_process_action'); 470 486 471 487 // This action hook saves the settings … … 597 613 'desc_tip' => true, 598 614 'id' => 'default_guest_checkout' 599 ) 615 ), 616 'payment_process_action' => array( 617 'title' => 'Payment processing action', 618 'type' => 'select', 619 'description' => 'This is the status that the order will be moved to when payment is processed successfully', 620 'default' => 'Processing', 621 'options' => array( 622 'Processing' => 'Processing', 623 'Completed' => 'Completed' 624 ) 625 ), 600 626 ); 601 627 } -
chaiport-payment/trunk/readme.txt
r2621881 r2630470 4 4 Requires at least: 3.9.2 5 5 Tested up to: 5.8.1 6 Stable tag: 1.0. 16 Stable tag: 1.0.2 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.