• Hi , i’m developing Persian WooCommerce SMS Plugin to use it for new gateway (Smartsms) that you can find more informations about it with this link (more) .

    Actually , we can’t use this plugin for Smartsms .
    Could you help us to improve our codes ?

    my sample codes :

    <?php
    	function smartsms( $datas ) {
    		$response = false;
    		$username = $this->username['SMS'];
    		$password = $this->password['SMS'];
    		$from     = $this->from['SMS'];
    		$to       = $datas['number'];
    		$massage  = $datas['sms_body'];
    		if ( empty( $username ) || empty( $password ) ) {
    			return $response;
    		}
    
    		$client = new SoapClient( "http://ws.smartsms.ir/sms.asmx?wsdl" );
    		try {
    			$encoding   = "UTF-8";
    			$parameters = array(
    				'userid'      => $username,
    				'password'    => $password,
    				'originator'  => $from,
    				'mobile'      => $to,
    				'message'     => iconv( $encoding, 'UTF-8//TRANSLIT', $massage ),
    				'status'      => 0,
    				'type'	      => 'oto'
    			);
    			$status     = $client->SendSms( $parameters )->SendSmsResult;
    		} catch ( SoapFault $ex ) {
    			$sms_response = $ex->faultstring;
    		}
    
    		if ( empty( $sms_response ) && $status == 1 ) {
    			$response = true;
    		}
    
    		return $response;
    	}
    ?>

    Thanks ,
    WooCommerce User

    The page I need help with: [log in to see the link]

The topic ‘Class.Gateway.php’ is closed to new replies.