@@ 753-769 (lines=17) @@ | ||
750 | * |
|
751 | * @return $this |
|
752 | */ |
|
753 | public function addWebsiteData($websiteUrl = null, $traffic_source = null, $affiliate_id = null) |
|
754 | { |
|
755 | if ($websiteUrl !== null && !is_string($websiteUrl)) { |
|
756 | throw new \InvalidArgumentException('Website URL must be string'); |
|
757 | } |
|
758 | if ($traffic_source !== null && !is_string($traffic_source)) { |
|
759 | throw new \InvalidArgumentException('Traffic source must be string'); |
|
760 | } |
|
761 | if ($affiliate_id !== null && !is_string($affiliate_id)) { |
|
762 | throw new \InvalidArgumentException('Affiliate ID must be string'); |
|
763 | } |
|
764 | ||
765 | $this->replace('website_url', $websiteUrl); |
|
766 | $this->replace('traffic_source', $traffic_source); |
|
767 | $this->replace('affiliate_id', $affiliate_id); |
|
768 | return $this; |
|
769 | } |
|
770 | ||
771 | /** |
|
772 | * Provides IP information for envelope |
|
@@ 1311-1331 (lines=21) @@ | ||
1308 | * |
|
1309 | * @return $this |
|
1310 | */ |
|
1311 | public function addProductData( |
|
1312 | $productQuantity = null, |
|
1313 | $productName = null, |
|
1314 | $productDescription = null |
|
1315 | ) { |
|
1316 | if ($productQuantity !== null && !is_int($productQuantity) && !is_float($productQuantity)) { |
|
1317 | throw new \InvalidArgumentException('Product quantity must be int or float'); |
|
1318 | } |
|
1319 | if ($productName !== null && !is_string($productName)) { |
|
1320 | throw new \InvalidArgumentException('Product name must be string'); |
|
1321 | } |
|
1322 | if ($productDescription !== null && !is_string($productDescription)) { |
|
1323 | throw new \InvalidArgumentException('Product description must be string'); |
|
1324 | } |
|
1325 | ||
1326 | $this->replace('product_quantity', $productQuantity); |
|
1327 | $this->replace('product_name', $productName); |
|
1328 | $this->replace('product_description', $productDescription); |
|
1329 | ||
1330 | return $this; |
|
1331 | } |
|
1332 | ||
1333 | /** |
|
1334 | * Provides payout information to envelope |