@@ 602-618 (lines=17) @@ | ||
599 | * |
|
600 | * @return $this |
|
601 | */ |
|
602 | public function addWebsiteData($websiteUrl = null, $traffic_source = null, $affiliate_id = null) |
|
603 | { |
|
604 | if ($websiteUrl !== null && !is_string($websiteUrl)) { |
|
605 | throw new \InvalidArgumentException('Website URL must be string'); |
|
606 | } |
|
607 | if ($traffic_source !== null && !is_string($traffic_source)) { |
|
608 | throw new \InvalidArgumentException('Traffic source must be string'); |
|
609 | } |
|
610 | if ($affiliate_id !== null && !is_string($affiliate_id)) { |
|
611 | throw new \InvalidArgumentException('Affiliate ID must be string'); |
|
612 | } |
|
613 | ||
614 | $this->replace('website_url', $websiteUrl); |
|
615 | $this->replace('traffic_source', $traffic_source); |
|
616 | $this->replace('affiliate_id', $affiliate_id); |
|
617 | return $this; |
|
618 | } |
|
619 | ||
620 | /** |
|
621 | * Provides IP information for envelope |
|
@@ 1094-1114 (lines=21) @@ | ||
1091 | * |
|
1092 | * @return $this |
|
1093 | */ |
|
1094 | public function addProductData( |
|
1095 | $productQuantity = null, |
|
1096 | $productName = null, |
|
1097 | $productDescription = null |
|
1098 | ) { |
|
1099 | if ($productQuantity !== null && !is_int($productQuantity) && !is_float($productQuantity)) { |
|
1100 | throw new \InvalidArgumentException('Product quantity must be int or float'); |
|
1101 | } |
|
1102 | if ($productName !== null && !is_string($productName)) { |
|
1103 | throw new \InvalidArgumentException('Product name must be string'); |
|
1104 | } |
|
1105 | if ($productDescription !== null && !is_string($productDescription)) { |
|
1106 | throw new \InvalidArgumentException('Product description must be string'); |
|
1107 | } |
|
1108 | ||
1109 | $this->replace('product_quantity', $productQuantity); |
|
1110 | $this->replace('product_name', $productName); |
|
1111 | $this->replace('product_description', $productDescription); |
|
1112 | ||
1113 | return $this; |
|
1114 | } |
|
1115 | ||
1116 | /** |
|
1117 | * Provides payout information to envelope |