Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckoutPricing: Coupons #385

Merged
merged 45 commits into from
Nov 13, 2017
Merged

Commits on Nov 7, 2017

  1. Adds CheckoutPricing#coupon

    - Manages a single coupon on the item set
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    95a861e View commit details
    Browse the repository at this point in the history
  2. Adds CheckoutPricing discount calculations

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    e4c5f81 View commit details
    Browse the repository at this point in the history
  3. Updates recurly.coupon for new endpoint

    - /plans/:plan_code/coupons/:coupon_code -> /coupons/:id
    - optional `plan_id` as `plan`
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    f3be292 View commit details
    Browse the repository at this point in the history
  4. Removes component-type

    - Vestigial IE8 support
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    e26485d View commit details
    Browse the repository at this point in the history
  5. Updates coupon module structure

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    53b622b View commit details
    Browse the repository at this point in the history
  6. Updates CheckoutPricing for new coupon getter

    - Still WIP: need to determine API capabilities for plan-specific and plan-agnostic coupons
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    75af47d View commit details
    Browse the repository at this point in the history
  7. Updates coupon specs for new endpoint

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    0f84178 View commit details
    Browse the repository at this point in the history
  8. Adds recurly.pipedRequest

    - For spreading a long set request across multiple requests
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    c513752 View commit details
    Browse the repository at this point in the history
  9. Adds multiple plan code support to coupon getter

    - Uses pipedRequest to spread a large number of plans
    - Adds expectation for invoice-level coupon properties
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    2e73e2a View commit details
    Browse the repository at this point in the history
  10. Fixes argument syntax

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    b8df59c View commit details
    Browse the repository at this point in the history
  11. Updates CheckoutPricing coupon handler for new types

    - Supports discounts against adjustments, single subscriptions, and free trials
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    8503c99 View commit details
    Browse the repository at this point in the history
  12. Improves recurly.pipedRequest response handling

    - Ignores 404s until done
    - Immediately rejects other errors
    - Collects and concats array responses
    - Immediately resolves non-array responses
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    b75213f View commit details
    Browse the repository at this point in the history
  13. Adds spec plans

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    19f22f9 View commit details
    Browse the repository at this point in the history
  14. Updates SubscriptionPricing.coupon to receive objects

    - Avoids an extraneous API call when assigning a coupon to a subscription
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    adb4523 View commit details
    Browse the repository at this point in the history
  15. Fixes CheckoutPricing plan currency handling

    - CheckoutPricing must accept SubscriptionPricing instances before they are given plans
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    bd08d09 View commit details
    Browse the repository at this point in the history
  16. Fixes CheckoutPricing/Calculations sub calculation safety

    - Checks for a subscription price before adding it to the price, since price is not guaranteed to exist
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    712f670 View commit details
    Browse the repository at this point in the history
  17. Adds EmbeddedSubscriptionPricing

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    4430bb4 View commit details
    Browse the repository at this point in the history
  18. Fixes SubscriptionPricing reprice safety

    - Cehcks for plan presence
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    2a96fa2 View commit details
    Browse the repository at this point in the history
  19. Fixes CheckoutPricing/Calculations trial detection

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    06b62b8 View commit details
    Browse the repository at this point in the history
  20. Ensures subscription safety in CheckoutPricing/Calculations

    - Invalid subscriptions may exist on a CheckoutPricing
    - Excludes them when running checkout calculations
    - Stubs out Promise refactor in CheckoutPricing/Calculations
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    73b6e63 View commit details
    Browse the repository at this point in the history
  21. Applies Promise pattern to CheckoutPricing/Calculations

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    0fab807 View commit details
    Browse the repository at this point in the history
  22. Fixes checkout pricing free trial coupon application

    - Free trial coupons may restrict the plans they work with. This implements a subscription filter for that case
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    3860f7f View commit details
    Browse the repository at this point in the history
  23. Adds adjustment code uniqueness validator

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    fcb7da7 View commit details
    Browse the repository at this point in the history
  24. Adds reprice silence option

    - Prevents the change event from emitting.
    - Use this to prevent unwanted event looping
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    c1b7e07 View commit details
    Browse the repository at this point in the history
  25. Narrows scope of reprice event silencer

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    18eca38 View commit details
    Browse the repository at this point in the history
  26. Fixes itemization collector for checkouts with sub discounts

    - Subscription-level discounts on CheckoutPricing recomputs subscription prices. This resulted in duplicate entires in `price.now.items`
    - This defers final itemized list creation to later in the process
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    576644b View commit details
    Browse the repository at this point in the history
  27. Documentation

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    a04476b View commit details
    Browse the repository at this point in the history
  28. Cleans up unused variables

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    59008b8 View commit details
    Browse the repository at this point in the history
  29. Fixes CheckoutPricing/Calculations plan-specific discount filter

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    580312e View commit details
    Browse the repository at this point in the history
  30. Fixes coupon specs

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    b2181c8 View commit details
    Browse the repository at this point in the history
  31. Fixes SubscriptionPricing.reprice

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    2fff200 View commit details
    Browse the repository at this point in the history
  32. Adds coupon validity detection for new endpoint

    - /v1/coupons will return coupons which may not necessarily match the requested plan codes, if they may also apply to adjustments
    - this adds a validity detection method to SubscriptionPricing coupon getter
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    70b3b98 View commit details
    Browse the repository at this point in the history
  33. Fixes coupon fixtures

    - Compatible with new coupon validity checks
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    31a01ed View commit details
    Browse the repository at this point in the history
  34. Fixes coupon validity method safety

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    fbb652c View commit details
    Browse the repository at this point in the history
  35. Fixes pipedRequest for empty sets

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    dc8ecdf View commit details
    Browse the repository at this point in the history
  36. Fixes CheckoutPricing.coupon set and calculations

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    eb0f52f View commit details
    Browse the repository at this point in the history
  37. Adds CheckoutPricing.coupon specs

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    2aaa800 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2017

  1. Fixes CheckoutPricing fixed amount discount overrun

    - Also fixes setup fee exclusion rules for discounts
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    2c5c70d View commit details
    Browse the repository at this point in the history
  2. Fixes CheckoutPricing subscription coupon and gift card removal

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    8011207 View commit details
    Browse the repository at this point in the history
  3. Adds decimalize pass to CheckoutPricing

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    193bb94 View commit details
    Browse the repository at this point in the history
  4. Adds CheckoutPricing fixed amount discount soecs

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    2a15d81 View commit details
    Browse the repository at this point in the history
  5. Fixes CheckoutPricing free trial application reprice

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    1b8eb55 View commit details
    Browse the repository at this point in the history
  6. Fixes SubscriptionPricing fixed amount discounting of setup fees

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    2852800 View commit details
    Browse the repository at this point in the history
  7. Adds CheckoutPricing discount specs

    - Fixed amount coupons
    - subscription-level coupons
    - Free trial coupons
    
    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    1bbabe0 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2017

  1. Adds recurly.pipedRequest defaults

    Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
    chrissrogers committed Nov 9, 2017
    Configuration menu
    Copy the full SHA
    2362f17 View commit details
    Browse the repository at this point in the history