public function init($arr = null) { if ($arr != null) { foreach ($arr as $arry) { if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'receiverinfo') { $this->ReceiverInfo = new ReceiverInfoType(); $this->ReceiverInfo->init($arry["children"]); } } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'payerinfo') { $this->PayerInfo = new PayerInfoType(); $this->PayerInfo->init($arry["children"]); } } if ($arry != null && isset($arry['text']) && $arry['name'] == 'tplreferenceid') { $this->TPLReferenceID = $arry["text"]; } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'paymentinfo') { $this->PaymentInfo = new PaymentInfoType(); $this->PaymentInfo->init($arry["children"]); } } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'paymentiteminfo') { $this->PaymentItemInfo = new PaymentItemInfoType(); $this->PaymentItemInfo->init($arry["children"]); } } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'offercouponinfo') { $this->OfferCouponInfo = new OfferCouponInfoType(); $this->OfferCouponInfo->init($arry["children"]); } } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'secondaryaddress') { $this->SecondaryAddress = new AddressType(); $this->SecondaryAddress->init($arry["children"]); } } if (is_array($arry["children"]) && $arry["children"] != null) { if ($arry["name"] == 'userselectedoptions') { $this->UserSelectedOptions = new UserSelectedOptionType(); $this->UserSelectedOptions->init($arry["children"]); } } if ($arry != null && isset($arry['text']) && $arry['name'] == 'giftmessage') { $this->GiftMessage = $arry["text"]; } if ($arry != null && isset($arry['text']) && $arry['name'] == 'giftreceipt') { $this->GiftReceipt = $arry["text"]; } if ($arry != null && isset($arry['text']) && $arry['name'] == 'giftwrapname') { $this->GiftWrapName = $arry["text"]; } if (is_array($arry["attributes"]) && $arry["attributes"] != null) { if ($arry["name"] == 'giftwrapamount') { $tmp = array(); $atr = array(); foreach ($arry["attributes"] as $key => $val) { $atr[0]["name"] = $key; $atr[0]["text"] = $val; } $atr[1]["name"] = "value"; $atr[1]["text"] = $arry["text"]; $this->GiftWrapAmount = new BasicAmountType(); $this->GiftWrapAmount->init($atr); } } if ($arry != null && isset($arry['text']) && $arry['name'] == 'buyeremailoptin') { $this->BuyerEmailOptIn = $arry["text"]; } if ($arry != null && isset($arry['text']) && $arry['name'] == 'surveyquestion') { $this->SurveyQuestion = $arry["text"]; } } } }