Title: Class.Gateway.php
Last modified: November 24, 2017

---

# Class.Gateway.php

 *  [hexmak](https://wordpress.org/support/users/hexmak/)
 * (@hexmak)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/class-gateway-php/)
 * Hi , i’m developing Persian WooCommerce SMS Plugin to use it for new gateway (
   [Smartsms](http://smartsms.ir)) that you can find more informations about it 
   with this link **([more](https://goo.gl/viqzbW))** .
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclass-gateway-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 * ![](https://ps.w.org/persian-woocommerce-sms/assets/icon-256x256.png?rev=2641767)
 * [افزونه پیامک ووکامرس Persian WooCommerce SMS](https://wordpress.org/plugins/persian-woocommerce-sms/)
 * [Support Threads](https://wordpress.org/support/plugin/persian-woocommerce-sms/)
 * [Active Topics](https://wordpress.org/support/plugin/persian-woocommerce-sms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/persian-woocommerce-sms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/persian-woocommerce-sms/reviews/)

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * 0 replies
 * 1 participant
 * Last reply from: [hexmak](https://wordpress.org/support/users/hexmak/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/class-gateway-php/)
 * Status: not resolved