-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCanadaPostShipmentTracker.cs
45 lines (40 loc) · 1.64 KB
/
CanadaPostShipmentTracker.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Collections.Generic;
using Grand.Services.Shipping.Tracking;
namespace Grand.Plugin.Shipping.CanadaPost
{
public class CanadaPostShipmentTracker : IShipmentTracker
{
/// <summary>
/// Gets if the current tracker can track the tracking number.
/// </summary>
/// <param name="trackingNumber">The tracking number to track.</param>
/// <returns>True if the tracker can track, otherwise false.</returns>
public virtual bool IsMatch(string trackingNumber)
{
if (string.IsNullOrWhiteSpace(trackingNumber))
return false;
//What is a Canada Post tracking number format?
return false;
}
/// <summary>
/// Gets a url for a page to show tracking info (third party tracking page).
/// </summary>
/// <param name="trackingNumber">The tracking number to track.</param>
/// <returns>A url to a tracking page.</returns>
public virtual string GetUrl(string trackingNumber)
{
string url = "http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?trackingNumber={0}&LOCALE=en";
url = string.Format(url, trackingNumber);
return url;
}
/// <summary>
/// Gets all events for a tracking number.
/// </summary>
/// <param name="trackingNumber">The tracking number to track</param>
/// <returns>List of Shipment Events.</returns>
public virtual IList<ShipmentStatusEvent> GetShipmentEvents(string trackingNumber)
{
return new List<ShipmentStatusEvent>();
}
}
}