Exemplo n.º 1
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->transactionGroupId = $this->response['transaction_group_id'];
     $this->totalTransactions = $this->response['total_transactions'];
     $this->optinMethod = $this->response['optin_method'];
     $this->userId = $this->response['user_id'];
     $this->billingType = $this->response['billing_type'];
     if (array_key_exists('offportal_url', $this->response)) {
         $this->offPortalUrl = $this->response['offportal_url'];
     }
     $this->transactionIds = array();
     foreach ($this->response as $key => $value) {
         if (substr($key, 0, 15) == "transaction_id_") {
             array_push($this->transactionIds, $value);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.2
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->confirmation = $this->response['confirmation'];
 }
Exemplo n.º 3
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->text = trim($this->response['country']['text']);
 }
Exemplo n.º 4
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.2
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     $this->transactionGroupId = $this->response['transaction_group_id']['@attributes']['id'];
     $this->totalPricePoint = $this->response['transaction_group_id']['@attributes']['total_price_point'];
     $this->totalCommodityAmount = $this->response['transaction_group_id']['@attributes']['total_commodity_amount'];
     $this->transactionStatusInfos = array();
     if (Text2PayApi_Common::isAssocArray($this->response['transaction_group_id']['transaction_id'])) {
         // it is a single transaction
         array_push($this->transactionStatusInfos, new Text2PayApi_checkTransactionStatus_TransactionStatusInfo($this->response['transaction_group_id']['transaction_id']));
     } else {
         // it is a list of multiple transactions
         foreach ($this->response['transaction_group_id']['transaction_id'] as $t) {
             array_push($this->transactionStatusInfos, new Text2PayApi_checkTransactionStatus_TransactionStatusInfo($t));
         }
     }
 }
Exemplo n.º 5
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->transactionGroupId = $this->response['transaction_group_id']['@attributes']['id'];
     $this->transactionInfos = array();
     if (Text2PayApi_Common::isAssocArray($this->response['transaction_group_id']['transaction_id'])) {
         // it is a single transaction
         $trxid = $this->response['transaction_group_id']['transaction_id']['@attributes']['id'];
         $confirmation = $this->response['transaction_group_id']['transaction_id']['confirmation'];
         $this->transactionInfos[] = new Text2PayApi_verifyTransaction_TransactionInfo($trxid, $confirmation);
     } else {
         // it is a list of multiple transactions
         foreach ($this->response['transaction_group_id']['transaction_id'] as $t) {
             $trxid = $t['@attributes']['id'];
             $confirmation = $t['confirmation'];
             $this->transactionInfos[] = new Text2PayApi_verifyTransaction_TransactionInfo($trxid, $confirmation);
         }
     }
 }
Exemplo n.º 6
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  * 
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->msisdn = $this->response['msisdn'];
     $this->countryCode = $this->response['country_code'];
     $this->networkId = $this->response['network_id'];
     $this->networkCode = $this->response['network_code'];
     $this->networkTitle = $this->response['network_title'];
     $this->networkTierLevel = $this->response['network_tierlevel'];
 }
Exemplo n.º 7
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.4
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     $this->id = $this->response['campaign']['@attributes']['id'];
     $this->name = $this->response['campaign']['@attributes']['name'];
     // Map all response data into this object
     $this->countryInfos = array();
     foreach ($this->fixXmlPhpArray($this->response['campaign']['country']) as $co) {
         array_push($this->countryInfos, new Text2PayApi_getCampaignInfo_CountryInfo($co['@attributes']['code'], $co['brand_name'], $co['credit_title'], $co['send_confirmation'], $co['product_type'], $co['adult_allowed'], $co['gambling_allowed'], $co['accept_bitcoin']));
     }
 }
Exemplo n.º 8
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     $this->countryInfo = new Text2PayApi_getServices_CountryInfo($this->response['country']['@attributes']['code'], $this->response['country']['@attributes']['symbol'], $this->response['country']['@attributes']['currency']);
     $this->serviceInfos = array();
     foreach ($this->fixXmlPhpArray($this->response['country']['shortcode']) as $sc) {
         $shortCode = $sc['@attributes']['code'];
         foreach ($this->fixXmlPhpArray($sc['carrier']) as $ca) {
             $carrierCode = $ca['@attributes']['code'];
             $type = $ca['type']['@attributes']['name'];
             foreach ($this->fixXmlPhpArray($ca['type']['service']) as $sv) {
                 $serviceId = $sv['@attributes']['id'];
                 $pricePoint = $sv['pricepoint']['@attributes']['amount'];
                 $aggregatorRef = $sv['aggregator']['@attributes']['reference'];
                 $chargePerMo = $sv['charges']['@attributes']['per_mo'];
                 $chargePerMt = $sv['charges']['@attributes']['per_mt'];
                 $chargePerBulkMt = $sv['charges']['@attributes']['per_bulk_mt'];
                 $chargePerFailedTransaction = $sv['charges']['@attributes']['per_failed_trans'];
                 $chargePerNetworkLookup = $sv['charges']['@attributes']['network_lookup'];
                 $charges = new Text2PayApi_getServices_Charges($chargePerMo, $chargePerMt, $chargePerBulkMt, $chargePerFailedTransaction, $chargePerNetworkLookup);
                 // got all elements, so push in the object into the array
                 array_push($this->serviceInfos, new Text2PayApi_getServices_ServiceInfo($aggregatorRef, $pricePoint, $serviceId, $type, $carrierCode, $shortCode, $charges));
             }
         }
     }
 }
Exemplo n.º 9
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.2
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->outcome = $this->response['outcome'];
 }
Exemplo n.º 10
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->message = trim($this->response['message']);
 }
Exemplo n.º 11
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.3
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->shortCode = trim($this->response['short_code']);
     $this->keyword = trim($this->response['keyword']);
 }
Exemplo n.º 12
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->countryInfo = new Text2PayApi_getCarriers_CountryInfo($this->response['country']['@attributes']['code'], $this->response['country']['@attributes']['hlr_lookup'], $this->response['country']['@attributes']['msisdn_local_prefix'], $this->response['country']['@attributes']['msisdn_international_prefix'], $this->response['country']['@attributes']['msisdn_suffix'], $this->response['country']['@attributes']['msisdn_remember']);
     $this->carrierInfos = array();
     foreach ($this->fixXmlPhpArray($this->response['carriers']['carrier']) as $ca) {
         $code = $ca['@attributes']['code'];
         $title = $ca['@attributes']['title'];
         $tier = $ca['@attributes']['tier'];
         // got all elements, so push in the object into the array
         array_push($this->carrierInfos, new Text2PayApi_getCarriers_CarrierInfo($code, $title, $tier));
     }
 }
Exemplo n.º 13
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.5
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // in this case, the response property is null because we are not dealing
     // with XML data. So, get it from raw data directly, while properly handling
     // errors.
     // Map all response data into this object
     $this->transactionInfos = array();
     $temp = explode(PHP_EOL, $raw);
     if (count($temp) > 0) {
         $keys = str_getcsv($temp[0]);
         for ($i = 1; $i < count($temp); $i++) {
             if (strlen($temp[$i]) > 0) {
                 $item = array();
                 $values = str_getcsv($temp[$i]);
                 for ($j = 0; $j < count($keys); $j++) {
                     $item[$keys[$j]] = $values[$j];
                 }
                 array_push($this->transactionInfos, $item);
             }
         }
     }
 }
Exemplo n.º 14
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->transactionGroupId = $this->response['transaction_group_id'];
     $this->confirmation = $this->response['confirmation'];
 }
Exemplo n.º 15
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.3
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->msisdn = $this->response['msisdn'];
     $this->countryCode = $this->response['country_code'];
     $this->carrierCode = $this->response['carrier_code'];
 }
Exemplo n.º 16
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     $this->countryInfo = new Text2PayApi_Objects_CountryInfo($this->response['country']['@attributes']['code'], $this->response['country']['@attributes']['title'], $this->response['country']['@attributes']['title_local'], $this->response['country']['continent']['@attributes']['name'], $this->response['country']['language']['@attributes']['code'], $this->response['country']['language']['@attributes']['text_direction']);
     $this->msisdnInfo = new Text2PayApi_Objects_MsisdnInfo($this->response['country']['msisdn']['@attributes']['international_prefix'], $this->response['country']['msisdn']['@attributes']['local_prefix'], $this->response['country']['msisdn']['@attributes']['suffix'], $this->response['country']['msisdn']['@attributes']['remember_allowed'], $this->response['country']['msisdn']['@attributes']['network_lookup_available'], $this->response['country']['msisdn']['@attributes']['mo_reachable'], $this->response['country']['msisdn']['@attributes']['reference']);
     $this->currencyInfo = new Text2PayApi_Objects_CurrencyInfo($this->response['country']['currency']['@attributes']['symbol'], $this->response['country']['currency']['@attributes']['symbol_local'], $this->response['country']['currency']['@attributes']['prefix']);
     $this->supportNumber = $this->response['country']['support']['@attributes']['number'];
     $this->supportEmail = $this->response['country']['support']['@attributes']['email'];
     $this->terms = new Text2PayApi_getCountryInfo_TermsInfo($this->response['country']['terms']['campaign'][0], $this->response['country']['terms']['campaign'][1], $this->response['country']['terms']['campaign'][2]);
 }
Exemplo n.º 17
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->helpLine = $this->response['country']['@attributes']['helpline'];
 }
Exemplo n.º 18
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.3
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->campaignId = $this->response['campaign_id'];
     $this->brandId = $this->response['brand_id'];
     $this->applicationName = $this->response['application_name'];
     $this->supportNumber = $this->response['support_number'];
     $this->currencySymbol = $this->response['currency_symbol'];
     $this->suppressMessages = $this->response['suppress_messages'];
     $this->creditAmount = $this->response['credit_amount'];
     $this->pricePoint = $this->response['price_point'];
     $this->shortCode = $this->response['short_code'];
     $this->keywordInitialOptin = $this->fixEmptyArray($this->response['keyword_initialoptin']);
     $this->keywordSecondaryOptin = $this->fixEmptyArray($this->response['keyword_secondaryoptin']);
     $this->isSubscription = $this->response['is_subscription'];
     $this->messageFrequency = $this->fixEmptyArray($this->response['message_frequency']);
     $this->billingFrequency = $this->fixEmptyArray($this->response['billing_frequency']);
     $this->billingFrequencyName = $this->fixEmptyArray($this->response['billing_frequency_name']);
     $this->periodSuffix = $this->fixEmptyArray($this->response['period_suffix']);
     $this->enableMobileTracker = $this->response['enable_mobile_tracker'];
     $this->showSkipButton = $this->response['show_skip_button'];
     $this->header = $this->fixEmptyArray($this->response['header']);
     $this->termsFull = $this->fixEmptyArray($this->response['terms_full']);
     $this->moReachable = $this->response['mo_reachable'];
     $this->showConfiramtionDialog = $this->response['show_confirmation_dialog'];
     $this->confirmationText = $this->fixEmptyArray($this->response['confirmation_text']);
 }
Exemplo n.º 19
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.3
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->serviceId = $this->response['service_id'];
     $this->frequencyPeriod = $this->fixEmptyArray($this->response['frequency_period']);
     $this->shortCode = $this->response['short_code'];
     $this->countryCode = $this->response['country_code'];
     $this->chargeType = $this->response['charge_type'];
     $this->terms = $this->fixEmptyArray($this->response['terms']);
     $this->currencyPrefix = $this->response['currency_prefix'];
     $this->currencySymbol = $this->response['currency_symbol'];
     $this->languageCode = $this->response['language_code'];
     $this->supportNumber = $this->response['support_number'];
     $this->totalMessages = $this->response['total_messages'];
     $this->creditAmount = $this->response['credit_amount'];
     $this->creditTitle = $this->response['credit_title'];
     $temp = $this->fixEmptyArray($this->response['initialoptin']);
     if (!empty($temp)) {
         $this->initialOptin = new Text2PayApi_getServiceDetails_OptinInfo();
         $this->initialOptin->keyword = $temp['keyword'];
         $this->initialOptin->confirmationText = $temp['keyword'];
         $this->initialOptin->contentText = $temp['keyword'];
     } else {
         $this->initialOptin = null;
     }
     $temp = $this->fixEmptyArray($this->response['secondaryoptin']);
     if (!empty($temp)) {
         $this->secondaryOptin = new Text2PayApi_getServiceDetails_OptinInfo();
         $this->secondaryOptin->keyword = $temp['keyword'];
         $this->secondaryOptin->confirmationText = $temp['keyword'];
         $this->secondaryOptin->contentText = $temp['keyword'];
     } else {
         $this->secondaryOptin = null;
     }
     $temp = $this->fixEmptyArray($this->response['suppression']);
     if (!empty($temp)) {
         $this->suppression = new Text2PayApi_getServiceDetails_Suppression();
         $this->suppression->confirmationMt = $temp['confirmation_mt'];
         $this->suppression->contentMt = $temp['content_mt'];
     } else {
         $this->suppression = null;
     }
 }
Exemplo n.º 20
0
 /**
  * Creates a new instance of this response object, but this should not be
  * directly handled by enternal code, as the wrapper uses it to return more
  * accessible values from the Text2Pay API.
  *
  * @param string $raw The raw value from the API call response.
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function __construct($raw)
 {
     parent::__construct($raw);
     // Map all response data into this object
     $this->countryInfos = array();
     foreach ($this->fixXmlPhpArray($this->response['countries']['country']) as $co) {
         array_push($this->countryInfos, new Text2PayApi_getCountries_CountryInfo($co['@attributes']['code'], $co['@attributes']['title'], $co['@attributes']['title_local'], $co['@attributes']['continent_name'], $co['@attributes']['language_code'], $co['@attributes']['text_direction'], $co['@attributes']['network_lookup_available'], new Text2PayApi_Objects_CurrencyInfo($co['@attributes']['currency_symbol'], $co['@attributes']['currency_symbol_local'], $co['@attributes']['currency_prefix'])));
     }
 }