Package com.bring.api

Examples of com.bring.api.BringService


public class ShippingGuideExample {
    public ShippingGuideExample() throws RequestFailedException {

        // Initialize library
        String clientId = "www.mywebshop.com";
        BringService bringService = new BringService(clientId);

        // Prepare query
        Package packet = new Package();
        packet.withWeightInGrams("4233");

        Shipment shipment = new Shipment();
        shipment.withFromPostalCode("1409");
        shipment.withToPostalCode("7050");
        shipment.addPackage(packet);
        shipment.addProduct(ProductType.SERVICEPAKKE);

        // Fetch price information from Bring
        ShippingGuideResult shippingGuideResult = bringService.queryShippingGuide(shipment, QueryType.PRICE);
        String amountWithVAT = shippingGuideResult
            .getProduct(ProductType.SERVICEPAKKE)
            .getPrice()
            .getPackagePriceWithoutAdditionalServices()
            .getAmountWithVAT();
View Full Code Here


public class TrackingExample {
    public TrackingExample() throws RequestFailedException{
     
        // Initialize library
        String clientId = "www.mywebshop.com";
        BringService bringService = new BringService(clientId);

        //Prepare query
        TrackingQuery query = new TrackingQuery();
        query.withQueryNumber("1234567");

        //Fetch Tracking information from Bring
        TrackingResult trackingResult = bringService.queryTracking(query);
        String totalWeight = trackingResult.getConsignment(0)
            .getTotalWeight()
            .getValue();

        //Display result
View Full Code Here

public class ShippingGuideExample {
    public ShippingGuideExample() throws RequestFailedException {

        // Initialize library
        String clientId = "www.mywebshop.com";
        BringService bringService = new BringService(clientId);

        // Prepare query
        Package packet = new Package();
        packet.withWeightInGrams("4233");
        Shipment shipment = new Shipment();
        shipment.withFromPostalCode("1409");
        shipment.withToPostalCode("7050");
        shipment.addPackage(packet);
        shipment.addProduct(ProductType.SERVICEPAKKE);

        // Fetch price information from Bring
        ShippingGuideResult shippingGuideResult = bringService.queryShippingGuide(shipment, QueryType.PRICE);
        String amountWithVAT = shippingGuideResult
            .getProduct(ProductType.SERVICEPAKKE)
            .getPrice()
            .getPackagePriceWithoutAdditionalServices()
            .getAmountWithVAT();
View Full Code Here

TOP

Related Classes of com.bring.api.BringService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.