Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use shipping example in sandbox mode? #127

Closed
parthustad opened this issue Oct 27, 2016 · 5 comments
Closed

How to use shipping example in sandbox mode? #127

parthustad opened this issue Oct 27, 2016 · 5 comments

Comments

@parthustad
Copy link

How to use shipping example in sandbox mode?

@parthustad
Copy link
Author

https://onlinetools.ups.com/ups.app/xml/ShipConfirm

is this url for production mode or test mode?
i want to use api in test mode
can you please let me know where can i change?

@stefandoorn
Copy link
Contributor

Every class allows you to set a $useIntegration flag false/true on creating an object of it. You will find it if you take a look at the Shipping class constructor. Keep it at false and you will hit the integration server of UPS, setting it to true will connect to the production environment. The URL above is the production environment.

@cottton
Copy link

cottton commented Jan 8, 2020

Keep it at false and you will hit the integration server of UPS, setting it to true will connect to the production environment. The URL above is the production environment.

The other way around, isnt it?

$useIntegration = true; // test servers
if ($this->/*you method to check environment*/isProduction()) {
    $useIntegration = false; // production servers
}
$shipping = new \Ups\Shipping($accessKey, $userId, $password, $useIntegration);

@nomlas1
Copy link

nomlas1 commented Jan 9, 2022

Hello - I am doing essentially exactly what is described here, and yet I seem to be getting responses from the production environment. I can't see why that would be. Any suggestions would be much appreciated!

@nomlas1
Copy link

nomlas1 commented Jan 9, 2022

I'm still not sure why, but this does not work (I get the production URL):

$useIntegration = true;
$api = new Ups\Shipping($accessKey, $userId, $password, $useIntegration);

If however I add:

if($useIntegration){
$api->useIntegration=true;
}

Then I am able to get the sandbox URL. Perhaps this will help someone else. And perhaps someone can explain why the first case doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants