/** * Retrieves the support helpline for a particular country * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $countryCode International ISO-3166 country code * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $countryCode) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getHelpLine'); $this->setArgument('country_code', $countryCode); }
/** * Use this to retrieve a phone number (and carrier info) from a <i> * <a href="http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity">IMEI</a> * </i>, if previously registered in <a href="http://www.text2pay.com">Text2Pay</a> system. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param imei the device's <a href="http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity">IMEI</a>, * used by mobile services. * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.3 * */ public function __construct($apiConnection, $imei) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getMSISDN'); $this->setArgument('imei', $imei); }
/** * Validates a MSISDN (consumers phone number in E.164 format) to ensure * that the number is a valid MSISDN registered by the networks/carriers. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $countryCode International ISO-3166 country code * * @param int $msisdn Mobile consumers phone number in E.164 * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * @see Text2PayApi_initiateTransaction_Request * @see Text2PayApi_getServices_Request * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $countryCode, $msisdn) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'validateMSISDN'); $this->setArgument('country_code', $countryCode); $this->setArgument('msisdn', $msisdn); }
/** * Retrieves all the current services setup for the specified * brandId and countryCode. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $campaignId the campaign identification number * * @param string $countryCode International ISO-3166 country code * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $campaignId, $countryCode) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getServices'); $this->setArgument('campaign_id', $campaignId); $this->setArgument('country_code', $countryCode); }
/** * Retrieves terms and conditions for the specified countryCode. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $userId the user identification that is informed in the 'initiateTransaction' action * * @param int $transactionGroupId The transaction_group_id for the entire * transaction. A transaction_group_id will group all transaction_id's to * make up the complete transaction. Eg: A transaction may be made up of more * than 1 transaction_id (often the case for high price points) * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * * @since 0.7 * */ public function __construct($apiConnection, $userId, $transactionGroupId) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'processOptOut'); $this->setArgument('user_id', $userId); $this->setArgument('transaction_group_id', $transactionGroupId); }
/** * Spoofs (sends a fake) MO with the keyword specified to the short code * specified. Only to be used for valid API test numbers. * * Non test numbers will return an error. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $msisdn Mobile consumers phone number in E.164 * * @param string $shortCode The Shortcode where users reply to confirm purchases * * @param string $keyword They Keyword users send to confirm purchases (e.g. PAY) * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.2 * */ public function __construct($apiConnection, $msisdn, $shortCode, $keyword) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'spoofMO'); $this->setArgument('msisdn', $msisdn); $this->setArgument('short_code', $shortCode); $this->setArgument('keyword', $keyword); }
/** * Retrieves terms and conditions for the specified countryCode. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $countryCode International ISO-3166 country code * * @param string $outputType 'BRIEF' or 'FULL' * * @param string $purchaseType 'ONCEOFF' or 'SUBSCRIPTION' or 'DIRECTBILL' * * @param integer $serviceId Service identification, retrieved from * {@link Text2PayApi_getServices_Request}, which will include additional * info into the terms and conditions, if applicable. This argument is * OPTIONAL. * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $countryCode, $outputType, $purchaseType, $serviceId = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getTerms'); $this->setArgument('country_code', $countryCode); $this->setArgument('output_type', $outputType); $this->setArgument('purchase_type', $purchaseType); if (isset($serviceId)) { $this->setArgument('service_id', $serviceId); } }
/** * Retrieves all the available service details setup for the specified * brandId and countryCode. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/"> * https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $campaignId represents the identification number for the campaign, * created in the <a href="http://www.text2pay.com">Text2Pay</a> merchant system. * <br/> * Merchant brands are available at: * <a href="https://merchants.text2pay.com/setup/campaigns/"> * https://merchants.text2pay.com/setup/campaigns/</a> * <br/> * (you will need proper merchant credentials to access contents here) * * @param string carrierCode represents the mobile carrier code associated with the * <i>campaignId</i> and <i>countryCode</i>. You will need to rely on other API * calls to know this value, either {@link Text2PayApi_getServiceDetails_Request}. * * @param float pricePoint the price point amount for the <i>carrierCode</i>, which * defines the value in real currency that will be charged to the * end-user in his/her mobile bill. * Refer to available price points in a campaign at: * <a href="http://merchants.text2pay.com/integrate/campaign_info/"> * http://merchants.text2pay.com/integrate/campaign_info/</a> * <br/> * (you will need proper merchant credentials to access contents here) * * @param float creditAmount Amount of virtual currency or commodity type * to be awarded to the user. This is defined in the campaign setup. * Refer to the available values in your campaign setup, at: * <a href="https://merchants.text2pay.com/setup/campaigns/"> * https://merchants.text2pay.com/setup/campaigns/</a> * <br/> * (you will need proper merchant credentials to access contents here) * * @param boolean isSubscription defines if the payment in the campaign must be done * periodically (which is defined in Text2Pay merchant interface) or it is a * one time only (once-off) payment transaction. This is defined during the * campaign setup. * * @param float $creditAmount Amount of virtual currency or commodity type * to be awarded to the user * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.3 * */ public function __construct($apiConnection, $campaignId, $carrierCode, $pricePoint, $isSubscription, $creditAmount = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getServiceDetails'); $this->setArgument('campaign_id', $campaignId); $this->setArgument('carrier_code', $carrierCode); $this->setArgument('price_point', number_format((double) $pricePoint, 2, '.', '')); $this->setArgument('is_subscription', $isSubscription ? '1' : '0'); // Set optional arguments if applicable if (!empty($creditAmount)) { $this->setArgument('credit_amount', number_format((double) $creditAmount, 2, '.', '')); } }
/** * Initiate a new Once Off or Subscription transaction. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $serviceId Market & product identifier. This is a unique * number based on the carrier, price_point and purchase type. See * {@link Text2PayApi_getServices_Request} for details. * * @param int $msisdn Mobile consumers phone number in E.164 * (see {@link http://en.wikipedia.org/wiki/E.164} for details. * * @param string $consumerIdentity IP address of consumer (or unique * identifier of the users handset if in-app) * * @param int $creditAmount Amount of virtual currency or commodity type * to be awarded to the user * * @param string $transactionRef An opaque unique transaction reference * * @param float $pricePoint Price point of commodity user is purchasing * (Required for some DB confirmation type) * * @param string $zipCode Zip code of MSISDN billing address * (Required for some DB confirmation type) * * @param string $sessionId Session ID / Server Session string of the consumer * (Required for AT&T US PSMS PIN opt-in) * * @param string $browserUserAgent Browser User Agent string of the consumer * (Required for AT&T US PSMS PIN opt-in) * * @param string $thankyouUrl required for OP optin_method. This is where the * user will be redirected back too once they have completed the OP purchase * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $serviceId, $msisdn, $consumerIdentity, $creditAmount, $transactionRef = null, $pricePoint = null, $zipCode = null, $sessionId = null, $browserUserAgent = null, $thankyouUrl = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'initiateTransaction'); $this->setArgument('service_id', $serviceId); $this->setArgument('msisdn', $msisdn); $this->setArgument('consumer_id', $consumerIdentity); $this->setArgument('credit_amount', $creditAmount); // Set optional arguments if applicable if (!empty($transactionRef)) { $this->setArgument('trans_ref', $transactionRef); } if (!empty($pricePoint)) { $this->setArgument('price_point', number_format((double) $pricePoint, 2, '.', '')); } if (!empty($zipCode)) { $this->setArgument('zipcode', $zipCode); } if (!empty($sessionId)) { $this->setArgument('session_id', $sessionId); } if (!empty($browserUserAgent)) { $this->setArgument('browser_ua', $browserUserAgent); } if (!empty($thankyouUrl)) { $this->setArgument('thank_you_url', $thankyouUrl); } }
/** * Use this call to resend the user their confirmation message. * If you have setup your campaign to NOT send confirmation messages, * then this API action will return a failed result. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $serviceId Market & product identifier. This is a unique * number based on the carrier, price_point and purchase type. See * {@link Text2PayApi_getServices_Request} for details. * * @param int $transactionId first value of a transactionId * (also referred to as the parent transaction_id) from initiateTransaction * function. See {@link Text2PayApi_initiateTransaction_Request} for * details. * * @param int $transactionGroupId The transaction_group_id for the entire * transaction. A transaction_group_id will group all transaction_id's to * make up the complete transaction. Eg: A transaction may be made up of more * than 1 transaction_id (often the case for high price points) * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * @see Text2PayApi_initiateTransaction_Request * @see Text2PayApi_getServices_Request * * @author Braga, Bruno <*****@*****.**> * * @since 0.2 * */ public function __construct($apiConnection, $serviceId, $transactionId = null, $transactionGroupId = null) { parent::__construct($apiConnection); // As a rule, either of the optional values must be passed. if (!isset($transactionGroupId) && !isset($transactionId)) { throw new Text2PayException("Either the transactionGroupId or transactionId must be informed.", Text2PayException::LIB_ERROR_INVALID_ARG); } // Set remaining stuff for this action $this->setArgument('action', 'resendConfirmation'); $this->setArgument('service_id', $serviceId); if (isset($transactionGroupId)) { $this->setArgument('transaction_group_id', $transactionGroupId); } if (isset($transactionId)) { $this->setArgument('transaction_id', $transactionId); } }
/** * Use this call to check the current status of any given premium * transactionId or transactionRef (unique merchant transaction reference); * This will allow you to check instantly if a certain transaction has * been successfully billed, or if not - the reason it has failed. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $transactionGroupId The transaction_group_id for the entire * transaction. A transaction_group_id will group all transaction_id's to * make up the complete transaction. Eg: A transaction may be made up of more * than 1 transaction_id (often the case for high price points) * * @param int $transactionId first value of a transactionId * (also referred to as the parent transaction_id) from initiateTransaction * function. See {@link Text2PayApi_initiateTransaction_Request} for * details. * * @param string $transactionRef An opaque unique transaction reference * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * @see Text2PayApi_initiateTransaction_Request * @see Text2PayApi_getServices_Request * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $transactionGroupId = null, $transactionId = null, $transactionRef = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'checkTransactionStatus'); // As a rule, either of the optional values must be passed. if (!isset($transactionGroupId) && !isset($transactionId) && !isset($transactionRef)) { throw new Text2PayException("Either the transactionGroupId, transactionId or transactionRef must be informed.", Text2PayException::LIB_ERROR_INVALID_ARG); } if (isset($transactionGroupId)) { $this->setArgument('transaction_group_id', $transactionGroupId); } if (isset($transactionId)) { $this->setArgument('transaction_id', $transactionId); } if (isset($transactionRef)) { $this->setArgument('trans_ref', $transactionRef); } }
/** * Retrieves transaction records from Text2Pay database. * * <p> * Note: Due to performance reasons, such queries are cached in our system, and * query data volume and frequency rules may apply. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $campaignId the campaign identification * * @param int $from Start date of your report. Must be in format of YYYYMMDD * * @param int $to End date of your report. Must be in format of YYYYMMDD * * @param string $countryCode OPTIONAL International ISO-3166 country code * * @param string $reportStatusCode OPTIONAL Defines the outcome of the transaction. * Refer to {@link Text2PayApi_Constants_StatusCode} for valid values. * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.5 * */ public function __construct($apiConnection, $campaignId, $from, $to, $countryCode = null, $reportStatusCode = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getTransactionHistory'); $this->setArgument('campaign_id', $campaignId); $this->setArgument('from_date', $from); $this->setArgument('to_date', $to); // Set optional arguments if applicable if (!empty($countryCode)) { $this->setArgument('country_code', $countryCode); } if (!empty($reportStatusCode)) { $this->setArgument('report_status_code', $reportStatusCode); } }
/** * This action is used to confirm / validate if the PIN a user entered * matches the PIN sent to the user via the 'initiateTransaction' API action. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * @param Text2PayApi_Connection $apiConnection the connection object * * @param int $serviceId Market & product identifier. This is a unique * number based on the carrier, price_point and purchase type. See * {@link Text2PayApi_getServices_Request} for details. * * @param int $transactionGroupId The transaction_group_id for the entire * transaction. A transaction_group_id will group all transaction_id's to * make up the complete transaction. Eg: A transaction may be made up of * more than 1 transaction_id (often the case for high price points) * from initiateTransaction function. * See {@link Text2PayApi_initiateTransaction_Request} for details. * * @param int $pinCode Consumers PIN code that was sent to their handset. * Not required for MO transactions. * * @param int $messageNumber The message number of the PIN you wish to check. * Eg: 2 would specify you are checking the PIN of the 2nd PIN confirmation * MT sent to the user. Required for multiple PIN transactions * * @param int $messageCount The total number of PINs the user must enter * before the entire transaction is completed. Required for multiple PIN transactions * * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * @see Text2PayApi_initiateTransaction_Request * @see Text2PayApi_getServices_Request * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $serviceId, $transactionGroupId, $pinCode = null, $messageNumber = null, $messageCount = null) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'completeTransaction'); $this->setArgument('service_id', $serviceId); $this->setArgument('transaction_group_id', $transactionGroupId); if (isset($pinCode)) { $this->setArgument('pincode', $pinCode); } if (isset($messageNumber)) { $this->setArgument('message_number', $messageNumber); } if (isset($messageCount)) { $this->setArgument('message_count', $messageCount); } }
/** * Retrieves all active countries setup for the specified brand. * * Official documentation is available at: * <a href="https://merchants.text2pay.com/integrate/api_documentation/">https://merchants.text2pay.com/integrate/api_documentation/</a> * (you will need proper merchant credentials to access contents here) * * Example: * <code> * // Create a Text2Pay API connection * $cn = new Text2PayApi_Connection('apiKey', 1, 'username', 'password'); * * // Get campaign information * $campaignId = 1; * $o = new Text2PayApi_getCampaignInfo_Request($cn, $campaignId); * $resp = $o->execute(); * * // print results * print_r($resp); * * </code> * * @param Text2PayApi_Connection $apiConnection the connection object * * @param string $campaignId the campaign identification * @param string $countryCode OPTIONAL International ISO-3166 country code * @param string $internal if True, brings additional information that is * used by Text2Pay widget. * @throws Text2PayException if the connection is not a valid connection * (thrown by the base class {@link Text2PayApi_RequestBase}, or if * required arguments are not valid (thrown by * {@link Text2PayApi_RequestBase::setArgument()} method). * * @see Text2PayApi_RequestBase * @see Text2PayApi_RequestBase::setArgument() * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ public function __construct($apiConnection, $campaignId, $countryCode = null, $internal = false) { parent::__construct($apiConnection); // Set remaining stuff for this action $this->setArgument('action', 'getCampaignInfo'); $this->setArgument('campaign_id', $campaignId); if (!empty($countryCode)) { $this->setArgument('country_code', $countryCode); } if ($internal) { $this->setArgument('type', 'internal'); } }