wfpaisa / Fedex-latinoamerica

Webservices, tarifas para fedex php latinoamerica, pruebas con Colombia.
1 stars 1 forks source link

Problema de autenticación #1

Closed alangvara closed 8 years ago

alangvara commented 8 years ago

No he podido autenticarme correctamente ni con los datos de prueba ni con los propios, el error es el siguiente:

ERROR ERROR prof 1000 Authentication Failed ServiceAvailabilityRequest vacs 2 0 0

Los datos de configuración son:

$key = 'Z6AVzkmm7MEOacO9'; $password = 'OlSVHSRthKiQFcVmIuN0qI7jQ'; $account_number = '510087909'; $meter_number = '100259255'; // Origen $origenPostalCode = '45050'; // Envigado - Antioquia $origenPais = 'MX'; // Colombia // Destino $destinoPostalCode = '44100'; //Herndon TN $destinoPais = 'MX'; // Estados Unidos // Fecha $fecha = '2016-07-28'; // Fecha de la transacción // Url $url = 'https://ws.fedex.com:443/web-services'; // Tipo de envio - ver el readme para seleccionar el tipo de envio // tambien se puede ejecutar el archivo servicios-disponibles.php para // saber que tipo de envios estan disponibles $ServiceType = "INTERNATIONAL_ECONOMY"; // Ver en el Readme.md tipos de envio $PackagingType= "FEDEX_BOX"; // Ver en el Readme.md tipos de empaque $GroupPackageCount = '1'; //Numero de paquetes $WeightTipo = 'LB'; //Peso unidad de medida $WeightValue= '1'; // Peso valor $Units= 'IN'; // tamaño unidad de medida (IN)pulgadas (cm)centimetros $Length ='1'; // largo $Width = '1'; // ancho $Height = '1'; // Alto

wfpaisa commented 8 years ago

Hola, alangvara voy a revisar con los datos que tengo en local y te escribo si aun esta funcionando, esque estos ejemplos los hice hace un tiempo y fedex cambia constantemente

wfpaisa commented 8 years ago

Verifica tus datos:

$key = 'Z6AVzkmm7MEOacO9';
$password = 'OlSVHSRthKiQFcVmIuN0qI7jQ';
$account_number = '510087909';
$meter_number = '100259255';

Acabo de probar y me funciona con la siguiente configuración:

<?php
$key = 'XXXX';
$password = 'XXX';
$account_number = '668972764';
$meter_number = '108206788';

// Origen
$origenPostalCode = '055420'; // Envigado - Antioquia
$origenPais = 'CO'; // Colombia

// Destino
$destinoPostalCode = '20171'; //Herndon TN
$destinoPais = 'US'; // Estados Unidos

$destinoPostalCode = '75001'; //Herndon TN
$destinoPais = 'FR'; // Estados Unidos

// Fecha
$fecha = '2015-07-28'; // Fecha de la transacción

// Url
$url = 'https://ws.fedex.com:443/web-services';

// Tipo de envio - ver el readme para seleccionar el tipo de envio
// tambien se puede ejecutar el archivo servicios-disponibles.php para
// saber que tipo de envios estan disponibles
$ServiceType = "INTERNATIONAL_ECONOMY"; // Ver en el Readme.md tipos de envio
$PackagingType= "YOUR_PACKAGING"; // Ver en el Readme.md tipos de empaque

$GroupPackageCount = '1'; //Numero de paquetes

$WeightTipo = 'LB'; //Peso unidad de medida
$WeightValue= '1'; // Peso valor

$Units= 'IN'; // tamaño unidad de medida (IN)pulgadas (cm)centimetros
$Length ='1'; // largo
$Width = '1'; // ancho
$Height = '1'; // Alto

?>
wfpaisa commented 8 years ago

examples/tarifa.php retorna algo como:

155014.0

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [xmlnsSOAPENV] => http//schemas.xmlsoap.org/soap/envelope/
        )

    [SOAPENVHeader] => SimpleXMLElement Object
        (
        )

    [SOAPENVBody] => SimpleXMLElement Object
        (
            [RateReply] => SimpleXMLElement Object
                (
                    [HighestSeverity] => SUCCESS
                    [Notifications] => SimpleXMLElement Object
                        (
                            [Severity] => SUCCESS
                            [Source] => crs
                            [Code] => 0
                            [Message] => Request was successfully processed. 
                            [LocalizedMessage] => Request was successfully processed. 
                        )

                    [TransactionDetail] => SimpleXMLElement Object
                        (
                            [CustomerTransactionId] =>  *** Rate Request v14 using PHP ***
                        )

                    [Version] => SimpleXMLElement Object
                        (
                            [ServiceId] => crs
                            [Major] => 14
                            [Intermediate] => 0
                            [Minor] => 0
                        )

                    [RateReplyDetails] => SimpleXMLElement Object
                        (
                            [ServiceType] => INTERNATIONAL_ECONOMY
                            [PackagingType] => YOUR_PACKAGING
                            [DeliveryStation] => TNFA 
                            [DeliveryDayOfWeek] => THU
                            [DeliveryTimestamp] => 20160128T180000
                            [CommitDetails] => SimpleXMLElement Object
                                (
                                    [CommodityName] => DOCUMENTS
                                    [ServiceType] => INTERNATIONAL_ECONOMY
                                    [CommitTimestamp] => 20160128T180000
                                    [DayOfWeek] => THU
                                    [DestinationServiceArea] => A1
                                    [BrokerToDestinationDays] => 0
                                    [CommitMessages] => SimpleXMLElement Object
                                        (
                                            [Code] => 134
                                            [Message] => REQUEST COMPLETED
                                        )

                                    [DeliveryMessages] =>  600 P.M. IF NO CUSTOMS DELAY
                                    [DocumentContent] => DOCUMENTS_ONLY
                                    [RequiredDocuments] => INTERNATIONAL_AIRWAY_BILL
                                )

                            [DestinationAirportId] => CDG
                            [IneligibleForMoneyBackGuarantee] => false
                            [OriginServiceArea] => AA
                            [DestinationServiceArea] => A1
                            [SignatureOption] => SERVICE_DEFAULT
                            [ActualRateType] => PAYOR_ACCOUNT_SHIPMENT
                            [RatedShipmentDetails] => Array
                                (
                                    [0] => SimpleXMLElement Object
                                        (
                                            [ShipmentRateDetail] => SimpleXMLElement Object
                                                (
                                                    [RateType] => PAYOR_ACCOUNT_SHIPMENT
                                                    [RateScale] => 0000001
                                                    [RateZone] => CO001O
                                                    [PricingCode] => ACTUAL
                                                    [RatedWeightMethod] => ACTUAL
                                                    [CurrencyExchangeRate] => SimpleXMLElement Object
                                                        (
                                                            [FromCurrency] => USD
                                                            [IntoCurrency] => COP
                                                            [Rate] => 3297.46
                                                        )

                                                    [DimDivisor] => 0
                                                    [FuelSurchargePercent] => 3.5
                                                    [TotalBillingWeight] => SimpleXMLElement Object
                                                        (
                                                            [Units] => LB
                                                            [Value] => 1.0
                                                        )

                                                    [TotalBaseCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 249618.0
                                                        )

                                                    [TotalFreightDiscounts] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 99847.0
                                                        )

                                                    [TotalNetFreight] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 149771.0
                                                        )

                                                    [TotalSurcharges] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 5243.0
                                                        )

                                                    [TotalNetFedExCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 155014.0
                                                        )

                                                    [TotalTaxes] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 0.0
                                                        )

                                                    [TotalNetCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 155014.0
                                                        )

                                                    [TotalRebates] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 0.0
                                                        )

                                                    [TotalNetChargeWithDutiesAndTaxes] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => COP
                                                            [Amount] => 155014.0
                                                        )

                                                    [FreightDiscounts] => SimpleXMLElement Object
                                                        (
                                                            [RateDiscountType] => VOLUME
                                                            [Description] => Volume
                                                            [Amount] => SimpleXMLElement Object
                                                                (
                                                                    [Currency] => COP
                                                                    [Amount] => 99847.0
                                                                )

                                                            [Percent] => 40.0
                                                        )

                                                    [Surcharges] => SimpleXMLElement Object
                                                        (
                                                            [SurchargeType] => FUEL
                                                            [Description] => Fuel
                                                            [Amount] => SimpleXMLElement Object
                                                                (
                                                                    [Currency] => COP
                                                                    [Amount] => 5243.0
                                                                )

                                                        )

                                                )

                                        )

                                    [1] => SimpleXMLElement Object
                                        (
                                            [ShipmentRateDetail] => SimpleXMLElement Object
                                                (
                                                    [RateType] => RATED_ACCOUNT_SHIPMENT
                                                    [RateScale] => 0000001
                                                    [RateZone] => CO001O
                                                    [PricingCode] => ACTUAL
                                                    [RatedWeightMethod] => ACTUAL
                                                    [CurrencyExchangeRate] => SimpleXMLElement Object
                                                        (
                                                            [FromCurrency] => USD
                                                            [IntoCurrency] => USD
                                                            [Rate] => 1.0
                                                        )

                                                    [DimDivisor] => 0
                                                    [FuelSurchargePercent] => 3.5
                                                    [TotalBillingWeight] => SimpleXMLElement Object
                                                        (
                                                            [Units] => LB
                                                            [Value] => 1.0
                                                        )

                                                    [TotalBaseCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 75.7
                                                        )

                                                    [TotalFreightDiscounts] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 30.28
                                                        )

                                                    [TotalNetFreight] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 45.42
                                                        )

                                                    [TotalSurcharges] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 1.59
                                                        )

                                                    [TotalNetFedExCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 47.01
                                                        )

                                                    [TotalTaxes] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 0.0
                                                        )

                                                    [TotalNetCharge] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 47.01
                                                        )

                                                    [TotalRebates] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 0.0
                                                        )

                                                    [TotalNetChargeWithDutiesAndTaxes] => SimpleXMLElement Object
                                                        (
                                                            [Currency] => USD
                                                            [Amount] => 47.01
                                                        )

                                                    [Surcharges] => SimpleXMLElement Object
                                                        (
                                                            [SurchargeType] => FUEL
                                                            [Description] => Fuel
                                                            [Amount] => SimpleXMLElement Object
                                                                (
                                                                    [Currency] => USD
                                                                    [Amount] => 1.59
                                                                )

                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

)

tarifas.php en la linea 60 contiene el valor:

// Moneda local
print $result->SOAPENVBody->RateReply->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount;