Package com.google.api.ads.dfp.jaxws.v201211

Examples of com.google.api.ads.dfp.jaxws.v201211.Money


        lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
        lineItem.setEndDateTime(DateTimeUtils.fromString("2012-09-01T00:00:00"));

        // Set the cost per unit to $2.
        lineItem.setCostType(CostType.CPM);
        lineItem.setCostPerUnit(new Money("USD", 2000000L));

        // Set the number of units bought to 500,000 so that the budget is
        // $1,000.
        lineItem.setUnitsBought(500000L);
        lineItem.setUnitType(UnitType.IMPRESSIONS);
View Full Code Here


      lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
      lineItem.setEndDateTime(DateTimeUtils.fromString("2012-09-01T00:00:00"));

      // Set the cost per unit to $2.
      lineItem.setCostType(CostType.CPM);
      lineItem.setCostPerUnit(new Money("USD", 2000000L));

      // Set the number of units bought to 500,000 so that the budget is
      // $1,000.
      lineItem.setUnitsBought(500000L);
      lineItem.setUnitType(UnitType.IMPRESSIONS);
View Full Code Here

      lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
      lineItem.setEndDateTime(DateTimeUtils.fromString("2013-09-01T00:00:00"));

      // Set the cost per day to $1.
      lineItem.setCostType(CostType.CPD);
      lineItem.setCostPerUnit(new Money("USD", 1000000L));

      // Set the percentage to be 100%.
      lineItem.setUnitsBought(100L);

      // Create the line item on the server.
View Full Code Here

        lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
        lineItem.setEndDateTime(DateTimeUtils.fromString("2012-09-01T00:00:00"));

        // Set the cost per unit to $2.
        lineItem.setCostType(CostType.CPM);
        lineItem.setCostPerUnit(new Money("USD", 2000000L));

        // Set the number of units bought to 500,000 so that the budget is
        // $1,000.
        lineItem.setUnitsBought(500000L);
        lineItem.setUnitType(UnitType.IMPRESSIONS);
View Full Code Here

      lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
      lineItem.setEndDateTime(DateTimeUtils.fromString("2013-09-01T00:00:00"));

      // Set the cost per day to $1.
      lineItem.setCostType(CostType.CPD);
      lineItem.setCostPerUnit(new Money("USD", 1000000L));

      // Set the percentage to be 100%.
      lineItem.setUnitsBought(100L);

      // Create the line item on the server.
View Full Code Here

      lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
      lineItem.setEndDateTime(DateTimeUtils.fromString("2012-09-01T00:00:00"));

      // Set the cost per unit to $2.
      lineItem.setCostType(CostType.CPM);
      lineItem.setCostPerUnit(new Money("USD", 2000000L));

      // Set the number of units bought to 500,000 so that the budget is
      // $1,000.
      lineItem.setUnitsBought(500000L);
      lineItem.setUnitType(UnitType.IMPRESSIONS);
View Full Code Here

   * @param amount Numeric amount to charge the customer.
   * @param currency 3-letter ISO-4217 currency code: USD, JPY, GBP
   */
  public Document chargeOrder(String orderNumber, float amount, String currency)
      throws ProtocolException {
    Money money = createMoney(amount, currency);
    ChargeOrderRequest chargeReq = _objectFact.createChargeOrderRequest();
    chargeReq.setGoogleOrderNumber(orderNumber);
    chargeReq.setAmount(money);
    JAXBElement<ChargeOrderRequest> elem
        = _objectFact.createChargeOrder(chargeReq);
View Full Code Here

   
    RefundOrderRequest refundRequest = _objectFact.createRefundOrderRequest();
    refundRequest.setGoogleOrderNumber(orderNumber);
    refundRequest.setReason(reason);
    if (amount > 0.0F && !StringUtil.isEmpty(currency)) {
      Money refundAmount = createMoney(amount, currency);
      refundRequest.setAmount(refundAmount);
    }
   
    JAXBElement<RefundOrderRequest> refundOrder
        = _objectFact.createRefundOrder(refundRequest);
View Full Code Here

   */
  public Item createShoppingItem(String itemName, String itemDesc,
      int quantity, float unitPrice, String currency,
      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
    Money money = createMoney(unitPrice, currency);
    Item item = _objectFact.createItem();
    item.setItemName(itemName);
    item.setItemDescription(itemDesc);
    item.setQuantity(quantity);
    item.setUnitPrice(money);
View Full Code Here

      throws ProtocolException {
    if (price < 0.0d) {
      throw new ProtocolException("price cannot be negative");
    }
   
    Money money = _objectFact.createMoney();
    BigDecimal bigNum = new BigDecimal(price);
    bigNum = bigNum.setScale(2, RoundingMode.HALF_EVEN);
    money.setValue(bigNum);
    if (!StringUtil.isEmpty(currency)) {
      money.setCurrency(currency);
    } else {
      money.setCurrency("USD");
    }
    return money;
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.jaxws.v201211.Money

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.