<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://wiki.minerva-apps.com/index.php?action=history&amp;feed=atom&amp;title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce</id>
	<title>Creare un metodo di pagamento personalizzato in WooCommerce - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.minerva-apps.com/index.php?action=history&amp;feed=atom&amp;title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce"/>
	<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;action=history"/>
	<updated>2026-05-01T19:29:30Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=1052&amp;oldid=prev</id>
		<title>Andrea il 15:13, 21 giu 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=1052&amp;oldid=prev"/>
		<updated>2023-06-21T15:13:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 15:13, 21 giu 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Riga 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[WordPress#WooCommerce|&amp;amp;larr; ritorno a WordPress/WooCommerce]] [[Category:WordPress]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[WordPress#WooCommerce|&amp;amp;larr; ritorno a WordPress / WooCommerce]] [[Category:WordPress]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-payment-in-woocommerce.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-payment-in-woocommerce.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrea</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=990&amp;oldid=prev</id>
		<title>Andrea il 07:36, 30 mar 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=990&amp;oldid=prev"/>
		<updated>2023-03-30T07:36:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 07:36, 30 mar 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Riga 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[WooCommerce|&amp;amp;larr; ritorno a WooCommerce]] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;| &lt;/del&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;GENERALE#WordPress|&amp;amp;larr; ritorno a &lt;/del&gt;WordPress]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;WordPress#&lt;/ins&gt;WooCommerce|&amp;amp;larr; ritorno a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;WordPress/&lt;/ins&gt;WooCommerce]] [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Category:&lt;/ins&gt;WordPress]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-payment-in-woocommerce.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-payment-in-woocommerce.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrea</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=726&amp;oldid=prev</id>
		<title>Andrea: Creata pagina con &quot;&amp;larr; ritorno a WooCommerce | &amp;larr; ritorno a WordPress  Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Creare_un_metodo_di_pagamento_personalizzato_in_WooCommerce&amp;diff=726&amp;oldid=prev"/>
		<updated>2022-11-16T16:16:43Z</updated>

		<summary type="html">&lt;p&gt;Creata pagina con &amp;quot;&lt;a href=&quot;/index.php?title=WooCommerce&quot; title=&quot;WooCommerce&quot;&gt;← ritorno a WooCommerce&lt;/a&gt; | &lt;a href=&quot;/index.php?title=GENERALE#WordPress&quot; title=&quot;GENERALE&quot;&gt;← ritorno a WordPress&lt;/a&gt;  Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[WooCommerce|&amp;amp;larr; ritorno a WooCommerce]] | [[GENERALE#WordPress|&amp;amp;larr; ritorno a WordPress]]&lt;br /&gt;
&lt;br /&gt;
Estratto da: https://www.mattepuffo.com/blog/articolo/2883-creare-un-custom-payment-in-woocommerce.html&lt;br /&gt;
&lt;br /&gt;
WooCommerce è probabilmente il plugin per Wordpress più utilizzato per la creazione di ecommerce.&lt;br /&gt;
&lt;br /&gt;
Ha tantissimi plugins, e può essere esteso con altri plugin custom.&lt;br /&gt;
&lt;br /&gt;
Oggi vediamo come crearne uno per aggiungere un metodo di pagamento custom.&lt;br /&gt;
&lt;br /&gt;
La struttura di base è la stessa dei plugin di Wordpress; &lt;br /&gt;
&lt;br /&gt;
== 1. Cartella plugin ==&lt;br /&gt;
Per prima cosa create una cartella dentro a '''wp-content/plugins''', nominandola seguendo le regole base di Wordpress: ad esempio '''my-custom-payment'''.&lt;br /&gt;
&lt;br /&gt;
Qui dentro abbiamo bisogno almeno di due files:&lt;br /&gt;
&lt;br /&gt;
* readme.txt&lt;br /&gt;
* un file PHP con lo stesso nome della cartella -&amp;gt; '''my-custom-payment.php'''&lt;br /&gt;
&lt;br /&gt;
== 2. File informativo ==&lt;br /&gt;
Cominciamo dal '''readme.txt''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=== WooCommerce My Custom Payment ===&lt;br /&gt;
Contributors: &lt;br /&gt;
Tags: &lt;br /&gt;
Requires at least: &lt;br /&gt;
Tested up to:&lt;br /&gt;
Stable tag:&lt;br /&gt;
License:&lt;br /&gt;
License URI:&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
La vostra descrizione&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Come vedete ci sono alcune informazioni di base; non penso siano tutte obbligatorie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 3. File plugin ==&lt;br /&gt;
Passiamo al file PHP:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Plugin Name: Custom for Woocommerce&lt;br /&gt;
 * Plugin URI: https://www.sito.it&lt;br /&gt;
 * Description: Custom Payment&lt;br /&gt;
 * Author: Nome Congome&lt;br /&gt;
 * Author URI: https://www.sito.it&lt;br /&gt;
 * Version: 0.1&lt;br /&gt;
 *&lt;br /&gt;
 * @package WC_Admin&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined('ABSPATH') || exit;&lt;br /&gt;
&lt;br /&gt;
// AGGIUNGO UN FILTRO PER VISUALIZZARE IL GATEWAY ALL'INTERNO DELLA LISTA DI WOOCOMMERCE&lt;br /&gt;
add_filter('woocommerce_payment_gateways', 'Custom_add_gateway_class');&lt;br /&gt;
function Custom_add_gateway_class($gateways) {&lt;br /&gt;
    $gateways[] = 'WC_Custom';&lt;br /&gt;
    return $gateways;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// AGGIUNGO L'AZIONE&lt;br /&gt;
add_action('plugins_loaded', 'init_wc_custom_payment_gateway');&lt;br /&gt;
function init_wc_custom_payment_gateway() {&lt;br /&gt;
&lt;br /&gt;
    class WC_Custom extends WC_Payment_Gateway {&lt;br /&gt;
&lt;br /&gt;
        public function __construct() {&lt;br /&gt;
&lt;br /&gt;
            // CAMPI OBLIGATORI&lt;br /&gt;
            $this-&amp;gt;id = 'wc_custom';&lt;br /&gt;
            $this-&amp;gt;method_title = 'Custom';&lt;br /&gt;
            $this-&amp;gt;title = 'Custom';&lt;br /&gt;
            $this-&amp;gt;has_fields = true;&lt;br /&gt;
            $this-&amp;gt;method_description = 'Custom payment gateway';&lt;br /&gt;
&lt;br /&gt;
            // CARICO LE IMPOSTAZIONI&lt;br /&gt;
            $this-&amp;gt;init_form_fields();&lt;br /&gt;
            $this-&amp;gt;init_settings();&lt;br /&gt;
            $this-&amp;gt;enabled = $this-&amp;gt;get_option('enabled');&lt;br /&gt;
            $this-&amp;gt;title = $this-&amp;gt;get_option('title');&lt;br /&gt;
            $this-&amp;gt;description = $this-&amp;gt;get_option('description');&lt;br /&gt;
&lt;br /&gt;
            // PROCESSO LE IMPOSTAZIONI&lt;br /&gt;
            add_action('woocommerce_update_options_payment_gateways_' . $this-&amp;gt;id, array($this, 'process_admin_options'));&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public function init_form_fields() {&lt;br /&gt;
            $this-&amp;gt;form_fields = array(&lt;br /&gt;
                'enabled' =&amp;gt; array(&lt;br /&gt;
                    'title' =&amp;gt; 'Enable/Disable',&lt;br /&gt;
                    'type' =&amp;gt; 'checkbox',&lt;br /&gt;
                    'label' =&amp;gt; 'Enable Custom',&lt;br /&gt;
                    'default' =&amp;gt; 'yes'&lt;br /&gt;
                ),&lt;br /&gt;
                'title' =&amp;gt; array(&lt;br /&gt;
                    'title' =&amp;gt; 'Custom',&lt;br /&gt;
                    'type' =&amp;gt; 'text',&lt;br /&gt;
                    'description' =&amp;gt; 'This controls the payment Custom',&lt;br /&gt;
                    'default' =&amp;gt; 'Custom Payment Gateway',&lt;br /&gt;
                    'desc_tip' =&amp;gt; true,&lt;br /&gt;
                ),&lt;br /&gt;
                'description' =&amp;gt; array(&lt;br /&gt;
                    'title' =&amp;gt; 'Customer Message',&lt;br /&gt;
                    'type' =&amp;gt; 'textarea',&lt;br /&gt;
                    'css' =&amp;gt; 'width:500px;',&lt;br /&gt;
                    'default' =&amp;gt; 'Weld Payment Gateway',&lt;br /&gt;
                    'description' =&amp;gt; 'Paga con Custom.',&lt;br /&gt;
                )&lt;br /&gt;
            );&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // PROCESSO DI PAGAMENTO&lt;br /&gt;
        function process_payment($order_id) {&lt;br /&gt;
            global $woocommerce;&lt;br /&gt;
&lt;br /&gt;
            $order = new WC_Order($order_id);&lt;br /&gt;
&lt;br /&gt;
            // QUI DOVETE METTERE IL VOSTRO CODICE&lt;br /&gt;
            $res = $this-&amp;gt;CustomPayment();&lt;br /&gt;
			// FINE VOSTRO CODICE&lt;br /&gt;
&lt;br /&gt;
            $order-&amp;gt;update_status('processing', 'Additional data like transaction id or reference number');&lt;br /&gt;
            $woocommerce-&amp;gt;cart-&amp;gt;empty_cart();&lt;br /&gt;
            $order-&amp;gt;reduce_order_stock();&lt;br /&gt;
&lt;br /&gt;
            return array(&lt;br /&gt;
                'result' =&amp;gt; 'success',&lt;br /&gt;
                'redirect' =&amp;gt; $this-&amp;gt;get_return_url($order)&lt;br /&gt;
            );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le prime righe, quelle commentate, le dovete tenere; sennò il plugin non verrà visualizzato nella lista di quelli installati.&lt;br /&gt;
&lt;br /&gt;
Poi usiamo '''add_filter''' per visualizzare il metodo di pagamento nelle opzioni di WooCommerce; senza quelle righe, anche a plugin attivato, il nostro gateway non apparirà tra quelli disponibili.&lt;br /&gt;
&lt;br /&gt;
Con '''add_action''' carichiamo il plugin; nella nostra funzione c'è una classe che deve estendere '''WC_Payment_Gateway'''.&lt;br /&gt;
&lt;br /&gt;
Qui dentro ci sta tutto il blocco più o meno obbligatorio; vi ho segnalato dove dovete inserire il vostro codice.&lt;br /&gt;
&lt;br /&gt;
Ovviamente il comportamento generale dipende anche dal tipo di gateway che dovete creare, e a qali eventuali API dovete agganciarvi.&lt;br /&gt;
&lt;br /&gt;
== 4. Attivazione ==&lt;br /&gt;
Una volta attivato il plugin, andate nelle impostazioni di pagamento di WooCommerce per vederlo nella lista.&lt;/div&gt;</summary>
		<author><name>Andrea</name></author>
		
	</entry>
</feed>