kirbi1996
@kirbi1996

Необходимо узнать адрес уведомления о входящих платежах или переводах на адрес сервера?

Сразу скажу, что в программировании и прочем я чайник полный, и если данный вопрос слишком прост не судите строго.
В интернете нашел бесплатный плагин для подключения оплаты через яндекс, но возникла проблема, не знаю что именно указать в поле 5a90d4c6b077f026248038.jpeg
меня интересует часть текста после ?wc-api=
Я так понимаю именно после правильного заполнения данной формы статус моего заказа будет автоматически переводиться в Выполнен.
Так же я посмотрел в интернете ролик где говорят, что нужно ввести WP_yandexmoney и еще много различных комбинаций видел но не одна не подошла. я так подозреваю это от плагина зависит.
Ниже прилагаю часть кода если она поможет:
Буду благодарен если подскажете как довести до ума все это))
<?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
                )
			);
		}
  • Вопрос задан
  • 139 просмотров
Пригласить эксперта
Ответы на вопрос 1
dimonchik2013
@dimonchik2013
non progredi est regredi
проще тут за копейку нанять помощника
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы