コード例 #1
0
 /**
  * Convenience method to find a pricing field by name.
  *
  * @param fields pricing fields
  * @param fieldName name
  * @return found pricing field or null if no field found.
  */
 public static PricingField find(List<PricingField> fields, String fieldName) {
   if (fields != null) {
     for (PricingField field : fields) {
       if (field.getName().equals(fieldName)) return field;
     }
   }
   return null;
 }
コード例 #2
0
 public ValidatePurchaseWS validatePurchase(Integer userId, Integer itemId, PricingField[] fields)
     throws JbillingAPIException {
   try {
     return session.validatePurchase(userId, itemId, PricingField.setPricingFieldsValue(fields));
   } catch (Exception e) {
     throw new JbillingAPIException(e);
   }
 }
コード例 #3
0
 public ItemDTOEx getItem(Integer itemId, Integer userId, PricingField[] fields)
     throws JbillingAPIException {
   try {
     return session.getItem(itemId, userId, PricingField.setPricingFieldsValue(fields));
   } catch (Exception e) {
     throw new JbillingAPIException(e);
   }
 }
コード例 #4
0
 public OrderWS updateCurrentOrder(
     Integer userId,
     OrderLineWS[] lines,
     PricingField[] fields,
     Date date,
     String eventDescription)
     throws JbillingAPIException {
   try {
     return session.updateCurrentOrder(
         userId, lines, PricingField.setPricingFieldsValue(fields), date, eventDescription);
   } catch (Exception e) {
     throw new JbillingAPIException(e);
   }
 }
コード例 #5
0
 public ValidatePurchaseWS validateMultiPurchase(
     Integer userId, Integer[] itemIds, PricingField[][] fields) throws JbillingAPIException {
   try {
     String[] pricingFields = null;
     if (fields != null) {
       pricingFields = new String[fields.length];
       for (int i = 0; i < pricingFields.length; i++) {
         pricingFields[i] = PricingField.setPricingFieldsValue(fields[i]);
       }
     }
     return session.validateMultiPurchase(userId, itemIds, pricingFields);
   } catch (Exception e) {
     throw new JbillingAPIException(e);
   }
 }