I am trying to implement Web Shipping Javascript SDK for the first time. My credentials only work at ebay.shiprush.com and not my.shiprush.com.
This is my code:
In webpage:
Code:
<link href="https://ebay.shiprush.com/static.shiprush.com/ship.app/api/webshipping.integration.client.css" rel='stylesheet' type='text/css' />
<script src="https://ebay.shiprush.com/static.shiprush.com/ship.app/api/webshipping.integration.client.js"></script>
js:
Code:
function openShipRush(){
let shipment = {
ShipTo : {
Name: 'John Doe',
Address1: '1 Main St',
City: 'Cincinnati',
State: 'OH',
PostalCode: '45140',
Country: 'US',
Phone: '5131234567'
},
CarrierTypeName: "USPS",
ServiceTypeName: "USPSPriority",
Packages: [{
Weight: 1,
WeightOunces: 0,
Length: 4,
Width: 4,
Height: 4
}]
};
shipRushClient.Open(
{
//MyShipRushWebsite: 'ebay.shiprush.com',
Shipment: shipment,
OnShipmentCompleted: function (data) {
alert(data.Shipment.TrackingNumber);
// Return "true" to close shipping form
return true;
}
});
If I don't include MyShipRushWebsite: 'ebay.shiprush.com' in js and I log into ebay.shiprush.com before clicking button to trigger shipRushClient.Open, the shiprush web client works as expected. However, if I am not logged in to ebay.shiprush.com ahead of time, js will launch my.shiprush.com login. My eBay credentials do not work there. I thought I could resolve that by adding MyShipRushWebsite: 'ebay.shiprush.com' as shown in the code above. However, when I add that I get an error. In the console I see that my web application is trying to launch https://mywebsite.com/ebay.shiprush....adShipmentView. Note: Mywebsite is the URL of my web application that is trying to launch the shiprush web plugin. I believe that I need it to go to https://ebay.shiprush.com/ShipButton...adShipmentView, right?
Is this a CORS problem? Is CORS configured differently on my.shiprush.com than it is on ebay.shiprush.com? How can I get my Javascript to launch the ebay.shiprush.com login rather than my.shiprush.com?
Bookmarks