private function buildPanEligibility($xml)
 {
     $panEligibility = new PanEligibility();
     $panEligibility->setRequestId((string) $xml->RequestId);
     $tmpSendingEligibility = new SendingEligibility();
     $sendingEligibility = $xml->SendingEligibility;
     $tmpSendingEligibility->setEligible((string) $sendingEligibility->Eligible);
     $tmpSendingEligibility->setReasonCode((string) $sendingEligibility->ReasonCode);
     $tmpSendingEligibility->setAccountNumber((string) $sendingEligibility->AccountNumber);
     $tmpSendingEligibility->setICA((string) $sendingEligibility->ICA);
     $tmpCurrency = new Currency();
     $currency = $sendingEligibility->Currency;
     $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
     $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
     $tmpCountry = new Country();
     $country = $sendingEligibility->Country;
     $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
     $tmpCountry->setNumericCountryCode((string) $country->NumericCountryCode);
     $tmpBrand = new Brand();
     $brand = $sendingEligibility->Brand;
     $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
     $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
     $tmpSendingEligibility->setCurrency($tmpCurrency);
     $tmpSendingEligibility->setCountry($tmpCountry);
     $tmpSendingEligibility->setBrand($tmpBrand);
     $panEligibility->setSendingEligibility($tmpSendingEligibility);
     $tmpReceivingEligibility = new ReceivingEligibility();
     $receivingEligibility = $xml->ReceivingEligibility;
     $tmpReceivingEligibility->setEligible((string) $receivingEligibility->Eligible);
     $tmpReceivingEligibility->setReasonCode((string) $receivingEligibility->ReasonCode);
     $tmpReceivingEligibility->setAccountNumber((string) $receivingEligibility->AccountNumber);
     $tmpReceivingEligibility->setICA((string) $receivingEligibility->ICA);
     $tmpCurrency = new Currency();
     $currency = $receivingEligibility->Currency;
     $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
     $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
     $tmpCountry = new Country();
     $country = $receivingEligibility->Country;
     $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
     $tmpCountry->setNumericCountryCode((string) $country->NumericCountryCode);
     $tmpBrand = new Brand();
     $brand = $receivingEligibility->Brand;
     $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
     $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
     $tmpReceivingEligibility->setCurrency($tmpCurrency);
     $tmpReceivingEligibility->setCountry($tmpCountry);
     $tmpReceivingEligibility->setBrand($tmpBrand);
     $panEligibility->setReceivingEligibility($tmpReceivingEligibility);
     return $panEligibility;
 }
Ejemplo n.º 2
0
 private function buildInquireMapping($xml)
 {
     $inquireMapping = new InquireMapping();
     $inquireMapping->setRequestId((string) $xml->RequestId);
     $mappings = new Mappings();
     $mappingArray = array();
     foreach ($xml->Mappings->Mapping as $mapping) {
         $tmpMapping = new Mapping();
         $tmpMapping->setMappingId((string) $mapping->MappingId);
         $tmpMapping->setSubscriberId((string) $mapping->SubscriberId);
         $tmpMapping->setAccountUsage((string) $mapping->AccountUsage);
         $tmpMapping->setDefaultIndicator((string) $mapping->DefaultIndicator);
         $tmpMapping->setAlias((string) $mapping->Alias);
         $tmpMapping->setICA((string) $mapping->ICA);
         $tmpMapping->setAccountNumber((string) $mapping->AccountNumber);
         $tmpCardholderFullName = new CardholderFullName();
         $cardholderFullName = $mapping->CardholderFullName;
         $tmpCardholderFullName->setCardholderFirstName((string) $cardholderFullName->CardholderFirstName);
         $tmpCardholderFullName->setCardholderMiddleName((string) $cardholderFullName->CardholderMiddleName);
         $tmpCardholderFullName->setCardholderLastName((string) $cardholderFullName->CardholderLastName);
         $tmpAddress = new Address();
         $address = $mapping->Address;
         $tmpAddress->setLine1((string) $address->line1);
         $tmpAddress->setLine2((string) $address->line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setCountrySubdivision((string) $address->CountrySubdivision);
         $tmpAddress->setPostalCode((string) $address->PostalCode);
         $tmpAddress->setCountry((string) $address->Country);
         $tmpReceivingEligibility = new ReceivingEligibility();
         $receivingEligibility = $mapping->ReceivingEligibility;
         $tmpReceivingEligibility->setEligible((string) $receivingEligibility->Eligible);
         $tmpCurrency = new Currency();
         $currency = $receivingEligibility->Currency;
         $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
         $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
         $tmpCountry = new Country();
         $country = $receivingEligibility->Country;
         $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
         $tmpCountry->setAlphaCountryCode((string) $country->NumericCountryCode);
         $tmpBrand = new Brand();
         $brand = $receivingEligibility->Brand;
         $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
         $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
         $tmpMapping->setExpiryDate((string) $mapping->ExpiryDate);
         $tmpReceivingEligibility->setCurrency($tmpCurrency);
         $tmpReceivingEligibility->setCountry($tmpCountry);
         $tmpReceivingEligibility->setBrand($tmpBrand);
         $tmpMapping->setCardholderFullName($tmpCardholderFullName);
         $tmpMapping->setAddress($tmpAddress);
         $tmpMapping->setReceivingEligibility($tmpReceivingEligibility);
         array_push($mappingArray, $tmpMapping);
     }
     $mappings->setMapping($mappingArray);
     $inquireMapping->setMappings($mappings);
     return $inquireMapping;
 }