WordPress.org

Plugin Directory

Changeset 583880


Ignore:
Timestamp:
08/10/12 13:02:59 (5 years ago)
Author:
loomst
Message:
 
Location:
robokassa-shortcode/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • robokassa-shortcode/trunk/readme.txt

    r562642 r583880  
    44Requires at least: 3.0 
    55Tested up to: 3.3.1 
    6 Stable tag: 0.1 
     6Stable tag: 0.5 
    77 
    88This plugin allows you to place a payment button in any Robokassa your post or on any page. Place the shortcode provide a description of payment and amount. 
     
    2424 
    2525== Changelog == 
     26 
     27= 0.5 = 
     28* Added featre: If you do not enter price value user can enter them by them self  
     29* Fix problem with multiple forms on one page 
     30* adder russian localization 
    2631     
    2732= 0.1 = 
    2833* First public release 
     34 
     35 
  • robokassa-shortcode/trunk/robokassa_shortcode.php

    r562639 r583880  
    2020{ 
    2121 register_setting( 'rksc-settings-group', 'rksc-settings-group'); 
    22  add_settings_section('rksc-settings-group', 'Main Settings', 'rksc_section_text', 'rksc_config'); 
    23  add_settings_field('rksc_merchant', 'Merchant ID', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'merchant')); 
    24  add_settings_field('rksc_key1', 'Key #1', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'key1')); 
    25  add_settings_field('rksc_key2', 'Key #2', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'key2')); 
    26  add_settings_field('rksc_test', 'Test mode', 'rksc_setting_check', 'rksc_config', 'rksc-settings-group',array('id'=>'test')); 
    27  add_settings_field('rksc_success_url', 'Success url', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'success_url')); 
    28  add_settings_field('rksc_fail_url', 'Fail url', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'fail_url')); 
    29  add_settings_field('rksc_sitepass', 'Site password', 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'sitepass')); 
    30  add_settings_field('rksc_email', 'Email body', 'rksc_setting_text', 'rksc_config', 'rksc-settings-group',array('id'=>'email')); 
     22 add_settings_section('rksc-settings-group', __('Main Settings','rksc'), 'rksc_section_text', 'rksc_config'); 
     23 add_settings_field('rksc_merchant', __('Merchant ID','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'merchant')); 
     24 add_settings_field('rksc_key1', __('Key #1','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'key1')); 
     25 add_settings_field('rksc_key2', __('Key #2','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'key2')); 
     26 add_settings_field('rksc_test', __('Test mode','rksc'), 'rksc_setting_check', 'rksc_config', 'rksc-settings-group',array('id'=>'test')); 
     27 add_settings_field('rksc_success_url', __('Success url','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'success_url')); 
     28 add_settings_field('rksc_fail_url', __('Fail url','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'fail_url')); 
     29 add_settings_field('rksc_sitepass', __('Site password','rksc'), 'rksc_setting_string', 'rksc_config', 'rksc-settings-group',array('id'=>'sitepass')); 
     30 add_settings_field('rksc_email', __('Email body','rksc'), 'rksc_setting_text', 'rksc_config', 'rksc-settings-group',array('id'=>'email')); 
    3131} 
    3232 
     
    4242} 
    4343function rksc_section_text() { 
    44 echo '<p>Main description of this section here.</p>'; 
     44echo '<p>'.__('Main description of this section here.').'</p>'; 
    4545} 
    4646function rksc_setting_string($id) { 
     
    6666function rksc_robokassa_sc($attr) 
    6767{ 
     68 $fid=rand(); 
    6869 $options = get_option('rksc-settings-group'); 
    6970 wp_register_style( 'RobokassaStylesheet', plugins_url('styles.css', __FILE__) ); 
    7071 wp_enqueue_style( 'RobokassaStylesheet' ); 
    71  $form='<div id="rkwarp" style=" display: none;"><form id="rkform" action="/rksc/send.php" method="post">'; 
    72  $form.='Name:<input name="shpfirstname"><br />'; 
    73  $form.='email:<input name="shpemail"><br />'; 
     72 $form='<div id="rkwarp'.$fid.'" style=" display: none;"><form id="rkform" action="/rksc/send.php" method="post">'; 
     73 $form.=__('Name','rksc').':<input name="shpfirstname"><br />'; 
     74 $form.=__('email','rksc').':<input name="shpemail"><br />'; 
     75 if(!isset($attr['price']) || $attr['price']=='') 
     76 { 
     77    $form.=__('Price','rksc').':<input name="price"><br />'; 
     78 } 
    7479 $hash=''; 
    7580 foreach($attr as $key=>$value) 
    7681 { 
     82  if($value!='') 
    7783  $form.="<input type='hidden' name='a_{$key}' value='{$value}'>"; 
    7884 } 
     
    8288 $form.="<input type='submit' value='Pay'>"; 
    8389 $form.='</form></div>'; 
    84  $form.="<a href='#' onclick='if(document.getElementById(\"rkwarp\").style.display==\"block\"){document.getElementById(\"rkwarp\").style.display=\"none\"}else{document.getElementById(\"rkwarp\").style.display=\"block\"};return false;' class='classname'>Robokassa</a>"; 
     90 $form.="<a href='#' onclick='if(document.getElementById(\"rkwarp{$fid}\").style.display==\"block\"){document.getElementById(\"rkwarp{$fid}\").style.display=\"none\"}else{document.getElementById(\"rkwarp{$fid}\").style.display=\"block\"};return false;' class='classname'>Robokassa</a>"; 
    8591 return $form; 
    8692} 
    8793function rksc_init() 
    8894{ 
     95 //echo get_locale(); 
     96 load_plugin_textdomain( 'rksc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 
    8997 $options = get_option('rksc-settings-group'); 
    9098if ( strpos($_SERVER["REQUEST_URI"], '/rksc/res.php')!==false ) { 
     
    118126 if($options['rksc_test']==1) 
    119127    $action_adr = 'http://test.robokassa.ru/Index.aspx'; 
     128 if(!isset($_POST['a_price']) && isset($_POST['price'])) 
     129    $_POST['a_price']=$_POST['price']; 
    120130 $summ=number_format($_POST['a_price'], 2, '.', ''); 
    121131 $orderid=time(); 
Note: See TracChangeset for help on using the changeset viewer.