Changeset 3171179
- Timestamp:
- 10/18/2024 05:44:30 AM (18 months ago)
- Location:
- ampacash-payment-method/trunk
- Files:
-
- 3 edited
-
ampacash-veprap-payment-wp.php (modified) (1 diff)
-
js/script.js (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ampacash-payment-method/trunk/ampacash-veprap-payment-wp.php
r3116848 r3171179 3 3 * Plugin Name: AmpaCash Veprap Payment 4 4 * Description: AmpaCash Veprap Payment Method for user to pay for merchandise. 5 * Version: 2. 35 * Version: 2.5 6 6 * Author: AmpaCash 7 7 * License: GPLv2 or later -
ampacash-payment-method/trunk/js/script.js
r3116848 r3171179 1 1 2 2 setTimeout(function() { 3 // Ensure the variables are properly defined4 var paymentMethodVar = typeof ampaCashVars !== 'undefined' ? ampaCashVars.paymentMethodVar : ' veprap';3 // Ensure the variables are properly defined 4 var paymentMethodVar = typeof ampaCashVars !== 'undefined' ? ampaCashVars.paymentMethodVar : 'ampacash_veprap'; 5 5 var isUserLoggedInVar = typeof ampaCashVars !== 'undefined' ? ampaCashVars.isUserLoggedInVar : ''; 6 6 var merchantIdVar = typeof ampaCashVars !== 'undefined' ? ampaCashVars.merchantIdVar : ''; … … 8 8 // Function to show/hide the order button 9 9 function toggleOrderButton(display) { 10 console.log("place-order button visibility:", display); 10 11 document.getElementById("place_order").style.display = display; 11 document.getElementById("def").style.display = (display === 'block') ? 'none' : 'block';12 document.getElementById("def").style.display = !display; 12 13 } 13 14 … … 59 60 60 61 jQuery(function ($) { 62 paymentMethodVar = $("input[name='payment_method']:checked").val(); // Get the initially selected payment method 63 61 64 // Check local storage for payment success status 62 65 if (localStorage.getItem("paymentStatus") === "success") { … … 65 68 } else { 66 69 // Hide the order button by default if the payment method is veprap 67 if ( document.getElementById("success_def").innerHTML !== "Payment Received.") {68 toggleOrderButton( paymentMethodVar === "veprap" ? "none" : "block");70 if (localStorage.getItem("paymentStatus") !== "success" && paymentMethodVar === "ampacash_veprap") { 71 toggleOrderButton("none"); 69 72 } 70 73 } … … 72 75 // Handle payment method change event 73 76 $(document.body).on("change", "input[name='payment_method']", function () { 74 toggleOrderButton(paymentMethodVar === $(this).val() && $("#success_def").html().trim() === "" ? "none" : "block"); 77 paymentMethodVar = $(this).val(); // Update the variable when payment method changes 78 79 console.log("paymentMethodVar: ", paymentMethodVar); 80 console.log("paymentMethodVar === 'ampacash_veprap'?: ", paymentMethodVar === "ampacash_veprap"); 81 toggleOrderButton(paymentMethodVar === "ampacash_veprap" && $("#success_def").html().trim() === "" ? "none" : "block"); 75 82 }); 76 83 … … 94 101 localStorage.removeItem("paymentStatus"); 95 102 document.getElementById("success_def").innerHTML = ""; 96 toggleOrderButton("none"); 97 if ($("input[name='payment_method']:checked").val() !== "veprap") { 98 $("#place_order").show(); 103 104 if ($("input[name='payment_method']:checked").val() !== "ampacash_veprap") { 105 toggleOrderButton("block"); 106 } else { 107 toggleOrderButton("none"); 99 108 } 100 109 }); … … 122 131 123 132 } else { 124 console.log( event.detail.data.data["message"]);133 console.log("error has been logged: ", event.detail.data.data["message"]); 125 134 if (document.getElementById("success_def").innerHTML !== "Payment Received.") { 126 135 document.getElementById("success_def").innerHTML = ""; -
ampacash-payment-method/trunk/readme.txt
r3116848 r3171179 1 1 === ampacash-veprap-payment === 2 2 Contributors: ampacash 3 Tags: checkout, payment, mobile, marketplace, ecommerce 3 4 Requires at least: 4.7 4 5 Tested up to: 6.5 5 Stable tag: 2. 36 Stable tag: 2.5 6 7 Requires PHP: 7.0 7 8 License: GPLv2 or later … … 48 49 49 50 4. Complete the payment using the AmpaCash PIN. 51 52 https://www.youtube.com/watch?v=EpoA4m3mkuI&rel=0 50 53 51 54 ## Support and Feedback … … 98 101 == Changelog == 99 102 103 = 2.5 = 104 * Fixed compatibility with other payment plugins. 105 106 = 2.4 = 107 * Added video tutorial to instructions. 108 100 109 = 2.3 = 101 110 * Updated 'Tested Up To' value to 6.5.
Note: See TracChangeset
for help on using the changeset viewer.