Changeset 3151490
- Timestamp:
- 09/13/2024 05:17:44 PM (19 months ago)
- Location:
- btcpay-greenfield-for-woocommerce
- Files:
-
- 46 edited
- 1 copied
-
tags/2.7.0 (copied) (copied from btcpay-greenfield-for-woocommerce/trunk)
-
tags/2.7.0/assets/js/frontend/blocks.asset.php (modified) (1 diff)
-
tags/2.7.0/assets/js/frontend/blocks.js (modified) (1 diff)
-
tags/2.7.0/assets/js/frontend/blocksModalCheckout.js (modified) (1 diff)
-
tags/2.7.0/assets/js/frontend/modalCheckout.js (modified) (1 diff)
-
tags/2.7.0/btcpay-greenfield-for-woocommerce.php (modified) (2 diffs)
-
tags/2.7.0/changelog.txt (modified) (1 diff)
-
tags/2.7.0/languages/btcpay-greenfield-for-woocommerce.pot (modified) (5 diffs)
-
tags/2.7.0/readme.txt (modified) (3 diffs)
-
tags/2.7.0/resources/js/frontend/blocksModalCheckout.js (modified) (1 diff)
-
tags/2.7.0/resources/js/frontend/modalCheckout.js (modified) (1 diff)
-
tags/2.7.0/src/Admin/GlobalSettings.php (modified) (1 diff)
-
tags/2.7.0/src/Gateway/AbstractGateway.php (modified) (6 diffs)
-
tags/2.7.0/src/Gateway/DefaultGateway.php (modified) (2 diffs)
-
tags/2.7.0/src/Helper/GreenfieldApiHelper.php (modified) (2 diffs)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/Invoice.php (modified) (4 diffs)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/PullPayment.php (modified) (2 diffs)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/StorePaymentMethod.php (modified) (1 diff)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/ApiKey.php (modified) (1 diff)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/InvoicePaymentMethod.php (modified) (4 diffs)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/PullPayment.php (modified) (1 diff)
-
tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/StorePaymentMethodCollection.php (modified) (3 diffs)
-
tags/2.7.0/vendor/composer/installed.json (modified) (3 diffs)
-
tags/2.7.0/vendor/composer/installed.php (modified) (1 diff)
-
trunk/assets/js/frontend/blocks.asset.php (modified) (1 diff)
-
trunk/assets/js/frontend/blocks.js (modified) (1 diff)
-
trunk/assets/js/frontend/blocksModalCheckout.js (modified) (1 diff)
-
trunk/assets/js/frontend/modalCheckout.js (modified) (1 diff)
-
trunk/btcpay-greenfield-for-woocommerce.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/languages/btcpay-greenfield-for-woocommerce.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/resources/js/frontend/blocksModalCheckout.js (modified) (1 diff)
-
trunk/resources/js/frontend/modalCheckout.js (modified) (1 diff)
-
trunk/src/Admin/GlobalSettings.php (modified) (1 diff)
-
trunk/src/Gateway/AbstractGateway.php (modified) (6 diffs)
-
trunk/src/Gateway/DefaultGateway.php (modified) (2 diffs)
-
trunk/src/Helper/GreenfieldApiHelper.php (modified) (2 diffs)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/Invoice.php (modified) (4 diffs)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/PullPayment.php (modified) (2 diffs)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/StorePaymentMethod.php (modified) (1 diff)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/ApiKey.php (modified) (1 diff)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/InvoicePaymentMethod.php (modified) (4 diffs)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/PullPayment.php (modified) (1 diff)
-
trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/StorePaymentMethodCollection.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.json (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
btcpay-greenfield-for-woocommerce/tags/2.7.0/assets/js/frontend/blocks.asset.php
r3010485 r3151490 1 <?php return array('dependencies' => array(' wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'cb815af5c4b849e4861bcc4c5d20b694');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'f27172b7905ad8eb456218bc4613cd3a'); -
btcpay-greenfield-for-woocommerce/tags/2.7.0/assets/js/frontend/blocks.js
r3010485 r3151490 1 (()=>{"use strict"; const e=window.wp.element,t=window.wp.i18n,n=window.wc.wcBlocksRegistry,i=window.wp.htmlEntities,o=(0,window.wc.wcSettings.getSetting)("btcpaygf_default_data",{}),a=(0,t.__)("Bitcoin / Lightning Network over BTCPay Server","woo-gutenberg-products-block"),c=(0,i.decodeEntities)(o.title)||a,l=()=>(0,i.decodeEntities)(o.description||""),r={name:"btcpaygf_default",label:(0,e.createElement)(t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:c})},null),content:(0,e.createElement)(l,null),edit:(0,e.createElement)(l,null),canMakePayment:()=>!0,ariaLabel:c,supports:{features:o.supports}};(0,n.registerPaymentMethod)(r)})();1 (()=>{"use strict";var e={20:(e,t,r)=>{var o=r(609),n=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},p=null,d=null;for(o in void 0!==r&&(p=""+r),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,o)&&!a.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:p,ref:d,props:c,_owner:i.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},t={};const r=window.wp.i18n,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,s=window.wc.wcSettings;var i=function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}(848);const a=(0,s.getSetting)("btcpaygf_default_data",{}),c=(0,r.__)("Bitcoin / Lightning Network over BTCPay Server","woo-gutenberg-products-block"),p=(0,n.decodeEntities)(a.title)||c,d=()=>(0,n.decodeEntities)(a.description||""),f=e=>{const{PaymentMethodLabel:t}=e.components;return(0,i.jsx)(t,{text:p})},l={name:"btcpaygf_default",label:(0,i.jsx)(f,{}),content:(0,i.jsx)(d,{}),edit:(0,i.jsx)(d,{}),canMakePayment:()=>!0,ariaLabel:p,supports:{features:a.supports}};(0,o.registerPaymentMethod)(l)})(); -
btcpay-greenfield-for-woocommerce/tags/2.7.0/assets/js/frontend/blocksModalCheckout.js
r3029529 r3151490 1 let isProcessingOrder=!1,lastExecutionTime=0;const debounceInterval=1e3;wp.data.subscribe(( )=>{const e=Date.now();if(!(e-lastExecutionTime<1e3)&&wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).isBeforeProcessing()&&!isProcessingOrder){isProcessingOrder=!0,lastExecutionTime=e;const t=wp.data.select(wc.wcBlocksData.PAYMENT_STORE_KEY).getState().activePaymentMethod;if(t.startsWith("btcpaygf_")){let e=blocksProcessOrder(t);return e?(blocksShowBTCPayModal(e),isProcessingOrder=!1,!1):(blocksSubmitError(BTCPayWP.textProcessingError),isProcessingOrder=!1,!1)}return!0}});const blocksProcessOrder=function(e){let t=null,o={action:"btcpaygf_modal_blocks_checkout",orderId:wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).getOrderId(),paymentGateway:e,apiNonce:BTCPayWP.apiNonce};return jQuery.ajaxSetup({async:!1}),jQuery.post(wc_add_to_cart_params.ajax_url,o,(function(e){e.data.invoiceId?t=e.data:e.data?blocksSubmitError(e.data):blocksSubmitError(BTCPayWP.textProcessingError)})).fail((function(){blocksSubmitError(BTCPayWP.textProcessingError),console.error("Error on ajax request 2")})),jQuery.ajaxSetup({async:!0}),t},blocksShowBTCPayModal=function(e){void 0!==e.invoiceId&&(window.btcpay.setApiUrlPrefix(BTCPayWP.apiUrl),window.btcpay.showInvoice(e.invoiceId));let t=!1;window.btcpay.onModalReceiveMessage((function(r){if(o(r.data)){if(r.data.status)switch(r.data.status){case"complete":case"paid":t=!0,window.location=e.orderCompleteLink;break;case"expired":window.btcpay.hideFrame(),blocksSubmitError(BTCPayWP.textInvoiceExpired),console.error("Invoice expired")}}else"close"===r.data&&(!0===t&&(window.location=e.orderCompleteLink),blocksSubmitError(BTCPayWP.textModalClosed))}));const o=e=>"[object Object]"===Object.prototype.toString.call(e)},blocksSubmitError=function(e){window.wp.data.dispatch("core/notices").createErrorNotice(e,{context:"wc/checkout"}),resetCheckout()},resetCheckout=function(){wp.data.dispatch(wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetIdle()};1 let isProcessingOrder=!1,lastExecutionTime=0;const debounceInterval=1e3;wp.data.subscribe((()=>{const e=Date.now();if(!(e-lastExecutionTime<1e3)&&wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).isBeforeProcessing()&&!isProcessingOrder){isProcessingOrder=!0,lastExecutionTime=e;const t=wp.data.select(wc.wcBlocksData.PAYMENT_STORE_KEY).getState().activePaymentMethod;if(t.startsWith("btcpaygf_")){let e=blocksProcessOrder(t);return e?(blocksShowBTCPayModal(e),isProcessingOrder=!1,!1):(blocksSubmitError(BTCPayWP.textProcessingError),isProcessingOrder=!1,!1)}return!0}}));const blocksProcessOrder=function(e){let t=null,o={action:"btcpaygf_modal_blocks_checkout",orderId:wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).getOrderId(),paymentGateway:e,apiNonce:BTCPayWP.apiNonce};return jQuery.ajaxSetup({async:!1}),jQuery.post(wc_add_to_cart_params.ajax_url,o,(function(e){e.data.invoiceId?t=e.data:e.data?blocksSubmitError(e.data):blocksSubmitError(BTCPayWP.textProcessingError)})).fail((function(){blocksSubmitError(BTCPayWP.textProcessingError),console.error("Error on ajax request 2")})),jQuery.ajaxSetup({async:!0}),t},blocksShowBTCPayModal=function(e){void 0!==e.invoiceId&&(window.btcpay.setApiUrlPrefix(BTCPayWP.apiUrl),window.btcpay.showInvoice(e.invoiceId));let t=!1;window.btcpay.onModalReceiveMessage((function(a){if(o(a.data)){if(a.data.status)switch(a.data.status.toLowerCase()){case"complete":case"paid":case"processing":case"settled":t=!0,setTimeout((function(){window.location=e.orderCompleteLink}),3e3);break;case"expired":window.btcpay.hideFrame(),submitError(BTCPayWP.textInvoiceExpired);break;case"invalid":window.btcpay.hideFrame(),submitError(BTCPayWP.textInvoiceInvalid)}}else"close"===a.data&&(!0===t&&(window.location=e.orderCompleteLink),blocksSubmitError(BTCPayWP.textModalClosed))}));const o=e=>"[object Object]"===Object.prototype.toString.call(e)},blocksSubmitError=function(e){window.wp.data.dispatch("core/notices").createErrorNotice(e,{context:"wc/checkout"}),resetCheckout()},resetCheckout=function(){wp.data.dispatch(wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetIdle()}; -
btcpay-greenfield-for-woocommerce/tags/2.7.0/assets/js/frontend/modalCheckout.js
r3010485 r3151490 74 74 //console.log('BTCPay modal event: status: ' + event.data.status); 75 75 if (event.data.status) { 76 switch (event.data.status ) {76 switch (event.data.status.toLowerCase()) { 77 77 case 'complete': 78 78 case 'paid': 79 case 'processing': 80 case 'settled': 79 81 invoice_paid = true; 80 window.location = data.orderCompleteLink; 82 setTimeout(function() { 83 window.location = data.orderCompleteLink; 84 }, 3000); 81 85 break; 82 86 case 'expired': 83 87 window.btcpay.hideFrame(); 84 88 submitError(BTCPayWP.textInvoiceExpired); 89 break; 90 case 'invalid': 91 window.btcpay.hideFrame(); 92 submitError(BTCPayWP.textInvoiceInvalid); 85 93 break; 86 94 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/btcpay-greenfield-for-woocommerce.php
r3067196 r3151490 8 8 * Text Domain: btcpay-greenfield-for-woocommerce 9 9 * Domain Path: /languages 10 * Version: 2. 6.210 * Version: 2.7.0 11 11 * Requires PHP: 8.0 12 * Tested up to: 6. 513 * Requires at least: 5.914 * WC requires at least: 6.015 * WC tested up to: 8.712 * Tested up to: 6.6 13 * Requires at least: 6.2 14 * WC requires at least: 7.0 15 * WC tested up to: 9.3 16 16 */ 17 17 … … 27 27 defined( 'ABSPATH' ) || exit(); 28 28 29 define( 'BTCPAYSERVER_VERSION', '2. 6.2' );29 define( 'BTCPAYSERVER_VERSION', '2.7.0' ); 30 30 define( 'BTCPAYSERVER_VERSION_KEY', 'btcpay_gf_version' ); 31 31 define( 'BTCPAYSERVER_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) ); -
btcpay-greenfield-for-woocommerce/tags/2.7.0/changelog.txt
r3064837 r3151490 1 = 2.4.1 :: 2024-01-22 = 2 * Fix: Ensure order status is not cancelled if paid by other payment gateway. 3 * Show periodically notification to review the plugin. 4 * Updating readme.txt (fixing text, updating banner and screenshots) 5 6 = 2.4.0 :: 2023-12-15 = 7 * Fix: Avoid error on InvoiceProcessing/InvoiceSettled event in case of paidOver property is missing. 8 * New feature: Add basic support for WooCommerce cart and checkout blocks. 9 Note: Works for default configuration; future versions will make it work with modal checkout and separate payment gateways too. 10 1 11 = 2.3.1 :: 2023-10-20 = 2 12 * Fix: Ensure refunds text does not exceed API field limit. -
btcpay-greenfield-for-woocommerce/tags/2.7.0/languages/btcpay-greenfield-for-woocommerce.pot
r3067196 r3151490 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: BTCPay For Woocommerce V2 2. 6.2\n"5 "Project-Id-Version: BTCPay For Woocommerce V2 2.7.0\n" 6 6 "Report-Msgid-Bugs-To: https://woocommerce.com/my-account/create-a-ticket/\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 4-08T22:16:18+00:00\n"12 "POT-Creation-Date: 2024-09-13T17:17:15+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 0.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "language-team: LANGUAGE <EMAIL@ADDRESS>\n" 16 16 "X-Domain: btcpay-greenfield-for-woocommerce\n" … … 90 90 91 91 #: btcpay-greenfield-for-woocommerce.php:518 92 #: src/Admin/GlobalSettings.php:3 7492 #: src/Admin/GlobalSettings.php:381 93 93 msgid "Successfully registered a new webhook on BTCPay Server." 94 94 msgstr "" 95 95 96 96 #: btcpay-greenfield-for-woocommerce.php:522 97 #: src/Admin/GlobalSettings.php:3 7897 #: src/Admin/GlobalSettings.php:385 98 98 msgid "Could not register a new webhook on the store." 99 99 msgstr "" … … 315 315 316 316 #: src/Admin/GlobalSettings.php:250 317 msgid "Customer visible refunds" 318 msgstr "" 319 320 #: src/Admin/GlobalSettings.php:253 321 msgctxt "global_settings" 322 msgid "If enabled, it will show the order refund note also to the customer and trigger an email to customer with the refund link." 323 msgstr "" 324 325 #: src/Admin/GlobalSettings.php:257 317 326 msgid "Debug Log" 318 327 msgstr "" 319 328 320 #: src/Admin/GlobalSettings.php:2 53329 #: src/Admin/GlobalSettings.php:260 321 330 msgctxt "global_settings" 322 331 msgid "Enable logging <a href=\"%s\" class=\"button\">View Logs</a>" 323 332 msgstr "" 324 333 325 #: src/Admin/GlobalSettings.php:2 85334 #: src/Admin/GlobalSettings.php:292 326 335 msgid "The provided API key scope is valid for multiple stores, please make sure to create one for a single store." 327 336 msgstr "" 328 337 329 #: src/Admin/GlobalSettings.php: 293338 #: src/Admin/GlobalSettings.php:300 330 339 msgid "The provided API key does not match the required permissions. Please make sure the following permissions are are given: %s" 331 340 msgstr "" 332 341 333 #: src/Admin/GlobalSettings.php:3 07342 #: src/Admin/GlobalSettings.php:314 334 343 msgid "Your BTCPay Server is not fully synched yet. Until fully synched the checkout will not work." 335 344 msgstr "" 336 345 337 #: src/Admin/GlobalSettings.php:3 16346 #: src/Admin/GlobalSettings.php:323 338 347 msgid "Your BTCPay Server version does not support refunds, please update to at least version 1.7.6 or newer." 339 348 msgstr "" 340 349 341 #: src/Admin/GlobalSettings.php:32 2350 #: src/Admin/GlobalSettings.php:329 342 351 msgid "Your api key does not support refunds, if you want to use that feature you need to create a new API key with permission. See our guide <a href=\"https://docs.btcpayserver.org/WooCommerce/#create-a-new-api-key\" target=\"_blank\" rel=\"noreferrer\">here</a>." 343 352 msgstr "" 344 353 345 #: src/Admin/GlobalSettings.php:3 45346 #: src/Admin/GlobalSettings.php:3 66354 #: src/Admin/GlobalSettings.php:352 355 #: src/Admin/GlobalSettings.php:373 347 356 msgid "Successfully setup manual webhook." 348 357 msgstr "" 349 358 350 #: src/Admin/GlobalSettings.php:3 49359 #: src/Admin/GlobalSettings.php:356 351 360 msgid "Webhook already exists, skipping webhook creation." 352 361 msgstr "" 353 362 354 #: src/Admin/GlobalSettings.php:39 1363 #: src/Admin/GlobalSettings.php:398 355 364 msgid "No wallet configured on your BTCPay Server store settings. Make sure to add at least one otherwise this plugin will not work." 356 365 msgstr "" 357 366 358 #: src/Admin/GlobalSettings.php: 397367 #: src/Admin/GlobalSettings.php:404 359 368 msgid "Exception loading wallet information (payment methods) from BTCPay Server: %s." 360 369 msgstr "" 361 370 362 #: src/Admin/GlobalSettings.php:4 06371 #: src/Admin/GlobalSettings.php:413 363 372 msgid "Error fetching data for this API key from server. Please check if the key is valid. Error: %s" 364 373 msgstr "" 365 374 366 #: src/Admin/GlobalSettings.php:4 23375 #: src/Admin/GlobalSettings.php:430 367 376 msgid "The PHP bcmath extension is not installed. Make sure it is available otherwise the \"Sats-Mode\" will not work. Disabled Sats-Mode until requirements are met." 368 377 msgstr "" … … 405 414 msgstr "" 406 415 407 #: src/Gateway/AbstractGateway.php:22 2416 #: src/Gateway/AbstractGateway.php:223 408 417 msgid "Refund of order " 409 418 msgstr "" 410 419 411 #: src/Gateway/AbstractGateway.php:30 0420 #: src/Gateway/AbstractGateway.php:307 412 421 msgid "Gateway Icon:" 413 422 msgstr "" 414 423 415 #: src/Gateway/AbstractGateway.php:3 05424 #: src/Gateway/AbstractGateway.php:312 416 425 msgid "Upload or select icon" 417 426 msgstr "" 418 427 419 #: src/Gateway/AbstractGateway.php:31 1428 #: src/Gateway/AbstractGateway.php:318 420 429 msgid "Remove image" 421 430 msgstr "" 422 431 423 #: src/Gateway/AbstractGateway.php:36 1432 #: src/Gateway/AbstractGateway.php:368 424 433 msgid "Use this image" 425 434 msgstr "" 426 435 427 #: src/Gateway/AbstractGateway.php:36 2436 #: src/Gateway/AbstractGateway.php:369 428 437 msgid "Insert image" 429 438 msgstr "" 430 439 431 #: src/Gateway/AbstractGateway.php:41 2440 #: src/Gateway/AbstractGateway.php:419 432 441 msgctxt "js" 433 442 msgid "The invoice expired. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time." 434 443 msgstr "" 435 444 436 #: src/Gateway/AbstractGateway.php:413 445 #: src/Gateway/AbstractGateway.php:420 446 msgctxt "js" 447 msgid "The invoice is invalid. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time." 448 msgstr "" 449 450 #: src/Gateway/AbstractGateway.php:421 437 451 msgctxt "js" 438 452 msgid "Payment aborted by you. Please try again or choose a different payment method." 439 453 msgstr "" 440 454 441 #: src/Gateway/AbstractGateway.php:4 14455 #: src/Gateway/AbstractGateway.php:422 442 456 msgctxt "js" 443 457 msgid "Error processing checkout. Please try again or choose another payment option." 444 458 msgstr "" 445 459 446 #: src/Gateway/AbstractGateway.php: 496460 #: src/Gateway/AbstractGateway.php:510 447 461 msgid "Webhook (%s) received from BTCPay, but the order is already processing or completed, skipping to update order status. Please manually check if everything is alright." 448 462 msgstr "" 449 463 450 #: src/Gateway/AbstractGateway.php:5 08464 #: src/Gateway/AbstractGateway.php:522 451 465 msgid "Invoice (partial) payment incoming (unconfirmed) after invoice was already expired." 452 466 msgstr "" 453 467 454 #: src/Gateway/AbstractGateway.php:5 11468 #: src/Gateway/AbstractGateway.php:525 455 469 msgid "Invoice (partial) payment incoming (unconfirmed). Waiting for settlement." 456 470 msgstr "" 457 471 458 #: src/Gateway/AbstractGateway.php:5 30472 #: src/Gateway/AbstractGateway.php:544 459 473 msgid "Invoice fully settled after invoice was already expired. Needs manual checking." 460 474 msgstr "" 461 475 462 #: src/Gateway/AbstractGateway.php:5 35476 #: src/Gateway/AbstractGateway.php:549 463 477 msgid "(Partial) payment settled but invoice not settled yet (could be more transactions incoming). Needs manual checking." 464 478 msgstr "" 465 479 466 #: src/Gateway/AbstractGateway.php:5 39480 #: src/Gateway/AbstractGateway.php:553 467 481 msgid "Invoice (partial) payment settled." 468 482 msgstr "" 469 483 470 #: src/Gateway/AbstractGateway.php:5 49484 #: src/Gateway/AbstractGateway.php:563 471 485 msgid "Invoice payment received fully with overpayment, waiting for settlement." 472 486 msgstr "" 473 487 474 #: src/Gateway/AbstractGateway.php:5 51488 #: src/Gateway/AbstractGateway.php:565 475 489 msgid "Invoice payment received fully, waiting for settlement." 476 490 msgstr "" 477 491 478 #: src/Gateway/AbstractGateway.php:5 57492 #: src/Gateway/AbstractGateway.php:571 479 493 msgid "Invoice manually marked invalid." 480 494 msgstr "" 481 495 482 #: src/Gateway/AbstractGateway.php:5 59496 #: src/Gateway/AbstractGateway.php:573 483 497 msgid "Invoice became invalid." 484 498 msgstr "" 485 499 486 #: src/Gateway/AbstractGateway.php:5 65500 #: src/Gateway/AbstractGateway.php:579 487 501 msgid "Invoice expired but was paid partially, please check." 488 502 msgstr "" 489 503 490 #: src/Gateway/AbstractGateway.php:5 68504 #: src/Gateway/AbstractGateway.php:582 491 505 msgid "Invoice expired." 492 506 msgstr "" 493 507 494 #: src/Gateway/AbstractGateway.php:5 74508 #: src/Gateway/AbstractGateway.php:588 495 509 msgid "Invoice payment settled but was overpaid." 496 510 msgstr "" 497 511 498 #: src/Gateway/AbstractGateway.php:5 77512 #: src/Gateway/AbstractGateway.php:591 499 513 msgid "Invoice payment settled." 500 514 msgstr "" 501 515 502 #: src/Gateway/AbstractGateway.php:6 20516 #: src/Gateway/AbstractGateway.php:634 503 517 msgid "BTCPay invoice manually set to invalid because customer went back to checkout and changed payment gateway." 504 518 msgstr "" -
btcpay-greenfield-for-woocommerce/tags/2.7.0/readme.txt
r3067196 r3151490 3 3 Donate link: https://btcpayserver.org/donate/ 4 4 Tags: Bitcoin, Lightning Network, BTCPay Server, WooCommerce, payment gateway 5 Requires at least: 5. 26 Tested up to: 6. 55 Requires at least: 5.9 6 Tested up to: 6.6 7 7 Requires PHP: 8.0 8 Stable tag: 2. 6.28 Stable tag: 2.7.0 9 9 License: MIT 10 10 License URI: https://github.com/btcpayserver/woocommerce-greenfield-plugin/blob/master/license.txt … … 112 112 113 113 == Upgrade Notice == 114 = 2.6.2 = 115 * Notifications fix, buttons should now work. 114 115 116 117 = 2.7.0 = 118 * IMPORTANT: If you use the "Separate Payment gateways" feature, when you upgrade your BTCPay Server to version 2.0.0 or newer, you will need to reconfigure your payment gateways in WooCommerce. This is due to the new way of handling and naming payment methods in BTCPay Server. 119 * Feature: Add option to notify customers on refund order notes. 120 * Feature: BTCPay Server 2.0.0 compatibility. 121 * Fixes see changelog. 116 122 117 123 == Changelog == 124 = 2.7.0 :: 2024-09-04 = 125 * Feature: Add option to notify customers on refund order notes. 126 * Feature: BTCPay Server 2.0.0 compatibility. 127 * Fix: Make sure to not process orders if the assigned payment gateway is not one of BTCPay. 128 * Fix: Make sure payment methods are set on refunds. 129 * Fix: Wrong currency in refund comment. 130 * Fix: Deprecation warnings. 131 * Maintenance: Update NodeJS dependencies. 132 * Maintenance: Update PHP library to v2.7.0. 133 118 134 = 2.6.2 :: 2024-04-09 = 119 135 * Fix: Dismissing the review notification forever, finally. … … 133 149 * Add support for modal overlay for checkout blocks. 134 150 135 = 2.4.1 :: 2024-01-22 =136 * Fix: Ensure order status is not cancelled if paid by other payment gateway.137 * Show periodically notification to review the plugin.138 * Updating readme.txt (fixing text, updating banner and screenshots)139 140 = 2.4.0 :: 2023-12-15 =141 * Fix: Avoid error on InvoiceProcessing/InvoiceSettled event in case of paidOver property is missing.142 * New feature: Add basic support for WooCommerce cart and checkout blocks.143 Note: Works for default configuration; future versions will make it work with modal checkout and separate payment gateways too.144 145 151 146 152 Changelog of older releases can be found [here](https://github.com/btcpayserver/woocommerce-greenfield-plugin/blob/master/changelog.txt) -
btcpay-greenfield-for-woocommerce/tags/2.7.0/resources/js/frontend/blocksModalCheckout.js
r3029529 r3151490 125 125 //console.log('BTCPay modal event: status: ' + event.data.status); 126 126 if (event.data.status) { 127 switch (event.data.status ) {127 switch (event.data.status.toLowerCase()) { 128 128 case 'complete': 129 129 case 'paid': 130 case 'processing': 131 case 'settled': 130 132 invoice_paid = true; 131 window.location = data.orderCompleteLink; 133 setTimeout(function() { 134 window.location = data.orderCompleteLink; 135 }, 3000); 132 136 break; 133 137 case 'expired': 134 138 window.btcpay.hideFrame(); 135 blocksSubmitError(BTCPayWP.textInvoiceExpired); 136 console.error('Invoice expired'); 139 submitError(BTCPayWP.textInvoiceExpired); 140 break; 141 case 'invalid': 142 window.btcpay.hideFrame(); 143 submitError(BTCPayWP.textInvoiceInvalid); 137 144 break; 138 145 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/resources/js/frontend/modalCheckout.js
r3010485 r3151490 74 74 //console.log('BTCPay modal event: status: ' + event.data.status); 75 75 if (event.data.status) { 76 switch (event.data.status ) {76 switch (event.data.status.toLowerCase()) { 77 77 case 'complete': 78 78 case 'paid': 79 case 'processing': 80 case 'settled': 79 81 invoice_paid = true; 80 window.location = data.orderCompleteLink; 82 setTimeout(function() { 83 window.location = data.orderCompleteLink; 84 }, 3000); 81 85 break; 82 86 case 'expired': 83 87 window.btcpay.hideFrame(); 84 88 submitError(BTCPayWP.textInvoiceExpired); 89 break; 90 case 'invalid': 91 window.btcpay.hideFrame(); 92 submitError(BTCPayWP.textInvoiceInvalid); 85 93 break; 86 94 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/src/Admin/GlobalSettings.php
r3064837 r3151490 246 246 'desc' => _x( 'Makes Satoshis/Sats available as currency "SAT" (can be found in WooCommerce->Settings->General) and handles conversion to BTC before creating the invoice on BTCPay.', 'global_settings', 'btcpay-greenfield-for-woocommerce' ), 247 247 'id' => 'btcpay_gf_sats_mode' 248 ], 249 'refund_note_visible' => [ 250 'title' => __( 'Customer visible refunds', 'btcpay-greenfield-for-woocommerce' ), 251 'type' => 'checkbox', 252 'default' => 'no', 253 'desc' => _x( 'If enabled, it will show the order refund note also to the customer and trigger an email to customer with the refund link.', 'global_settings', 'btcpay-greenfield-for-woocommerce' ), 254 'id' => 'btcpay_gf_refund_note_visible' 248 255 ], 249 256 'debug' => [ -
btcpay-greenfield-for-woocommerce/tags/2.7.0/src/Gateway/AbstractGateway.php
r3064837 r3151490 186 186 $refundAmount = PreciseNumber::parseString($amount); 187 187 $currency = $order->get_currency(); 188 $originalCurrency = $order->get_currency(); 188 189 189 190 // Check if order has invoice id. … … 215 216 $paymentMethods = $this->getPaymentMethods(); 216 217 // Remove LNURL 217 if (in_array('BTC_LNURLPAY', $paymentMethods) ) {218 $paymentMethods = array_diff($paymentMethods, ['BTC_LNURLPAY' ]);218 if (in_array('BTC_LNURLPAY', $paymentMethods) || in_array('BTC_LNURL', $paymentMethods)) { 219 $paymentMethods = array_diff($paymentMethods, ['BTC_LNURLPAY', 'BTC_LNURL']); 219 220 } 220 221 … … 243 244 $refundMsg = "PullPayment ID: " . $pullPayment->getId() . "\n"; 244 245 $refundMsg .= "Link: " . $pullPayment->getViewLink() . "\n"; 245 $refundMsg .= "Amount: " . $amount . " " . $ currency . "\n";246 $refundMsg .= "Amount: " . $amount . " " . $originalCurrency . "\n"; 246 247 $refundMsg .= "Reason: " . $reason; 247 248 $successMsg = 'Successfully created refund: ' . $refundMsg; … … 249 250 Logger::debug($successMsg); 250 251 251 $order->add_order_note($successMsg); 252 // Add public or private order note. 253 if (get_option('btcpay_gf_refund_note_visible') === 'yes') { 254 $order->add_order_note($successMsg, 1); 255 } else { 256 $order->add_order_note($successMsg); 257 } 258 252 259 // Use add_meta_data to allow for partial refunds. 253 260 $order->add_meta_data('BTCPay_refund', $refundMsg, false); … … 411 418 'isAddPaymentMethodPage' => is_add_payment_method_page() ? 'yes' : 'no', 412 419 'textInvoiceExpired' => _x( 'The invoice expired. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time.', 'js', 'btcpay-greenfield-for-woocommerce' ), 420 'textInvoiceInvalid' => _x( 'The invoice is invalid. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time.', 'js', 'btcpay-greenfield-for-woocommerce' ), 413 421 'textModalClosed' => _x( 'Payment aborted by you. Please try again or choose a different payment method.', 'js', 'btcpay-greenfield-for-woocommerce' ), 414 422 'textProcessingError' => _x( 'Error processing checkout. Please try again or choose another payment option.', 'js', 'btcpay-greenfield-for-woocommerce' ), … … 464 472 Logger::debug(print_r($orders, true)); 465 473 wp_die('Multiple orders found for this invoiceId, aborting.'); 474 } 475 476 // Only continue if the order payment method contains string "btcpaygf_" to avoid processing other gateways. 477 if (strpos($orders[0]->get_payment_method(), 'btcpaygf_') === false) { 478 Logger::debug('Order payment method does not contain "btcpaygf_", aborting.'); 479 wp_send_json_success(); // return 200 OK to not mess up BTCPay queue 466 480 } 467 481 -
btcpay-greenfield-for-woocommerce/tags/2.7.0/src/Gateway/DefaultGateway.php
r3010485 r3151490 65 65 $btcPayPaymentGW = []; 66 66 67 if ($this->get_option('enforce_payment_tokens') === 'yes') { 67 // If separate gateways are enabled and payment tokens are enforced. 68 if (get_option('btcpay_gf_separate_gateways') === 'yes' && $this->get_option('enforce_payment_tokens') === 'yes') { 68 69 $gateways = WC()->payment_gateways->payment_gateways(); 69 70 /** @var $gateway AbstractGateway */ … … 79 80 } 80 81 81 // If payment tokens are not enforced set all.82 // If payment tokens are not enforced or separate gateways are not enabled. 82 83 $separateGateways = \BTCPayServer\WC\Helper\GreenfieldApiHelper::supportedPaymentMethods(); 83 84 foreach ($separateGateways as $sgw) { -
btcpay-greenfield-for-woocommerce/tags/2.7.0/src/Helper/GreenfieldApiHelper.php
r3042021 r3151490 22 22 public $apiKey; 23 23 public $storeId; 24 public $webhook; 24 25 25 26 // todo: need to refactor as it loads cached options if form submitted by ajax … … 64 65 if ($config) { 65 66 $client = new Store($config['url'], $config['api_key']); 66 if (!empty($ stores = $client->getStores())) {67 if (!empty($client->getStores())) { 67 68 return true; 68 69 } else { -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/Invoice.php
r3064837 r3151490 8 8 use BTCPayServer\Result\InvoiceList; 9 9 use BTCPayServer\Result\InvoicePaymentMethod; 10 use BTCPayServer\Result\PullPayment as ResultPullPayment; 10 11 use BTCPayServer\Util\PreciseNumber; 11 12 … … 160 161 { 161 162 $method = 'GET'; 162 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/payment-methods'; 163 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' 164 . urlencode($invoiceId) . '/payment-methods'; 163 165 $headers = $this->getRequestHeaders(); 164 166 $response = $this->getHttpClient()->request($method, $url, $headers); … … 182 184 } 183 185 186 /** 187 * Mark an invoice status. 188 * 189 * @see https://docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_MarkInvoiceStatus 190 * @throws \JsonException 191 */ 184 192 public function markInvoiceStatus(string $storeId, string $invoiceId, string $markAs): ResultInvoice 185 193 { 186 $url = $this->getApiUrl() . 'stores/' . urlencode( 187 $storeId 188 ) . '/invoices/' . urlencode($invoiceId) . '/status'; 194 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/status'; 189 195 $headers = $this->getRequestHeaders(); 190 196 $method = 'POST'; … … 207 213 } 208 214 } 215 216 /** 217 * Refund an invoice. 218 * 219 * @see https://docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_Refund 220 * @throws \JsonException 221 */ 222 public function refundInvoice( 223 string $storeId, 224 string $invoiceId, 225 ?string $refundVariant = 'CurrentRate', 226 ?string $paymentMethod = 'BTC', 227 ?string $name = null, 228 ?string $description = null, 229 ?float $subtractPercentage = 0.0, 230 ?PreciseNumber $customAmount = null, 231 ?string $customCurrency = null 232 ): ResultPullPayment { 233 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/refund'; 234 $headers = $this->getRequestHeaders(); 235 $method = 'POST'; 236 237 $body = json_encode( 238 [ 239 'name' => $name, 240 'description' => $description, 241 'paymentMethod' => $paymentMethod, 242 'refundVariant' => $refundVariant, 243 'subtractPercentage' => $subtractPercentage, 244 'customAmount' => $customAmount?->__toString(), 245 'customCurrency' => $customCurrency 246 ], 247 JSON_THROW_ON_ERROR 248 ); 249 250 $response = $this->getHttpClient()->request($method, $url, $headers, $body); 251 252 if ($response->getStatus() === 200) { 253 return new ResultPullPayment( 254 json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR) 255 ); 256 } else { 257 throw $this->getExceptionByStatusCode($method, $url, $response); 258 } 259 } 209 260 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/PullPayment.php
r3042021 r3151490 51 51 ?int $startsAt, 52 52 ?int $expiresAt, 53 array $paymentMethods 53 array $paymentMethods, 54 ?string $description = null 54 55 ): ResultPullPayment { 55 56 $url = $this->getApiUrl() . 'stores/' . … … 62 63 [ 63 64 'name' => $name, 65 'description' => $description, 64 66 'amount' => $amount->__toString(), 65 67 'currency' => $currency, -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/StorePaymentMethod.php
r3042021 r3151490 16 16 class StorePaymentMethod extends AbstractClient 17 17 { 18 public function getPaymentMethods(string $storeId ): array18 public function getPaymentMethods(string $storeId, bool $includeConfig = false): array 19 19 { 20 20 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/payment-methods'; 21 if ($includeConfig) { 22 $url .= '?includeConfig=true'; 23 } 21 24 $headers = $this->getRequestHeaders(); 22 25 $method = 'GET'; -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/ApiKey.php
r2674285 r3151490 7 7 class ApiKey extends AbstractResult 8 8 { 9 public function getApiKey(): string 10 { 11 return $this->getData()['apiKey']; 12 } 13 14 public function getLabel(): string 15 { 16 return $this->getData()['label']; 17 } 18 19 public function getPermissions(): array 20 { 21 return $this->getData()['permissions']; 22 } 9 23 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/InvoicePaymentMethod.php
r2674285 r3151490 60 60 { 61 61 $data = $this->getData(); 62 return $data['networkFee']; 62 // BTCPay 2.0.0 compatibility: networkFee was renamed to paymentMethodFee. 63 return $data['networkFee'] ?? $data['paymentMethodFee']; 63 64 } 64 65 … … 66 67 { 67 68 $data = $this->getData(); 68 return $data['paymentMethod']; 69 // BTCPay 2.0.0 compatibility: paymentMethod was renamed to paymentMethodId. 70 return $data['paymentMethod'] ?? $data['paymentMethodId']; 69 71 } 70 72 … … 72 74 { 73 75 $data = $this->getData(); 76 // BTCPay 2.0.0 compatibility: cryptoCode was renamed to currency. 77 if (isset($data['currency'])) { 78 return $data['currency']; 79 } 80 74 81 // For future compatibility check if cryptoCode exists. 75 82 if (isset($data['cryptoCode'])) { … … 77 84 } else { 78 85 // Extract cryptoCode from paymentMethod string. 79 $parts = explode('-', $ data['paymentMethod']);86 $parts = explode('-', $this->getPaymentMethod()); 80 87 return $parts[0]; 81 88 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/PullPayment.php
r2679022 r3151490 19 19 $data = $this->getData(); 20 20 return $data['name']; 21 } 22 23 public function getDescription(): string 24 { 25 $data = $this->getData(); 26 return $data['description']; 21 27 } 22 28 -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/StorePaymentMethodCollection.php
r3042021 r3151490 14 14 $r = []; 15 15 foreach ($this->getData() as $paymentMethod => $paymentMethodData) { 16 // BTCPay 2.0 compatibility: List is not a keyed array anymore so fix it here. 17 if (is_numeric($paymentMethod)) { 18 $paymentMethod = $paymentMethodData['paymentMethodId']; 19 // Extract the cryptoCode from the paymentMethodId. e.g. "BTC-CHAIN" -> "BTC" 20 $parts = explode('-', $paymentMethod); 21 $extractedCryptoCode = $parts[0]; 22 } 23 16 24 // Consistency: Flatten the array to be consistent with the specific 17 25 // payment method endpoints. 18 $paymentMethodData += $paymentMethodData['data']; 19 unset($paymentMethodData['data']); 26 if (isset($paymentMethodData['data'])) { 27 $paymentMethodData += $paymentMethodData['data']; 28 unset($paymentMethodData['data']); 29 } 20 30 21 if (strpos($paymentMethod, 'LightningNetwork') !== false) { 31 // BTCPay 2.0 compatibility: Handle config data if exists. 32 if (isset($paymentMethodData['config'])) { 33 $paymentMethodData += $paymentMethodData['config']; 34 unset($paymentMethodData['config']); 35 } 36 37 // BTCPay 2.0 compatibility: Check for renamed LN payment method id. 38 if (preg_match('/(LightningNetwork|-LN$)/', $paymentMethod)) { 22 39 // Consistency: Add back the cryptoCode missing on this endpoint 23 40 // results until it is there. … … 25 42 $paymentMethodData['cryptoCode'] = str_replace('-LightningNetwork', '', $paymentMethod); 26 43 } 44 45 // BTCPay 2.0 compatibility: put the currency code in the cryptoCode field. 46 if (isset($extractedCryptoCode)) { 47 $paymentMethodData['cryptoCode'] = $extractedCryptoCode; 48 } 49 27 50 $r[] = new StorePaymentMethodLightningNetwork($paymentMethodData, $paymentMethod); 28 51 } else { … … 32 55 $paymentMethodData['cryptoCode'] = $paymentMethod; 33 56 } 57 58 // BTCPay 2.0 compatibility: put the currency code in the cryptoCode field. 59 if (isset($extractedCryptoCode)) { 60 $paymentMethodData['cryptoCode'] = $extractedCryptoCode; 61 } 62 34 63 $r[] = new StorePaymentMethodOnChain($paymentMethodData, $paymentMethod); 35 64 } -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/composer/installed.json
r3064837 r3151490 3 3 { 4 4 "name": "btcpayserver/btcpayserver-greenfield-php", 5 "version": "v2. 5.0",6 "version_normalized": "2. 5.0.0",5 "version": "v2.7.0", 6 "version_normalized": "2.7.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/btcpayserver/btcpayserver-greenfield-php.git", 10 "reference": " 385b7f6882213e1142b58af89b24dd1495d6babc"10 "reference": "5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/btcpayserver/btcpayserver-greenfield-php/zipball/ 385b7f6882213e1142b58af89b24dd1495d6babc",15 "reference": " 385b7f6882213e1142b58af89b24dd1495d6babc",14 "url": "https://api.github.com/repos/btcpayserver/btcpayserver-greenfield-php/zipball/5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992", 15 "reference": "5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992", 16 16 "shasum": "" 17 17 }, … … 29 29 "vlucas/phpdotenv": "^5.5" 30 30 }, 31 "time": "2024-0 4-03T08:35:46+00:00",31 "time": "2024-09-13T14:54:13+00:00", 32 32 "type": "library", 33 33 "installation-source": "dist", … … 54 54 "support": { 55 55 "issues": "https://github.com/btcpayserver/btcpayserver-greenfield-php/issues", 56 "source": "https://github.com/btcpayserver/btcpayserver-greenfield-php/tree/v2. 5.0"56 "source": "https://github.com/btcpayserver/btcpayserver-greenfield-php/tree/v2.7.0" 57 57 }, 58 58 "install-path": "../btcpayserver/btcpayserver-greenfield-php" -
btcpay-greenfield-for-woocommerce/tags/2.7.0/vendor/composer/installed.php
r3064837 r3151490 21 21 ), 22 22 'btcpayserver/btcpayserver-greenfield-php' => array( 23 'pretty_version' => 'v2. 5.0',24 'version' => '2. 5.0.0',25 'reference' => ' 385b7f6882213e1142b58af89b24dd1495d6babc',23 'pretty_version' => 'v2.7.0', 24 'version' => '2.7.0.0', 25 'reference' => '5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../btcpayserver/btcpayserver-greenfield-php', -
btcpay-greenfield-for-woocommerce/trunk/assets/js/frontend/blocks.asset.php
r3010485 r3151490 1 <?php return array('dependencies' => array(' wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'cb815af5c4b849e4861bcc4c5d20b694');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'f27172b7905ad8eb456218bc4613cd3a'); -
btcpay-greenfield-for-woocommerce/trunk/assets/js/frontend/blocks.js
r3010485 r3151490 1 (()=>{"use strict"; const e=window.wp.element,t=window.wp.i18n,n=window.wc.wcBlocksRegistry,i=window.wp.htmlEntities,o=(0,window.wc.wcSettings.getSetting)("btcpaygf_default_data",{}),a=(0,t.__)("Bitcoin / Lightning Network over BTCPay Server","woo-gutenberg-products-block"),c=(0,i.decodeEntities)(o.title)||a,l=()=>(0,i.decodeEntities)(o.description||""),r={name:"btcpaygf_default",label:(0,e.createElement)(t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:c})},null),content:(0,e.createElement)(l,null),edit:(0,e.createElement)(l,null),canMakePayment:()=>!0,ariaLabel:c,supports:{features:o.supports}};(0,n.registerPaymentMethod)(r)})();1 (()=>{"use strict";var e={20:(e,t,r)=>{var o=r(609),n=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},p=null,d=null;for(o in void 0!==r&&(p=""+r),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,o)&&!a.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:p,ref:d,props:c,_owner:i.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},t={};const r=window.wp.i18n,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,s=window.wc.wcSettings;var i=function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}(848);const a=(0,s.getSetting)("btcpaygf_default_data",{}),c=(0,r.__)("Bitcoin / Lightning Network over BTCPay Server","woo-gutenberg-products-block"),p=(0,n.decodeEntities)(a.title)||c,d=()=>(0,n.decodeEntities)(a.description||""),f=e=>{const{PaymentMethodLabel:t}=e.components;return(0,i.jsx)(t,{text:p})},l={name:"btcpaygf_default",label:(0,i.jsx)(f,{}),content:(0,i.jsx)(d,{}),edit:(0,i.jsx)(d,{}),canMakePayment:()=>!0,ariaLabel:p,supports:{features:a.supports}};(0,o.registerPaymentMethod)(l)})(); -
btcpay-greenfield-for-woocommerce/trunk/assets/js/frontend/blocksModalCheckout.js
r3029529 r3151490 1 let isProcessingOrder=!1,lastExecutionTime=0;const debounceInterval=1e3;wp.data.subscribe(( )=>{const e=Date.now();if(!(e-lastExecutionTime<1e3)&&wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).isBeforeProcessing()&&!isProcessingOrder){isProcessingOrder=!0,lastExecutionTime=e;const t=wp.data.select(wc.wcBlocksData.PAYMENT_STORE_KEY).getState().activePaymentMethod;if(t.startsWith("btcpaygf_")){let e=blocksProcessOrder(t);return e?(blocksShowBTCPayModal(e),isProcessingOrder=!1,!1):(blocksSubmitError(BTCPayWP.textProcessingError),isProcessingOrder=!1,!1)}return!0}});const blocksProcessOrder=function(e){let t=null,o={action:"btcpaygf_modal_blocks_checkout",orderId:wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).getOrderId(),paymentGateway:e,apiNonce:BTCPayWP.apiNonce};return jQuery.ajaxSetup({async:!1}),jQuery.post(wc_add_to_cart_params.ajax_url,o,(function(e){e.data.invoiceId?t=e.data:e.data?blocksSubmitError(e.data):blocksSubmitError(BTCPayWP.textProcessingError)})).fail((function(){blocksSubmitError(BTCPayWP.textProcessingError),console.error("Error on ajax request 2")})),jQuery.ajaxSetup({async:!0}),t},blocksShowBTCPayModal=function(e){void 0!==e.invoiceId&&(window.btcpay.setApiUrlPrefix(BTCPayWP.apiUrl),window.btcpay.showInvoice(e.invoiceId));let t=!1;window.btcpay.onModalReceiveMessage((function(r){if(o(r.data)){if(r.data.status)switch(r.data.status){case"complete":case"paid":t=!0,window.location=e.orderCompleteLink;break;case"expired":window.btcpay.hideFrame(),blocksSubmitError(BTCPayWP.textInvoiceExpired),console.error("Invoice expired")}}else"close"===r.data&&(!0===t&&(window.location=e.orderCompleteLink),blocksSubmitError(BTCPayWP.textModalClosed))}));const o=e=>"[object Object]"===Object.prototype.toString.call(e)},blocksSubmitError=function(e){window.wp.data.dispatch("core/notices").createErrorNotice(e,{context:"wc/checkout"}),resetCheckout()},resetCheckout=function(){wp.data.dispatch(wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetIdle()};1 let isProcessingOrder=!1,lastExecutionTime=0;const debounceInterval=1e3;wp.data.subscribe((()=>{const e=Date.now();if(!(e-lastExecutionTime<1e3)&&wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).isBeforeProcessing()&&!isProcessingOrder){isProcessingOrder=!0,lastExecutionTime=e;const t=wp.data.select(wc.wcBlocksData.PAYMENT_STORE_KEY).getState().activePaymentMethod;if(t.startsWith("btcpaygf_")){let e=blocksProcessOrder(t);return e?(blocksShowBTCPayModal(e),isProcessingOrder=!1,!1):(blocksSubmitError(BTCPayWP.textProcessingError),isProcessingOrder=!1,!1)}return!0}}));const blocksProcessOrder=function(e){let t=null,o={action:"btcpaygf_modal_blocks_checkout",orderId:wp.data.select(wc.wcBlocksData.CHECKOUT_STORE_KEY).getOrderId(),paymentGateway:e,apiNonce:BTCPayWP.apiNonce};return jQuery.ajaxSetup({async:!1}),jQuery.post(wc_add_to_cart_params.ajax_url,o,(function(e){e.data.invoiceId?t=e.data:e.data?blocksSubmitError(e.data):blocksSubmitError(BTCPayWP.textProcessingError)})).fail((function(){blocksSubmitError(BTCPayWP.textProcessingError),console.error("Error on ajax request 2")})),jQuery.ajaxSetup({async:!0}),t},blocksShowBTCPayModal=function(e){void 0!==e.invoiceId&&(window.btcpay.setApiUrlPrefix(BTCPayWP.apiUrl),window.btcpay.showInvoice(e.invoiceId));let t=!1;window.btcpay.onModalReceiveMessage((function(a){if(o(a.data)){if(a.data.status)switch(a.data.status.toLowerCase()){case"complete":case"paid":case"processing":case"settled":t=!0,setTimeout((function(){window.location=e.orderCompleteLink}),3e3);break;case"expired":window.btcpay.hideFrame(),submitError(BTCPayWP.textInvoiceExpired);break;case"invalid":window.btcpay.hideFrame(),submitError(BTCPayWP.textInvoiceInvalid)}}else"close"===a.data&&(!0===t&&(window.location=e.orderCompleteLink),blocksSubmitError(BTCPayWP.textModalClosed))}));const o=e=>"[object Object]"===Object.prototype.toString.call(e)},blocksSubmitError=function(e){window.wp.data.dispatch("core/notices").createErrorNotice(e,{context:"wc/checkout"}),resetCheckout()},resetCheckout=function(){wp.data.dispatch(wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetIdle()}; -
btcpay-greenfield-for-woocommerce/trunk/assets/js/frontend/modalCheckout.js
r3010485 r3151490 74 74 //console.log('BTCPay modal event: status: ' + event.data.status); 75 75 if (event.data.status) { 76 switch (event.data.status ) {76 switch (event.data.status.toLowerCase()) { 77 77 case 'complete': 78 78 case 'paid': 79 case 'processing': 80 case 'settled': 79 81 invoice_paid = true; 80 window.location = data.orderCompleteLink; 82 setTimeout(function() { 83 window.location = data.orderCompleteLink; 84 }, 3000); 81 85 break; 82 86 case 'expired': 83 87 window.btcpay.hideFrame(); 84 88 submitError(BTCPayWP.textInvoiceExpired); 89 break; 90 case 'invalid': 91 window.btcpay.hideFrame(); 92 submitError(BTCPayWP.textInvoiceInvalid); 85 93 break; 86 94 } -
btcpay-greenfield-for-woocommerce/trunk/btcpay-greenfield-for-woocommerce.php
r3067196 r3151490 8 8 * Text Domain: btcpay-greenfield-for-woocommerce 9 9 * Domain Path: /languages 10 * Version: 2. 6.210 * Version: 2.7.0 11 11 * Requires PHP: 8.0 12 * Tested up to: 6. 513 * Requires at least: 5.914 * WC requires at least: 6.015 * WC tested up to: 8.712 * Tested up to: 6.6 13 * Requires at least: 6.2 14 * WC requires at least: 7.0 15 * WC tested up to: 9.3 16 16 */ 17 17 … … 27 27 defined( 'ABSPATH' ) || exit(); 28 28 29 define( 'BTCPAYSERVER_VERSION', '2. 6.2' );29 define( 'BTCPAYSERVER_VERSION', '2.7.0' ); 30 30 define( 'BTCPAYSERVER_VERSION_KEY', 'btcpay_gf_version' ); 31 31 define( 'BTCPAYSERVER_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) ); -
btcpay-greenfield-for-woocommerce/trunk/changelog.txt
r3064837 r3151490 1 = 2.4.1 :: 2024-01-22 = 2 * Fix: Ensure order status is not cancelled if paid by other payment gateway. 3 * Show periodically notification to review the plugin. 4 * Updating readme.txt (fixing text, updating banner and screenshots) 5 6 = 2.4.0 :: 2023-12-15 = 7 * Fix: Avoid error on InvoiceProcessing/InvoiceSettled event in case of paidOver property is missing. 8 * New feature: Add basic support for WooCommerce cart and checkout blocks. 9 Note: Works for default configuration; future versions will make it work with modal checkout and separate payment gateways too. 10 1 11 = 2.3.1 :: 2023-10-20 = 2 12 * Fix: Ensure refunds text does not exceed API field limit. -
btcpay-greenfield-for-woocommerce/trunk/languages/btcpay-greenfield-for-woocommerce.pot
r3067196 r3151490 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: BTCPay For Woocommerce V2 2. 6.2\n"5 "Project-Id-Version: BTCPay For Woocommerce V2 2.7.0\n" 6 6 "Report-Msgid-Bugs-To: https://woocommerce.com/my-account/create-a-ticket/\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 4-08T22:16:18+00:00\n"12 "POT-Creation-Date: 2024-09-13T17:17:15+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 0.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "language-team: LANGUAGE <EMAIL@ADDRESS>\n" 16 16 "X-Domain: btcpay-greenfield-for-woocommerce\n" … … 90 90 91 91 #: btcpay-greenfield-for-woocommerce.php:518 92 #: src/Admin/GlobalSettings.php:3 7492 #: src/Admin/GlobalSettings.php:381 93 93 msgid "Successfully registered a new webhook on BTCPay Server." 94 94 msgstr "" 95 95 96 96 #: btcpay-greenfield-for-woocommerce.php:522 97 #: src/Admin/GlobalSettings.php:3 7897 #: src/Admin/GlobalSettings.php:385 98 98 msgid "Could not register a new webhook on the store." 99 99 msgstr "" … … 315 315 316 316 #: src/Admin/GlobalSettings.php:250 317 msgid "Customer visible refunds" 318 msgstr "" 319 320 #: src/Admin/GlobalSettings.php:253 321 msgctxt "global_settings" 322 msgid "If enabled, it will show the order refund note also to the customer and trigger an email to customer with the refund link." 323 msgstr "" 324 325 #: src/Admin/GlobalSettings.php:257 317 326 msgid "Debug Log" 318 327 msgstr "" 319 328 320 #: src/Admin/GlobalSettings.php:2 53329 #: src/Admin/GlobalSettings.php:260 321 330 msgctxt "global_settings" 322 331 msgid "Enable logging <a href=\"%s\" class=\"button\">View Logs</a>" 323 332 msgstr "" 324 333 325 #: src/Admin/GlobalSettings.php:2 85334 #: src/Admin/GlobalSettings.php:292 326 335 msgid "The provided API key scope is valid for multiple stores, please make sure to create one for a single store." 327 336 msgstr "" 328 337 329 #: src/Admin/GlobalSettings.php: 293338 #: src/Admin/GlobalSettings.php:300 330 339 msgid "The provided API key does not match the required permissions. Please make sure the following permissions are are given: %s" 331 340 msgstr "" 332 341 333 #: src/Admin/GlobalSettings.php:3 07342 #: src/Admin/GlobalSettings.php:314 334 343 msgid "Your BTCPay Server is not fully synched yet. Until fully synched the checkout will not work." 335 344 msgstr "" 336 345 337 #: src/Admin/GlobalSettings.php:3 16346 #: src/Admin/GlobalSettings.php:323 338 347 msgid "Your BTCPay Server version does not support refunds, please update to at least version 1.7.6 or newer." 339 348 msgstr "" 340 349 341 #: src/Admin/GlobalSettings.php:32 2350 #: src/Admin/GlobalSettings.php:329 342 351 msgid "Your api key does not support refunds, if you want to use that feature you need to create a new API key with permission. See our guide <a href=\"https://docs.btcpayserver.org/WooCommerce/#create-a-new-api-key\" target=\"_blank\" rel=\"noreferrer\">here</a>." 343 352 msgstr "" 344 353 345 #: src/Admin/GlobalSettings.php:3 45346 #: src/Admin/GlobalSettings.php:3 66354 #: src/Admin/GlobalSettings.php:352 355 #: src/Admin/GlobalSettings.php:373 347 356 msgid "Successfully setup manual webhook." 348 357 msgstr "" 349 358 350 #: src/Admin/GlobalSettings.php:3 49359 #: src/Admin/GlobalSettings.php:356 351 360 msgid "Webhook already exists, skipping webhook creation." 352 361 msgstr "" 353 362 354 #: src/Admin/GlobalSettings.php:39 1363 #: src/Admin/GlobalSettings.php:398 355 364 msgid "No wallet configured on your BTCPay Server store settings. Make sure to add at least one otherwise this plugin will not work." 356 365 msgstr "" 357 366 358 #: src/Admin/GlobalSettings.php: 397367 #: src/Admin/GlobalSettings.php:404 359 368 msgid "Exception loading wallet information (payment methods) from BTCPay Server: %s." 360 369 msgstr "" 361 370 362 #: src/Admin/GlobalSettings.php:4 06371 #: src/Admin/GlobalSettings.php:413 363 372 msgid "Error fetching data for this API key from server. Please check if the key is valid. Error: %s" 364 373 msgstr "" 365 374 366 #: src/Admin/GlobalSettings.php:4 23375 #: src/Admin/GlobalSettings.php:430 367 376 msgid "The PHP bcmath extension is not installed. Make sure it is available otherwise the \"Sats-Mode\" will not work. Disabled Sats-Mode until requirements are met." 368 377 msgstr "" … … 405 414 msgstr "" 406 415 407 #: src/Gateway/AbstractGateway.php:22 2416 #: src/Gateway/AbstractGateway.php:223 408 417 msgid "Refund of order " 409 418 msgstr "" 410 419 411 #: src/Gateway/AbstractGateway.php:30 0420 #: src/Gateway/AbstractGateway.php:307 412 421 msgid "Gateway Icon:" 413 422 msgstr "" 414 423 415 #: src/Gateway/AbstractGateway.php:3 05424 #: src/Gateway/AbstractGateway.php:312 416 425 msgid "Upload or select icon" 417 426 msgstr "" 418 427 419 #: src/Gateway/AbstractGateway.php:31 1428 #: src/Gateway/AbstractGateway.php:318 420 429 msgid "Remove image" 421 430 msgstr "" 422 431 423 #: src/Gateway/AbstractGateway.php:36 1432 #: src/Gateway/AbstractGateway.php:368 424 433 msgid "Use this image" 425 434 msgstr "" 426 435 427 #: src/Gateway/AbstractGateway.php:36 2436 #: src/Gateway/AbstractGateway.php:369 428 437 msgid "Insert image" 429 438 msgstr "" 430 439 431 #: src/Gateway/AbstractGateway.php:41 2440 #: src/Gateway/AbstractGateway.php:419 432 441 msgctxt "js" 433 442 msgid "The invoice expired. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time." 434 443 msgstr "" 435 444 436 #: src/Gateway/AbstractGateway.php:413 445 #: src/Gateway/AbstractGateway.php:420 446 msgctxt "js" 447 msgid "The invoice is invalid. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time." 448 msgstr "" 449 450 #: src/Gateway/AbstractGateway.php:421 437 451 msgctxt "js" 438 452 msgid "Payment aborted by you. Please try again or choose a different payment method." 439 453 msgstr "" 440 454 441 #: src/Gateway/AbstractGateway.php:4 14455 #: src/Gateway/AbstractGateway.php:422 442 456 msgctxt "js" 443 457 msgid "Error processing checkout. Please try again or choose another payment option." 444 458 msgstr "" 445 459 446 #: src/Gateway/AbstractGateway.php: 496460 #: src/Gateway/AbstractGateway.php:510 447 461 msgid "Webhook (%s) received from BTCPay, but the order is already processing or completed, skipping to update order status. Please manually check if everything is alright." 448 462 msgstr "" 449 463 450 #: src/Gateway/AbstractGateway.php:5 08464 #: src/Gateway/AbstractGateway.php:522 451 465 msgid "Invoice (partial) payment incoming (unconfirmed) after invoice was already expired." 452 466 msgstr "" 453 467 454 #: src/Gateway/AbstractGateway.php:5 11468 #: src/Gateway/AbstractGateway.php:525 455 469 msgid "Invoice (partial) payment incoming (unconfirmed). Waiting for settlement." 456 470 msgstr "" 457 471 458 #: src/Gateway/AbstractGateway.php:5 30472 #: src/Gateway/AbstractGateway.php:544 459 473 msgid "Invoice fully settled after invoice was already expired. Needs manual checking." 460 474 msgstr "" 461 475 462 #: src/Gateway/AbstractGateway.php:5 35476 #: src/Gateway/AbstractGateway.php:549 463 477 msgid "(Partial) payment settled but invoice not settled yet (could be more transactions incoming). Needs manual checking." 464 478 msgstr "" 465 479 466 #: src/Gateway/AbstractGateway.php:5 39480 #: src/Gateway/AbstractGateway.php:553 467 481 msgid "Invoice (partial) payment settled." 468 482 msgstr "" 469 483 470 #: src/Gateway/AbstractGateway.php:5 49484 #: src/Gateway/AbstractGateway.php:563 471 485 msgid "Invoice payment received fully with overpayment, waiting for settlement." 472 486 msgstr "" 473 487 474 #: src/Gateway/AbstractGateway.php:5 51488 #: src/Gateway/AbstractGateway.php:565 475 489 msgid "Invoice payment received fully, waiting for settlement." 476 490 msgstr "" 477 491 478 #: src/Gateway/AbstractGateway.php:5 57492 #: src/Gateway/AbstractGateway.php:571 479 493 msgid "Invoice manually marked invalid." 480 494 msgstr "" 481 495 482 #: src/Gateway/AbstractGateway.php:5 59496 #: src/Gateway/AbstractGateway.php:573 483 497 msgid "Invoice became invalid." 484 498 msgstr "" 485 499 486 #: src/Gateway/AbstractGateway.php:5 65500 #: src/Gateway/AbstractGateway.php:579 487 501 msgid "Invoice expired but was paid partially, please check." 488 502 msgstr "" 489 503 490 #: src/Gateway/AbstractGateway.php:5 68504 #: src/Gateway/AbstractGateway.php:582 491 505 msgid "Invoice expired." 492 506 msgstr "" 493 507 494 #: src/Gateway/AbstractGateway.php:5 74508 #: src/Gateway/AbstractGateway.php:588 495 509 msgid "Invoice payment settled but was overpaid." 496 510 msgstr "" 497 511 498 #: src/Gateway/AbstractGateway.php:5 77512 #: src/Gateway/AbstractGateway.php:591 499 513 msgid "Invoice payment settled." 500 514 msgstr "" 501 515 502 #: src/Gateway/AbstractGateway.php:6 20516 #: src/Gateway/AbstractGateway.php:634 503 517 msgid "BTCPay invoice manually set to invalid because customer went back to checkout and changed payment gateway." 504 518 msgstr "" -
btcpay-greenfield-for-woocommerce/trunk/readme.txt
r3067196 r3151490 3 3 Donate link: https://btcpayserver.org/donate/ 4 4 Tags: Bitcoin, Lightning Network, BTCPay Server, WooCommerce, payment gateway 5 Requires at least: 5. 26 Tested up to: 6. 55 Requires at least: 5.9 6 Tested up to: 6.6 7 7 Requires PHP: 8.0 8 Stable tag: 2. 6.28 Stable tag: 2.7.0 9 9 License: MIT 10 10 License URI: https://github.com/btcpayserver/woocommerce-greenfield-plugin/blob/master/license.txt … … 112 112 113 113 == Upgrade Notice == 114 = 2.6.2 = 115 * Notifications fix, buttons should now work. 114 115 116 117 = 2.7.0 = 118 * IMPORTANT: If you use the "Separate Payment gateways" feature, when you upgrade your BTCPay Server to version 2.0.0 or newer, you will need to reconfigure your payment gateways in WooCommerce. This is due to the new way of handling and naming payment methods in BTCPay Server. 119 * Feature: Add option to notify customers on refund order notes. 120 * Feature: BTCPay Server 2.0.0 compatibility. 121 * Fixes see changelog. 116 122 117 123 == Changelog == 124 = 2.7.0 :: 2024-09-04 = 125 * Feature: Add option to notify customers on refund order notes. 126 * Feature: BTCPay Server 2.0.0 compatibility. 127 * Fix: Make sure to not process orders if the assigned payment gateway is not one of BTCPay. 128 * Fix: Make sure payment methods are set on refunds. 129 * Fix: Wrong currency in refund comment. 130 * Fix: Deprecation warnings. 131 * Maintenance: Update NodeJS dependencies. 132 * Maintenance: Update PHP library to v2.7.0. 133 118 134 = 2.6.2 :: 2024-04-09 = 119 135 * Fix: Dismissing the review notification forever, finally. … … 133 149 * Add support for modal overlay for checkout blocks. 134 150 135 = 2.4.1 :: 2024-01-22 =136 * Fix: Ensure order status is not cancelled if paid by other payment gateway.137 * Show periodically notification to review the plugin.138 * Updating readme.txt (fixing text, updating banner and screenshots)139 140 = 2.4.0 :: 2023-12-15 =141 * Fix: Avoid error on InvoiceProcessing/InvoiceSettled event in case of paidOver property is missing.142 * New feature: Add basic support for WooCommerce cart and checkout blocks.143 Note: Works for default configuration; future versions will make it work with modal checkout and separate payment gateways too.144 145 151 146 152 Changelog of older releases can be found [here](https://github.com/btcpayserver/woocommerce-greenfield-plugin/blob/master/changelog.txt) -
btcpay-greenfield-for-woocommerce/trunk/resources/js/frontend/blocksModalCheckout.js
r3029529 r3151490 125 125 //console.log('BTCPay modal event: status: ' + event.data.status); 126 126 if (event.data.status) { 127 switch (event.data.status ) {127 switch (event.data.status.toLowerCase()) { 128 128 case 'complete': 129 129 case 'paid': 130 case 'processing': 131 case 'settled': 130 132 invoice_paid = true; 131 window.location = data.orderCompleteLink; 133 setTimeout(function() { 134 window.location = data.orderCompleteLink; 135 }, 3000); 132 136 break; 133 137 case 'expired': 134 138 window.btcpay.hideFrame(); 135 blocksSubmitError(BTCPayWP.textInvoiceExpired); 136 console.error('Invoice expired'); 139 submitError(BTCPayWP.textInvoiceExpired); 140 break; 141 case 'invalid': 142 window.btcpay.hideFrame(); 143 submitError(BTCPayWP.textInvoiceInvalid); 137 144 break; 138 145 } -
btcpay-greenfield-for-woocommerce/trunk/resources/js/frontend/modalCheckout.js
r3010485 r3151490 74 74 //console.log('BTCPay modal event: status: ' + event.data.status); 75 75 if (event.data.status) { 76 switch (event.data.status ) {76 switch (event.data.status.toLowerCase()) { 77 77 case 'complete': 78 78 case 'paid': 79 case 'processing': 80 case 'settled': 79 81 invoice_paid = true; 80 window.location = data.orderCompleteLink; 82 setTimeout(function() { 83 window.location = data.orderCompleteLink; 84 }, 3000); 81 85 break; 82 86 case 'expired': 83 87 window.btcpay.hideFrame(); 84 88 submitError(BTCPayWP.textInvoiceExpired); 89 break; 90 case 'invalid': 91 window.btcpay.hideFrame(); 92 submitError(BTCPayWP.textInvoiceInvalid); 85 93 break; 86 94 } -
btcpay-greenfield-for-woocommerce/trunk/src/Admin/GlobalSettings.php
r3064837 r3151490 246 246 'desc' => _x( 'Makes Satoshis/Sats available as currency "SAT" (can be found in WooCommerce->Settings->General) and handles conversion to BTC before creating the invoice on BTCPay.', 'global_settings', 'btcpay-greenfield-for-woocommerce' ), 247 247 'id' => 'btcpay_gf_sats_mode' 248 ], 249 'refund_note_visible' => [ 250 'title' => __( 'Customer visible refunds', 'btcpay-greenfield-for-woocommerce' ), 251 'type' => 'checkbox', 252 'default' => 'no', 253 'desc' => _x( 'If enabled, it will show the order refund note also to the customer and trigger an email to customer with the refund link.', 'global_settings', 'btcpay-greenfield-for-woocommerce' ), 254 'id' => 'btcpay_gf_refund_note_visible' 248 255 ], 249 256 'debug' => [ -
btcpay-greenfield-for-woocommerce/trunk/src/Gateway/AbstractGateway.php
r3064837 r3151490 186 186 $refundAmount = PreciseNumber::parseString($amount); 187 187 $currency = $order->get_currency(); 188 $originalCurrency = $order->get_currency(); 188 189 189 190 // Check if order has invoice id. … … 215 216 $paymentMethods = $this->getPaymentMethods(); 216 217 // Remove LNURL 217 if (in_array('BTC_LNURLPAY', $paymentMethods) ) {218 $paymentMethods = array_diff($paymentMethods, ['BTC_LNURLPAY' ]);218 if (in_array('BTC_LNURLPAY', $paymentMethods) || in_array('BTC_LNURL', $paymentMethods)) { 219 $paymentMethods = array_diff($paymentMethods, ['BTC_LNURLPAY', 'BTC_LNURL']); 219 220 } 220 221 … … 243 244 $refundMsg = "PullPayment ID: " . $pullPayment->getId() . "\n"; 244 245 $refundMsg .= "Link: " . $pullPayment->getViewLink() . "\n"; 245 $refundMsg .= "Amount: " . $amount . " " . $ currency . "\n";246 $refundMsg .= "Amount: " . $amount . " " . $originalCurrency . "\n"; 246 247 $refundMsg .= "Reason: " . $reason; 247 248 $successMsg = 'Successfully created refund: ' . $refundMsg; … … 249 250 Logger::debug($successMsg); 250 251 251 $order->add_order_note($successMsg); 252 // Add public or private order note. 253 if (get_option('btcpay_gf_refund_note_visible') === 'yes') { 254 $order->add_order_note($successMsg, 1); 255 } else { 256 $order->add_order_note($successMsg); 257 } 258 252 259 // Use add_meta_data to allow for partial refunds. 253 260 $order->add_meta_data('BTCPay_refund', $refundMsg, false); … … 411 418 'isAddPaymentMethodPage' => is_add_payment_method_page() ? 'yes' : 'no', 412 419 'textInvoiceExpired' => _x( 'The invoice expired. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time.', 'js', 'btcpay-greenfield-for-woocommerce' ), 420 'textInvoiceInvalid' => _x( 'The invoice is invalid. Please try again, choose a different payment method or contact us if you paid but the payment did not confirm in time.', 'js', 'btcpay-greenfield-for-woocommerce' ), 413 421 'textModalClosed' => _x( 'Payment aborted by you. Please try again or choose a different payment method.', 'js', 'btcpay-greenfield-for-woocommerce' ), 414 422 'textProcessingError' => _x( 'Error processing checkout. Please try again or choose another payment option.', 'js', 'btcpay-greenfield-for-woocommerce' ), … … 464 472 Logger::debug(print_r($orders, true)); 465 473 wp_die('Multiple orders found for this invoiceId, aborting.'); 474 } 475 476 // Only continue if the order payment method contains string "btcpaygf_" to avoid processing other gateways. 477 if (strpos($orders[0]->get_payment_method(), 'btcpaygf_') === false) { 478 Logger::debug('Order payment method does not contain "btcpaygf_", aborting.'); 479 wp_send_json_success(); // return 200 OK to not mess up BTCPay queue 466 480 } 467 481 -
btcpay-greenfield-for-woocommerce/trunk/src/Gateway/DefaultGateway.php
r3010485 r3151490 65 65 $btcPayPaymentGW = []; 66 66 67 if ($this->get_option('enforce_payment_tokens') === 'yes') { 67 // If separate gateways are enabled and payment tokens are enforced. 68 if (get_option('btcpay_gf_separate_gateways') === 'yes' && $this->get_option('enforce_payment_tokens') === 'yes') { 68 69 $gateways = WC()->payment_gateways->payment_gateways(); 69 70 /** @var $gateway AbstractGateway */ … … 79 80 } 80 81 81 // If payment tokens are not enforced set all.82 // If payment tokens are not enforced or separate gateways are not enabled. 82 83 $separateGateways = \BTCPayServer\WC\Helper\GreenfieldApiHelper::supportedPaymentMethods(); 83 84 foreach ($separateGateways as $sgw) { -
btcpay-greenfield-for-woocommerce/trunk/src/Helper/GreenfieldApiHelper.php
r3042021 r3151490 22 22 public $apiKey; 23 23 public $storeId; 24 public $webhook; 24 25 25 26 // todo: need to refactor as it loads cached options if form submitted by ajax … … 64 65 if ($config) { 65 66 $client = new Store($config['url'], $config['api_key']); 66 if (!empty($ stores = $client->getStores())) {67 if (!empty($client->getStores())) { 67 68 return true; 68 69 } else { -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/Invoice.php
r3064837 r3151490 8 8 use BTCPayServer\Result\InvoiceList; 9 9 use BTCPayServer\Result\InvoicePaymentMethod; 10 use BTCPayServer\Result\PullPayment as ResultPullPayment; 10 11 use BTCPayServer\Util\PreciseNumber; 11 12 … … 160 161 { 161 162 $method = 'GET'; 162 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/payment-methods'; 163 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' 164 . urlencode($invoiceId) . '/payment-methods'; 163 165 $headers = $this->getRequestHeaders(); 164 166 $response = $this->getHttpClient()->request($method, $url, $headers); … … 182 184 } 183 185 186 /** 187 * Mark an invoice status. 188 * 189 * @see https://docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_MarkInvoiceStatus 190 * @throws \JsonException 191 */ 184 192 public function markInvoiceStatus(string $storeId, string $invoiceId, string $markAs): ResultInvoice 185 193 { 186 $url = $this->getApiUrl() . 'stores/' . urlencode( 187 $storeId 188 ) . '/invoices/' . urlencode($invoiceId) . '/status'; 194 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/status'; 189 195 $headers = $this->getRequestHeaders(); 190 196 $method = 'POST'; … … 207 213 } 208 214 } 215 216 /** 217 * Refund an invoice. 218 * 219 * @see https://docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_Refund 220 * @throws \JsonException 221 */ 222 public function refundInvoice( 223 string $storeId, 224 string $invoiceId, 225 ?string $refundVariant = 'CurrentRate', 226 ?string $paymentMethod = 'BTC', 227 ?string $name = null, 228 ?string $description = null, 229 ?float $subtractPercentage = 0.0, 230 ?PreciseNumber $customAmount = null, 231 ?string $customCurrency = null 232 ): ResultPullPayment { 233 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/invoices/' . urlencode($invoiceId) . '/refund'; 234 $headers = $this->getRequestHeaders(); 235 $method = 'POST'; 236 237 $body = json_encode( 238 [ 239 'name' => $name, 240 'description' => $description, 241 'paymentMethod' => $paymentMethod, 242 'refundVariant' => $refundVariant, 243 'subtractPercentage' => $subtractPercentage, 244 'customAmount' => $customAmount?->__toString(), 245 'customCurrency' => $customCurrency 246 ], 247 JSON_THROW_ON_ERROR 248 ); 249 250 $response = $this->getHttpClient()->request($method, $url, $headers, $body); 251 252 if ($response->getStatus() === 200) { 253 return new ResultPullPayment( 254 json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR) 255 ); 256 } else { 257 throw $this->getExceptionByStatusCode($method, $url, $response); 258 } 259 } 209 260 } -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/PullPayment.php
r3042021 r3151490 51 51 ?int $startsAt, 52 52 ?int $expiresAt, 53 array $paymentMethods 53 array $paymentMethods, 54 ?string $description = null 54 55 ): ResultPullPayment { 55 56 $url = $this->getApiUrl() . 'stores/' . … … 62 63 [ 63 64 'name' => $name, 65 'description' => $description, 64 66 'amount' => $amount->__toString(), 65 67 'currency' => $currency, -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Client/StorePaymentMethod.php
r3042021 r3151490 16 16 class StorePaymentMethod extends AbstractClient 17 17 { 18 public function getPaymentMethods(string $storeId ): array18 public function getPaymentMethods(string $storeId, bool $includeConfig = false): array 19 19 { 20 20 $url = $this->getApiUrl() . 'stores/' . urlencode($storeId) . '/payment-methods'; 21 if ($includeConfig) { 22 $url .= '?includeConfig=true'; 23 } 21 24 $headers = $this->getRequestHeaders(); 22 25 $method = 'GET'; -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/ApiKey.php
r2674285 r3151490 7 7 class ApiKey extends AbstractResult 8 8 { 9 public function getApiKey(): string 10 { 11 return $this->getData()['apiKey']; 12 } 13 14 public function getLabel(): string 15 { 16 return $this->getData()['label']; 17 } 18 19 public function getPermissions(): array 20 { 21 return $this->getData()['permissions']; 22 } 9 23 } -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/InvoicePaymentMethod.php
r2674285 r3151490 60 60 { 61 61 $data = $this->getData(); 62 return $data['networkFee']; 62 // BTCPay 2.0.0 compatibility: networkFee was renamed to paymentMethodFee. 63 return $data['networkFee'] ?? $data['paymentMethodFee']; 63 64 } 64 65 … … 66 67 { 67 68 $data = $this->getData(); 68 return $data['paymentMethod']; 69 // BTCPay 2.0.0 compatibility: paymentMethod was renamed to paymentMethodId. 70 return $data['paymentMethod'] ?? $data['paymentMethodId']; 69 71 } 70 72 … … 72 74 { 73 75 $data = $this->getData(); 76 // BTCPay 2.0.0 compatibility: cryptoCode was renamed to currency. 77 if (isset($data['currency'])) { 78 return $data['currency']; 79 } 80 74 81 // For future compatibility check if cryptoCode exists. 75 82 if (isset($data['cryptoCode'])) { … … 77 84 } else { 78 85 // Extract cryptoCode from paymentMethod string. 79 $parts = explode('-', $ data['paymentMethod']);86 $parts = explode('-', $this->getPaymentMethod()); 80 87 return $parts[0]; 81 88 } -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/PullPayment.php
r2679022 r3151490 19 19 $data = $this->getData(); 20 20 return $data['name']; 21 } 22 23 public function getDescription(): string 24 { 25 $data = $this->getData(); 26 return $data['description']; 21 27 } 22 28 -
btcpay-greenfield-for-woocommerce/trunk/vendor/btcpayserver/btcpayserver-greenfield-php/src/Result/StorePaymentMethodCollection.php
r3042021 r3151490 14 14 $r = []; 15 15 foreach ($this->getData() as $paymentMethod => $paymentMethodData) { 16 // BTCPay 2.0 compatibility: List is not a keyed array anymore so fix it here. 17 if (is_numeric($paymentMethod)) { 18 $paymentMethod = $paymentMethodData['paymentMethodId']; 19 // Extract the cryptoCode from the paymentMethodId. e.g. "BTC-CHAIN" -> "BTC" 20 $parts = explode('-', $paymentMethod); 21 $extractedCryptoCode = $parts[0]; 22 } 23 16 24 // Consistency: Flatten the array to be consistent with the specific 17 25 // payment method endpoints. 18 $paymentMethodData += $paymentMethodData['data']; 19 unset($paymentMethodData['data']); 26 if (isset($paymentMethodData['data'])) { 27 $paymentMethodData += $paymentMethodData['data']; 28 unset($paymentMethodData['data']); 29 } 20 30 21 if (strpos($paymentMethod, 'LightningNetwork') !== false) { 31 // BTCPay 2.0 compatibility: Handle config data if exists. 32 if (isset($paymentMethodData['config'])) { 33 $paymentMethodData += $paymentMethodData['config']; 34 unset($paymentMethodData['config']); 35 } 36 37 // BTCPay 2.0 compatibility: Check for renamed LN payment method id. 38 if (preg_match('/(LightningNetwork|-LN$)/', $paymentMethod)) { 22 39 // Consistency: Add back the cryptoCode missing on this endpoint 23 40 // results until it is there. … … 25 42 $paymentMethodData['cryptoCode'] = str_replace('-LightningNetwork', '', $paymentMethod); 26 43 } 44 45 // BTCPay 2.0 compatibility: put the currency code in the cryptoCode field. 46 if (isset($extractedCryptoCode)) { 47 $paymentMethodData['cryptoCode'] = $extractedCryptoCode; 48 } 49 27 50 $r[] = new StorePaymentMethodLightningNetwork($paymentMethodData, $paymentMethod); 28 51 } else { … … 32 55 $paymentMethodData['cryptoCode'] = $paymentMethod; 33 56 } 57 58 // BTCPay 2.0 compatibility: put the currency code in the cryptoCode field. 59 if (isset($extractedCryptoCode)) { 60 $paymentMethodData['cryptoCode'] = $extractedCryptoCode; 61 } 62 34 63 $r[] = new StorePaymentMethodOnChain($paymentMethodData, $paymentMethod); 35 64 } -
btcpay-greenfield-for-woocommerce/trunk/vendor/composer/installed.json
r3064837 r3151490 3 3 { 4 4 "name": "btcpayserver/btcpayserver-greenfield-php", 5 "version": "v2. 5.0",6 "version_normalized": "2. 5.0.0",5 "version": "v2.7.0", 6 "version_normalized": "2.7.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/btcpayserver/btcpayserver-greenfield-php.git", 10 "reference": " 385b7f6882213e1142b58af89b24dd1495d6babc"10 "reference": "5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/btcpayserver/btcpayserver-greenfield-php/zipball/ 385b7f6882213e1142b58af89b24dd1495d6babc",15 "reference": " 385b7f6882213e1142b58af89b24dd1495d6babc",14 "url": "https://api.github.com/repos/btcpayserver/btcpayserver-greenfield-php/zipball/5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992", 15 "reference": "5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992", 16 16 "shasum": "" 17 17 }, … … 29 29 "vlucas/phpdotenv": "^5.5" 30 30 }, 31 "time": "2024-0 4-03T08:35:46+00:00",31 "time": "2024-09-13T14:54:13+00:00", 32 32 "type": "library", 33 33 "installation-source": "dist", … … 54 54 "support": { 55 55 "issues": "https://github.com/btcpayserver/btcpayserver-greenfield-php/issues", 56 "source": "https://github.com/btcpayserver/btcpayserver-greenfield-php/tree/v2. 5.0"56 "source": "https://github.com/btcpayserver/btcpayserver-greenfield-php/tree/v2.7.0" 57 57 }, 58 58 "install-path": "../btcpayserver/btcpayserver-greenfield-php" -
btcpay-greenfield-for-woocommerce/trunk/vendor/composer/installed.php
r3064837 r3151490 21 21 ), 22 22 'btcpayserver/btcpayserver-greenfield-php' => array( 23 'pretty_version' => 'v2. 5.0',24 'version' => '2. 5.0.0',25 'reference' => ' 385b7f6882213e1142b58af89b24dd1495d6babc',23 'pretty_version' => 'v2.7.0', 24 'version' => '2.7.0.0', 25 'reference' => '5e2ba7e3f585fc8e6dc068e22a0efbfdacd9c992', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../btcpayserver/btcpayserver-greenfield-php',
Note: See TracChangeset
for help on using the changeset viewer.