ebayapi 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/Rakefile +62 -61
- data/examples/end_item.rb +3 -1
- data/lib/ebay.rb +0 -7
- data/lib/ebay/api_methods.rb +8 -24
- data/lib/ebay/inflections.rb +1 -0
- data/lib/ebay/requests.rb +1 -3
- data/lib/ebay/requests/abstract.rb +5 -0
- data/lib/ebay/requests/fetch_token.rb +2 -0
- data/lib/ebay/requests/get_category_specifics.rb +23 -0
- data/lib/ebay/requests/get_item.rb +2 -0
- data/lib/ebay/requests/get_item_transactions.rb +2 -0
- data/lib/ebay/requests/get_order_transactions.rb +2 -0
- data/lib/ebay/requests/get_seller_transactions.rb +2 -0
- data/lib/ebay/requests/get_store.rb +2 -0
- data/lib/ebay/requests/place_offer.rb +3 -0
- data/lib/ebay/responses.rb +1 -3
- data/lib/ebay/responses/abstract.rb +3 -0
- data/lib/ebay/responses/fetch_token.rb +2 -0
- data/lib/ebay/responses/get_category_specifics.rb +16 -0
- data/lib/ebay/responses/get_ebay_details.rb +6 -0
- data/lib/ebay/schema/version.rb +1 -1
- data/lib/ebay/types.rb +3 -1
- data/lib/ebay/types/ad_format_enabled_code.rb +1 -0
- data/lib/ebay/types/{operation_type_code.rb → auth_token_type_code.rb} +3 -3
- data/lib/ebay/types/bot_block_request.rb +17 -0
- data/lib/ebay/types/bot_block_response.rb +19 -0
- data/lib/ebay/types/category_feature.rb +2 -0
- data/lib/ebay/types/category_item_specifics.rb +20 -0
- data/lib/ebay/types/category_listings_order_code.rb +2 -0
- data/lib/ebay/types/country_code.rb +3 -0
- data/lib/ebay/types/currency_code.rb +1 -0
- data/lib/ebay/types/detail_name_code.rb +2 -0
- data/lib/ebay/types/feature_definitions.rb +3 -0
- data/lib/ebay/types/feature_id_code.rb +1 -0
- data/lib/ebay/types/get_recommendations_response_container.rb +3 -0
- data/lib/ebay/types/item.rb +0 -2
- data/lib/ebay/types/item_specific_details.rb +21 -0
- data/lib/ebay/types/item_specific_source_code.rb +12 -0
- data/lib/ebay/types/item_specifics_enabled_code.rb +11 -0
- data/lib/ebay/types/item_specifics_enabled_definition.rb +13 -0
- data/lib/ebay/types/item_specifics_recommendations.rb +16 -0
- data/lib/ebay/types/motors_local_market_enabled_definition.rb +13 -0
- data/lib/ebay/types/name_value_list.rb +2 -0
- data/lib/ebay/types/notification_event_type_code.rb +1 -0
- data/lib/ebay/types/order.rb +0 -2
- data/lib/ebay/types/promotion_rule.rb +0 -5
- data/lib/ebay/types/recommendation_engine_code.rb +1 -0
- data/lib/ebay/types/search_sort_order_code.rb +2 -0
- data/lib/ebay/types/selling_manager_product_details.rb +8 -0
- data/lib/ebay/types/shipping_carrier_code.rb +5 -0
- data/lib/ebay/types/shipping_package_code.rb +12 -0
- data/lib/ebay/types/shipping_service_code.rb +72 -0
- data/lib/ebay/types/shipping_service_details.rb +10 -0
- data/lib/ebay/types/site_defaults.rb +2 -0
- data/lib/ebay/types/transaction.rb +6 -2
- data/lib/ebay/types/unit_of_measurement.rb +17 -0
- data/lib/ebay/types/unit_of_measurement_details.rb +16 -0
- data/lib/support/xml_mapping/money_node.rb +1 -1
- data/lib/support/xml_mapping/time_node.rb +2 -1
- data/rakefile +62 -61
- data/test/{unit → mapping}/class_definition_test.rb +1 -0
- data/test/{unit → mapping}/generate_from_xsd.rb +2 -0
- data/test/{unit → mapping}/mapping_subclass_test.rb +1 -0
- data/test/{unit → mapping}/node_test.rb +1 -0
- data/test/{unit → mapping}/template_test.rb +1 -0
- data/test/test_helper.rb +0 -9
- data/test/unit/xml_mapping_money_node_test.rb +8 -1
- metadata +22 -25
- data/lib/ebay/requests/get_category2_finance_offer.rb +0 -17
- data/lib/ebay/requests/get_finance_offers.rb +0 -17
- data/lib/ebay/requests/set_promotion_rules.rb +0 -18
- data/lib/ebay/responses/get_category2_finance_offer.rb +0 -18
- data/lib/ebay/responses/get_finance_offers.rb +0 -18
- data/lib/ebay/responses/set_promotion_rules.rb +0 -13
- data/lib/ebay/types/category_finance_offer.rb +0 -17
- data/lib/ebay/types/finance_offer.rb +0 -29
@@ -4,12 +4,14 @@ module Ebay # :nodoc:
|
|
4
4
|
# == Attributes
|
5
5
|
# text_node :name, 'Name', :optional => true
|
6
6
|
# text_node :value, 'Value', :optional => true
|
7
|
+
# text_node :source, 'Source', :optional => true
|
7
8
|
class NameValueList
|
8
9
|
include XML::Mapping
|
9
10
|
include Initializer
|
10
11
|
root_element_name 'NameValueList'
|
11
12
|
text_node :name, 'Name', :optional => true
|
12
13
|
text_node :value, 'Value', :optional => true
|
14
|
+
text_node :source, 'Source', :optional => true
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/ebay/types/order.rb
CHANGED
@@ -17,7 +17,6 @@ module Ebay # :nodoc:
|
|
17
17
|
# object_node :shipping_details, 'ShippingDetails', :class => ShippingDetails, :optional => true
|
18
18
|
# text_node :creating_user_role, 'CreatingUserRole', :optional => true
|
19
19
|
# time_node :created_time, 'CreatedTime', :optional => true
|
20
|
-
# text_node :finance_offer_id, 'FinanceOfferID', :optional => true
|
21
20
|
# value_array_node :payment_methods, 'PaymentMethods', :default_value => []
|
22
21
|
# text_node :seller_email, 'SellerEmail', :optional => true
|
23
22
|
# object_node :shipping_address, 'ShippingAddress', :class => Address, :optional => true
|
@@ -41,7 +40,6 @@ module Ebay # :nodoc:
|
|
41
40
|
object_node :shipping_details, 'ShippingDetails', :class => ShippingDetails, :optional => true
|
42
41
|
text_node :creating_user_role, 'CreatingUserRole', :optional => true
|
43
42
|
time_node :created_time, 'CreatedTime', :optional => true
|
44
|
-
text_node :finance_offer_id, 'FinanceOfferID', :optional => true
|
45
43
|
value_array_node :payment_methods, 'PaymentMethods', :default_value => []
|
46
44
|
text_node :seller_email, 'SellerEmail', :optional => true
|
47
45
|
object_node :shipping_address, 'ShippingAddress', :class => Address, :optional => true
|
@@ -1,10 +1,7 @@
|
|
1
|
-
require 'ebay/types/promoted_item'
|
2
1
|
|
3
2
|
module Ebay # :nodoc:
|
4
3
|
module Types # :nodoc:
|
5
4
|
# == Attributes
|
6
|
-
# array_node :promoted_items, 'PromotedItem', :class => PromotedItem, :default_value => []
|
7
|
-
# text_node :site_id, 'SiteID', :optional => true
|
8
5
|
# numeric_node :promoted_store_category_id, 'PromotedStoreCategoryID', :optional => true
|
9
6
|
# text_node :promoted_ebay_category_id, 'PromotedeBayCategoryID', :optional => true
|
10
7
|
# text_node :promoted_keywords, 'PromotedKeywords', :optional => true
|
@@ -18,8 +15,6 @@ module Ebay # :nodoc:
|
|
18
15
|
include XML::Mapping
|
19
16
|
include Initializer
|
20
17
|
root_element_name 'PromotionRule'
|
21
|
-
array_node :promoted_items, 'PromotedItem', :class => PromotedItem, :default_value => []
|
22
|
-
text_node :site_id, 'SiteID', :optional => true
|
23
18
|
numeric_node :promoted_store_category_id, 'PromotedStoreCategoryID', :optional => true
|
24
19
|
text_node :promoted_ebay_category_id, 'PromotedeBayCategoryID', :optional => true
|
25
20
|
text_node :promoted_keywords, 'PromotedKeywords', :optional => true
|
@@ -20,6 +20,8 @@ module Ebay # :nodoc:
|
|
20
20
|
SortByBidCountDesc = 'SortByBidCountDesc'
|
21
21
|
BestMatchSort = 'BestMatchSort'
|
22
22
|
BestMatchCategoryGroup = 'BestMatchCategoryGroup'
|
23
|
+
PricePlusShippingAsc = 'PricePlusShippingAsc'
|
24
|
+
PricePlusShippingDesc = 'PricePlusShippingDesc'
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -5,6 +5,10 @@ module Ebay # :nodoc:
|
|
5
5
|
# text_node :product_name, 'ProductName', :optional => true
|
6
6
|
# numeric_node :part_number, 'PartNumber', :optional => true
|
7
7
|
# text_node :product_part_number, 'ProductPartNumber', :optional => true
|
8
|
+
# text_node :product_id, 'ProductID', :optional => true
|
9
|
+
# text_node :custom_label, 'CustomLabel', :optional => true
|
10
|
+
# numeric_node :quantity_available, 'QuantityAvailable', :optional => true
|
11
|
+
# money_node :unit_cost, 'UnitCost', :optional => true
|
8
12
|
class SellingManagerProductDetails
|
9
13
|
include XML::Mapping
|
10
14
|
include Initializer
|
@@ -12,6 +16,10 @@ module Ebay # :nodoc:
|
|
12
16
|
text_node :product_name, 'ProductName', :optional => true
|
13
17
|
numeric_node :part_number, 'PartNumber', :optional => true
|
14
18
|
text_node :product_part_number, 'ProductPartNumber', :optional => true
|
19
|
+
text_node :product_id, 'ProductID', :optional => true
|
20
|
+
text_node :custom_label, 'CustomLabel', :optional => true
|
21
|
+
numeric_node :quantity_available, 'QuantityAvailable', :optional => true
|
22
|
+
money_node :unit_cost, 'UnitCost', :optional => true
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
@@ -10,6 +10,11 @@ module Ebay # :nodoc:
|
|
10
10
|
Hermes = 'Hermes'
|
11
11
|
ILoxx = 'iLoxx'
|
12
12
|
Other = 'Other'
|
13
|
+
ColiposteDomestic = 'ColiposteDomestic'
|
14
|
+
ColiposteInternational = 'ColiposteInternational'
|
15
|
+
Chronopost = 'Chronopost'
|
16
|
+
Correos = 'Correos'
|
17
|
+
Seur = 'Seur'
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -21,6 +21,18 @@ module Ebay # :nodoc:
|
|
21
21
|
Motorbikes = 'Motorbikes'
|
22
22
|
Caravan = 'Caravan'
|
23
23
|
IndustryVehicles = 'IndustryVehicles'
|
24
|
+
ParcelOrPaddedEnvelope = 'ParcelOrPaddedEnvelope'
|
25
|
+
SmallCanadaPostBox = 'SmallCanadaPostBox'
|
26
|
+
MediumCanadaPostBox = 'MediumCanadaPostBox'
|
27
|
+
LargeCanadaPostBox = 'LargeCanadaPostBox'
|
28
|
+
SmallCanadaPostBubbleMailer = 'SmallCanadaPostBubbleMailer'
|
29
|
+
MediumCanadaPostBubbleMailer = 'MediumCanadaPostBubbleMailer'
|
30
|
+
LargeCanadaPostBubbleMailer = 'LargeCanadaPostBubbleMailer'
|
31
|
+
PaddedBags = 'PaddedBags'
|
32
|
+
ToughBags = 'ToughBags'
|
33
|
+
ExpandableToughBags = 'ExpandableToughBags'
|
34
|
+
MailingBoxes = 'MailingBoxes'
|
35
|
+
Winepak = 'Winepak'
|
24
36
|
end
|
25
37
|
end
|
26
38
|
end
|
@@ -431,6 +431,78 @@ module Ebay # :nodoc:
|
|
431
431
|
USPSFirstClassMailInternational = 'USPSFirstClassMailInternational'
|
432
432
|
USPSPriorityMailInternational = 'USPSPriorityMailInternational'
|
433
433
|
USPSExpressMailInternational = 'USPSExpressMailInternational'
|
434
|
+
CHStandardInternational = 'CH_StandardInternational'
|
435
|
+
CHExpeditedInternational = 'CH_ExpeditedInternational'
|
436
|
+
CHSonstigerVersandSieheArtikelbeschreibung = 'CH_SonstigerVersandSieheArtikelbeschreibung'
|
437
|
+
TWStandardInternationalFixedRate = 'TW_StandardInternationalFixedRate'
|
438
|
+
TWExpeditedInternationalFixedRate = 'TW_ExpeditedInternationalFixedRate'
|
439
|
+
USPSGlobalExpressGuaranteed = 'USPSGlobalExpressGuaranteed'
|
440
|
+
AURegularWithInsurance = 'AU_RegularWithInsurance'
|
441
|
+
AUExpressWithInsurance = 'AU_ExpressWithInsurance'
|
442
|
+
DEDeutschePostWarensendungInternational = 'DE_DeutschePostWarensendungInternational'
|
443
|
+
DEDeutschePostByendung = 'DE_DeutschePostByendung'
|
444
|
+
DEHermesPaketUnversichertInternational = 'DE_HermesPaketUnversichertInternational'
|
445
|
+
DEHermesPaketVersichertInternational = 'DE_HermesPaketVersichertInternational'
|
446
|
+
DEILoxxTransportXXLInternational = 'DE_iLoxxTransportXXLInternational'
|
447
|
+
DEILoxxUbernachtExpressInternational = 'DE_iLoxxUbernachtExpressInternational'
|
448
|
+
DEILoxxStandardInternational = 'DE_iLoxxStandardInternational'
|
449
|
+
DEStandardInternational = 'DE_StandardInternational'
|
450
|
+
DEExpeditedInternational = 'DE_ExpeditedInternational'
|
451
|
+
ATBitteTreffenSieEineAuswahl = 'AT_BitteTreffenSieEineAuswahl'
|
452
|
+
ATEinschreibenVersandInklEinschreibengebuhr = 'AT_EinschreibenVersandInklEinschreibengebuhr'
|
453
|
+
ATNachnahmeVersandInklNachnahmegebuhr = 'AT_NachnahmeVersandInklNachnahmegebuhr'
|
454
|
+
ATExpressOrCourierInternational = 'AT_ExpressOrCourierInternational'
|
455
|
+
ATInsuredExpressOrCourierInternational = 'AT_InsuredExpressOrCourierInternational'
|
456
|
+
ATSpecialDispatchInternational = 'AT_SpecialDispatchInternational'
|
457
|
+
ATInsuredSpecialDispatchInternational = 'AT_InsuredSpecialDispatchInternational'
|
458
|
+
ATStandardInternational = 'AT_StandardInternational'
|
459
|
+
ATExpeditedInternational = 'AT_ExpeditedInternational'
|
460
|
+
ATOtherInternationalShipping = 'AT_OtherInternationalShipping'
|
461
|
+
CHBitteTreffenSieEineAuswahl = 'CH_BitteTreffenSieEineAuswahl'
|
462
|
+
CHUnversicherterVersand = 'CH_UnversicherterVersand'
|
463
|
+
CHVersicherterVersand = 'CH_VersicherterVersand'
|
464
|
+
CHEinschreibenVersandInklEinschreibengebuhr = 'CH_EinschreibenVersandInklEinschreibengebuhr'
|
465
|
+
CHNachnahmeVersandInklNachnahmegebuhr = 'CH_NachnahmeVersandInklNachnahmegebuhr'
|
466
|
+
CHExpressOrCourierInternational = 'CH_ExpressOrCourierInternational'
|
467
|
+
CHInsuredExpressOrCourierInternational = 'CH_InsuredExpressOrCourierInternational'
|
468
|
+
CHSonderversandZBSperrgutKFZ = 'CH_SonderversandZBSperrgutKFZ'
|
469
|
+
CHVersicherterSonderversandZBSperrgutKFZ = 'CH_VersicherterSonderversandZBSperrgutKFZ'
|
470
|
+
CHStandardversandAPostPriority = 'CH_StandardversandAPostPriority'
|
471
|
+
CHStandardversandBPostEconomy = 'CH_StandardversandBPostEconomy'
|
472
|
+
DEBitteTreffenSieEineAuswahl = 'DE_BitteTreffenSieEineAuswahl'
|
473
|
+
DEEinschreibenVersandInklEinschreibengebuhr = 'DE_EinschreibenVersandInklEinschreibengebuhr'
|
474
|
+
DENachnahmeVersandInklNachnahmegebuhr = 'DE_NachnahmeVersandInklNachnahmegebuhr'
|
475
|
+
DEExpressOrCourierInternational = 'DE_ExpressOrCourierInternational'
|
476
|
+
DEInsuredExpressOrCourierInternational = 'DE_InsuredExpressOrCourierInternational'
|
477
|
+
DESonderversandZBMobelKFZ = 'DE_SonderversandZBMobelKFZ'
|
478
|
+
DEVersicherterSonderversandZBMobelKFZ = 'DE_VersicherterSonderversandZBMobelKFZ'
|
479
|
+
DEDeutschePostBriefInternational = 'DE_DeutschePostBriefInternational'
|
480
|
+
IEStandardInternationalFlatRatePostage = 'IE_StandardInternationalFlatRatePostage'
|
481
|
+
IEExpeditedInternationalFlatRatePostage = 'IE_ExpeditedInternationalFlatRatePostage'
|
482
|
+
IEOtherInternationalPostage = 'IE_OtherInternationalPostage'
|
483
|
+
UKStandardInternationalFlatRatePostage = 'UK_StandardInternationalFlatRatePostage'
|
484
|
+
UKExpeditedInternationalFlatRatePostage = 'UK_ExpeditedInternationalFlatRatePostage'
|
485
|
+
UKOtherInternationalPostage = 'UK_OtherInternationalPostage'
|
486
|
+
FRChronopostChronoRelais = 'FR_ChronopostChronoRelais'
|
487
|
+
FRChrono10 = 'FR_Chrono10'
|
488
|
+
FRChrono13 = 'FR_Chrono13'
|
489
|
+
FRChrono18 = 'FR_Chrono18'
|
490
|
+
FRChronopostExpressInternational = 'FR_ChronopostExpressInternational'
|
491
|
+
Pickup = 'Pickup'
|
492
|
+
Delivery = 'Delivery'
|
493
|
+
CAPickup = 'CA_Pickup'
|
494
|
+
DEPickup = 'DE_Pickup'
|
495
|
+
AUPickup = 'AU_Pickup'
|
496
|
+
FRPickup = 'FR_Pickup'
|
497
|
+
ATPickup = 'AT_Pickup'
|
498
|
+
BENLPickup = 'BENL_Pickup'
|
499
|
+
BEFRPickup = 'BEFR_Pickup'
|
500
|
+
CHPickup = 'CH_Pickup'
|
501
|
+
ITPickup = 'IT_Pickup'
|
502
|
+
NLPickup = 'NL_Pickup'
|
503
|
+
PLPickup = 'PL_Pickup'
|
504
|
+
ESPickup = 'ES_Pickup'
|
505
|
+
SGDelivery = 'SG_Delivery'
|
434
506
|
end
|
435
507
|
end
|
436
508
|
end
|
@@ -10,6 +10,11 @@ module Ebay # :nodoc:
|
|
10
10
|
# numeric_node :shipping_time_max, 'ShippingTimeMax', :optional => true
|
11
11
|
# numeric_node :shipping_time_min, 'ShippingTimeMin', :optional => true
|
12
12
|
# text_node :shipping_service_code, 'ShippingServiceCode', :optional => true
|
13
|
+
# value_array_node :service_types, 'ServiceType', :default_value => []
|
14
|
+
# value_array_node :shipping_packages, 'ShippingPackage', :default_value => []
|
15
|
+
# boolean_node :dimensions_required, 'DimensionsRequired', 'true', 'false', :optional => true
|
16
|
+
# boolean_node :valid_for_selling_flow, 'ValidForSellingFlow', 'true', 'false', :optional => true
|
17
|
+
# boolean_node :surcharge_applicable, 'SurchargeApplicable', 'true', 'false', :optional => true
|
13
18
|
class ShippingServiceDetails
|
14
19
|
include XML::Mapping
|
15
20
|
include Initializer
|
@@ -22,6 +27,11 @@ module Ebay # :nodoc:
|
|
22
27
|
numeric_node :shipping_time_max, 'ShippingTimeMax', :optional => true
|
23
28
|
numeric_node :shipping_time_min, 'ShippingTimeMin', :optional => true
|
24
29
|
text_node :shipping_service_code, 'ShippingServiceCode', :optional => true
|
30
|
+
value_array_node :service_types, 'ServiceType', :default_value => []
|
31
|
+
value_array_node :shipping_packages, 'ShippingPackage', :default_value => []
|
32
|
+
boolean_node :dimensions_required, 'DimensionsRequired', 'true', 'false', :optional => true
|
33
|
+
boolean_node :valid_for_selling_flow, 'ValidForSellingFlow', 'true', 'false', :optional => true
|
34
|
+
boolean_node :surcharge_applicable, 'SurchargeApplicable', 'true', 'false', :optional => true
|
25
35
|
end
|
26
36
|
end
|
27
37
|
end
|
@@ -42,6 +42,7 @@ module Ebay # :nodoc:
|
|
42
42
|
# boolean_node :classified_ad_contact_by_email_enabled, 'ClassifiedAdContactByEmailEnabled', 'true', 'false', :optional => true
|
43
43
|
# boolean_node :safe_payment_required, 'SafePaymentRequired', 'true', 'false', :optional => true
|
44
44
|
# boolean_node :classified_ad_pay_per_lead_enabled, 'ClassifiedAdPayPerLeadEnabled', 'true', 'false', :optional => true
|
45
|
+
# text_node :item_specifics_enabled, 'ItemSpecificsEnabled', :optional => true
|
45
46
|
class SiteDefaults
|
46
47
|
include XML::Mapping
|
47
48
|
include Initializer
|
@@ -85,6 +86,7 @@ module Ebay # :nodoc:
|
|
85
86
|
boolean_node :classified_ad_contact_by_email_enabled, 'ClassifiedAdContactByEmailEnabled', 'true', 'false', :optional => true
|
86
87
|
boolean_node :safe_payment_required, 'SafePaymentRequired', 'true', 'false', :optional => true
|
87
88
|
boolean_node :classified_ad_pay_per_lead_enabled, 'ClassifiedAdPayPerLeadEnabled', 'true', 'false', :optional => true
|
89
|
+
text_node :item_specifics_enabled, 'ItemSpecificsEnabled', :optional => true
|
88
90
|
end
|
89
91
|
end
|
90
92
|
end
|
@@ -47,7 +47,9 @@ module Ebay # :nodoc:
|
|
47
47
|
# object_node :listing_checkout_redirect_preference, 'ListingCheckoutRedirectPreference', :class => ListingCheckoutRedirectPreference, :optional => true
|
48
48
|
# array_node :refunds, 'RefundArray', 'Refund', :class => Refund, :default_value => []
|
49
49
|
# text_node :transaction_site_id, 'TransactionSiteID', :optional => true
|
50
|
-
# text_node :
|
50
|
+
# text_node :platform, 'Platform', :optional => true
|
51
|
+
# text_node :cart_id, 'CartID', :optional => true
|
52
|
+
# boolean_node :seller_contact_buyer_by_email, 'SellerContactBuyerByEmail', 'true', 'false', :optional => true
|
51
53
|
class Transaction
|
52
54
|
include XML::Mapping
|
53
55
|
include Initializer
|
@@ -86,7 +88,9 @@ module Ebay # :nodoc:
|
|
86
88
|
object_node :listing_checkout_redirect_preference, 'ListingCheckoutRedirectPreference', :class => ListingCheckoutRedirectPreference, :optional => true
|
87
89
|
array_node :refunds, 'RefundArray', 'Refund', :class => Refund, :default_value => []
|
88
90
|
text_node :transaction_site_id, 'TransactionSiteID', :optional => true
|
89
|
-
text_node :
|
91
|
+
text_node :platform, 'Platform', :optional => true
|
92
|
+
text_node :cart_id, 'CartID', :optional => true
|
93
|
+
boolean_node :seller_contact_buyer_by_email, 'SellerContactBuyerByEmail', 'true', 'false', :optional => true
|
90
94
|
end
|
91
95
|
end
|
92
96
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Ebay # :nodoc:
|
3
|
+
module Types # :nodoc:
|
4
|
+
# == Attributes
|
5
|
+
# text_node :alternate_text, 'AlternateText', :optional => true
|
6
|
+
# text_node :suggested_text, 'SuggestedText', :optional => true
|
7
|
+
class UnitOfMeasurement
|
8
|
+
include XML::Mapping
|
9
|
+
include Initializer
|
10
|
+
root_element_name 'UnitOfMeasurement'
|
11
|
+
text_node :alternate_text, 'AlternateText', :optional => true
|
12
|
+
text_node :suggested_text, 'SuggestedText', :optional => true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'ebay/types/unit_of_measurement'
|
2
|
+
|
3
|
+
module Ebay # :nodoc:
|
4
|
+
module Types # :nodoc:
|
5
|
+
# == Attributes
|
6
|
+
# array_node :unit_of_measurements, 'UnitOfMeasurement', :class => UnitOfMeasurement, :default_value => []
|
7
|
+
class UnitOfMeasurementDetails
|
8
|
+
include XML::Mapping
|
9
|
+
include Initializer
|
10
|
+
root_element_name 'UnitOfMeasurementDetails'
|
11
|
+
array_node :unit_of_measurements, 'UnitOfMeasurement', :class => UnitOfMeasurement, :default_value => []
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
@@ -16,7 +16,7 @@ class MoneyNode < XML::Mapping::SingleAttributeNode
|
|
16
16
|
|
17
17
|
def set_attr_value(xml, value)
|
18
18
|
raise "Not a Money object: #{value}" unless Money === value
|
19
|
-
@amount_path.first(xml, :ensure_created => true).text = value.cents
|
19
|
+
@amount_path.first(xml, :ensure_created => true).text = sprintf("%.2f", value.cents.to_f / 100 )
|
20
20
|
@currency_path.first(xml, :ensure_created => true).text = value.currency
|
21
21
|
end
|
22
22
|
end
|
@@ -9,6 +9,7 @@ class TimeNode < XML::Mapping::SingleAttributeNode
|
|
9
9
|
end
|
10
10
|
def set_attr_value(xml, value) # :nodoc:
|
11
11
|
raise "Not a Time object: #{value}" unless value.is_a?(Time)
|
12
|
-
|
12
|
+
|
13
|
+
@path.first(xml,:ensure_created=>true).text = value.strftime("%Y-%m-%d %H:%M:%S")
|
13
14
|
end
|
14
15
|
end
|
data/rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rake/rdoctask'
|
|
6
6
|
require 'rake/gempackagetask'
|
7
7
|
require 'rake/contrib/rubyforgepublisher'
|
8
8
|
|
9
|
-
PKG_VERSION = "0.
|
9
|
+
PKG_VERSION = "0.11.0"
|
10
10
|
PKG_NAME = "ebayapi"
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
|
@@ -17,78 +17,80 @@ PKG_FILES = FileList[
|
|
17
17
|
response_dir = File.join(File.dirname(__FILE__), 'test', 'fixtures', 'responses')
|
18
18
|
|
19
19
|
desc "Default: Run all the unit tests"
|
20
|
-
task :default => [ :
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
task :default => [ 'test:units' ]
|
21
|
+
|
22
|
+
namespace :test do
|
23
|
+
desc 'Run all unit tests.'
|
24
|
+
Rake::TestTask.new(:units) do |t|
|
25
|
+
t.libs << "test"
|
26
|
+
t.pattern = 'test/unit/**/*_test.rb'
|
27
|
+
t.verbose = true
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Run all unit tests.'
|
31
|
+
Rake::TestTask.new(:mapping) do |t|
|
32
|
+
t.libs << "test"
|
33
|
+
t.pattern = 'test/mapping/**/*_test.rb'
|
34
|
+
t.verbose = true
|
35
|
+
end
|
27
36
|
end
|
28
37
|
|
29
38
|
desc "Delete tar.gz / zip / rdoc"
|
30
39
|
task :cleanup => [ :clobber_package, :clobber_rdoc ]
|
31
40
|
|
32
|
-
|
33
|
-
|
34
|
-
|
41
|
+
namespace :schema do
|
42
|
+
desc 'Get the latest version of the eBay XML schema'
|
43
|
+
task :update do
|
44
|
+
puts 'Updating the eBay schema'
|
35
45
|
|
36
|
-
|
37
|
-
|
46
|
+
folder = File.dirname(__FILE__) + "/lib/ebay/schema"
|
47
|
+
url = 'http://developer.ebay.com/webservices/latest/ebaySvc.xsd'
|
38
48
|
|
39
|
-
|
40
|
-
|
41
|
-
|
49
|
+
cd folder do
|
50
|
+
rm_f 'ebaySvc.xsd'
|
51
|
+
system("wget #{url}")
|
52
|
+
end
|
42
53
|
end
|
43
|
-
|
54
|
+
|
55
|
+
desc "Update the schema version"
|
56
|
+
task :update_version do
|
57
|
+
schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
|
58
|
+
# Update the schema version string
|
59
|
+
version = File.open(schema) do |f|
|
60
|
+
version_string = f.gets
|
61
|
+
version_string.match(/Version (\d+)/)
|
62
|
+
$1
|
63
|
+
end
|
44
64
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
rm_rf 'requests.rb'
|
51
|
-
rm_rf 'responses.rb'
|
52
|
-
rm_rf 'types.rb'
|
53
|
-
folders.each do |f|
|
54
|
-
cd f do
|
55
|
-
rm_rf '*.rb'
|
56
|
-
end
|
65
|
+
version_file_path = File.dirname(__FILE__) + "/lib/ebay/schema/version.rb"
|
66
|
+
version_file = File.read(version_file_path)
|
67
|
+
version_file.gsub!(/VERSION = \d+/, "VERSION = #{version}")
|
68
|
+
File.open(version_file_path, 'w') do |f|
|
69
|
+
f.puts version_file
|
57
70
|
end
|
58
71
|
end
|
59
|
-
|
60
|
-
|
61
|
-
desc "Generate Ruby classes from the schema and updates the schema version"
|
62
|
-
task :generate_classes_with_version => [:generate_classes, :update_schema_version]
|
63
|
-
|
64
|
-
desc "Generate Ruby classes from the schema file"
|
65
|
-
task :generate_classes => :clean_classes do
|
66
|
-
require 'ebay'
|
67
|
-
require 'ebay/schema/mapper'
|
68
|
-
%w(requests responses types).each do |dir|
|
69
|
-
folder = File.dirname(__FILE__) + "/lib/ebay/#{dir}"
|
70
|
-
Dir.mkdir(folder) unless File.directory?(folder)
|
71
|
-
end
|
72
|
-
schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
|
73
|
-
data = File.read(schema)
|
74
|
-
Ebay::Schema::XSD2eBay.run(data, File.dirname(__FILE__) + '/lib/ebay')
|
72
|
+
|
75
73
|
end
|
76
74
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
75
|
+
namespace :classes do
|
76
|
+
desc "Remove the generated Ruby classes"
|
77
|
+
task :cleanup do
|
78
|
+
FileList[
|
79
|
+
"lib/ebay/requests.rb", "lib/ebay/responses.rb", "lib/ebay/types.rb", "lib/ebay/requests/*.rb", "lib/ebay/responses/*.rb", "lib/ebay/types/*.rb"
|
80
|
+
].each{|f| rm_rf f }
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "Generate Ruby classes from the schema file and updates the schema version"
|
84
|
+
task :generate => [:cleanup, 'schema:update_version'] do
|
85
|
+
require 'ebay'
|
86
|
+
require 'ebay/schema/mapper'
|
87
|
+
%w(requests responses types).each do |dir|
|
88
|
+
folder = File.dirname(__FILE__) + "/lib/ebay/#{dir}"
|
89
|
+
Dir.mkdir(folder) unless File.directory?(folder)
|
90
|
+
end
|
91
|
+
schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
|
92
|
+
data = File.read(schema)
|
93
|
+
Ebay::Schema::XSD2eBay.run(data, File.dirname(__FILE__) + '/lib/ebay')
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -113,7 +115,6 @@ spec = Gem::Specification.new do |s|
|
|
113
115
|
s.email = "codyfauser@gmail.com"
|
114
116
|
s.homepage = "http://ebayapi.rubyforge.org"
|
115
117
|
s.add_dependency('xml-mapping', '>= 0.8.1')
|
116
|
-
s.add_dependency('activesupport', '>= 1.3.1')
|
117
118
|
s.add_dependency('money', '>= 1.7.1')
|
118
119
|
end
|
119
120
|
|