K
K
Kirill Makarov2018-02-24 06:11:06
WordPress
Kirill Makarov, 2018-02-24 06:11:06

Need to know the address for notification of incoming payments or transfers to the server address?

I must say right away that I am a complete teapot in programming and other things, and if this question is too simple, do not judge strictly.
I found a free plug-in for connecting payment via Yandex on the Internet, but there was a problem, I don’t know what exactly to indicate in the field, 5a90d4c6b077f026248038.jpeg
I’m interested in the part of the text after ?wc-api=
As I understand it, after filling out this form correctly, the status of my order will be automatically transferred to Completed.
I also watched a video on the Internet where they say that you need to enter WP_yandexmoney and I saw many more different combinations, but not one came up. I suspect it depends on the plugin.
I am attaching part of the code below if it helps:
I would be grateful if you tell me how to bring all this to mind))

<?php
/*
Plugin Name: Yandex Money Gateway for WooCommerce
Description: Yandex Money Gateway for WooCommerce.
Version: 1.0
Author: Dayes
*/

add_action('plugins_loaded', 'woocommerce_yandexmoney_init', 0);
define('yandexmoney_imgdir', WP_PLUGIN_URL . "/" . plugin_basename(dirname(__FILE__)) . '/');

load_plugin_textdomain('wc-yandexmoney', false, dirname(plugin_basename(__FILE__)) . '/languages/');

function woocommerce_yandexmoney_init(){
  if(!class_exists('WC_Payment_Gateway')) return;

    if( isset($_GET['msg']) && !empty($_GET['msg']) ){
        add_action('the_content', 'yandexmoney_showMessage');
    }
    function yandexmoney_showMessage($content){
            return '<div class="'.htmlentities($_GET['type']).'">'.htmlentities(urldecode($_GET['msg'])).'</div>'.$content;
    }

    /**
     * Gateway class
     */
  class WC_yandexmoney extends WC_Payment_Gateway{
    public function __construct(){
      $this->id 					= 'yandexmoney';
      $this->method_title 		= __('Yandex Money', 'wc-yandexmoney');
      $this->method_description	= __('Pay with Yandex.Money', 'wc-yandexmoney');
      $this->has_fields 			= false;
      $this->init_form_fields();
      $this->init_settings();
      $this->icon 			= yandexmoney_imgdir . 'logo.png';
            
      $this->title 			= $this->settings['title'];
      $this->redirect_page_id = $this->settings['redirect_page_id'];
      $this->liveurl 			= 'https://money.yandex.ru/quickpay/confirm.xml';
        

      $this->yandex_merchant_id      = $this->settings['yandex_merchant_id'];
      $this->yandex_secret         = $this->settings['yandex_secret'];
      $this->yandex_curs         = $this->settings['yandex_curs'];
      $this->yandex_order_desc         = $this->settings['yandex_order_desc'];			
      
      $this->description 		= $this->settings['description'];	
      
      $this->msg['message'] 	= "";
      $this->msg['class'] 	= "";
      
              
      
      //update for woocommerce >2.0
      add_action( 'woocommerce_api_' . strtolower( get_class( $this ) ), array( $this, 'check_yandexmoney_response' ) );
      
      if ( version_compare( WOOCOMMERCE_VERSION, '2.0.0', '>=' ) ) {
        /* 2.0.0 */
        add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( &$this, 'process_admin_options' ) );
      } else {
        /* 1.6.6 */
        add_action( 'woocommerce_update_options_payment_gateways', array( &$this, 'process_admin_options' ) );
      }
      
      add_action('woocommerce_receipt_yandexmoney', array(&$this, 'receipt_page'));
    }
    
    function init_form_fields(){
      $this->form_fields = array(
        'enabled' => array(
          'title' 		=> __('Enable/Disable', 'wc-yandexmoney'),
          'type' 			=> 'checkbox',
          'label' 		=> __('Enable Yandex Money Payment Module', 'wc-yandexmoney'),
          'default' 		=> 'no',
          'description' 	=> __('Show in the Payment List as a payment option', 'wc-yandexmoney')
        ),
      			'title' => array(
          'title' 		=> __('Title', 'wc-yandexmoney'),
          'type'			=> 'text',
          'default' 		=> __('Yandex Money', 'wc-yandexmoney'),
          'description' 	=> __('This controls the title which the user sees during the checkout', 'wc-yandexmoney'),
          'desc_yandexmoney' 		=> true
        ),
      			'description' => array(
          'title' 		=> __('Description', 'wc-yandexmoney'),
          'type' 			=> 'textarea',
          'default' 		=> __('Pay with Yandex Money', 'wc-yandexmoney'),
          'description' 	=> __('This controls the description which the user sees during the checkout', 'wc-yandexmoney'),
          'desc_yandexmoney' 		=> true
        ),
      			'yandex_merchant_id' => array(
                    'title'       => __('Yandex Money Wallet number', 'wc-yandexmoney'),
                    'type'        => 'text',
                    'value'       => '',
                    'description' => __( 'Enter the Wallet number of Yandex Money','wc-yandexmoney' ),
                    'default'     => '',
                    'desc_yandexmoney'    =>true,
                    'required'    =>true),
        'yandex_secret' => array(
                    'title'       => __('Secret word', 'wc-yandexmoney'),
                    'type'        => 'text',
                    'value'       => '',
                    'description' => __( 'Secret word can be found at https://money.yandex.ru/myservices/online.xml','wc-yandexmoney' ),
                    'default'     => '',
                    'desc_yandexmoney'    =>true,
                    'required'    =>true),
        'yandex_curs' => array(
                    'title'       => __('Currency rate', 'wc-yandexmoney'),
                    'type'        => 'text',
                    'value'       => '',
                    'description' => __( 'Enter the exchange rate against the currency of the sale of goods. If sold in rubles, exchange rate is 1.','wc-yandexmoney' ),
                    'default'     => '',
                    'desc_yandexmoney'    =>true,
                    'required'    =>true),
                'yandex_order_desc' => array(
                    'title'       => __('Order description', 'wc-yandexmoney'),
                    'type'        => 'text',
                    'value'       => '',
                    'description' => __( 'Text for the order description field', 'wc-yandexmoney' ),
          					'default'     => '',
          					'desc_yandexmoney'    => true,
                    'required'    => true
                   ),
      			
      			'redirect_page_id' => array(
          'title' 		=> __('Return page', 'wc-yandexmoney'),
          'type' 			=> 'select',
          'options' 		=> $this->yandexmoney_get_pages('Select page'),
          'description' 	=> __('URL of success page', 'wc-yandexmoney'),
          'desc_yandexmoney' 		=> true
                )
      );
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-02-24
@dimonchik2013

it's easier to hire an assistant here for a penny

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question