"must be 'id\\[ASC\\]' or 'id\\[DESC\\]'"
"must be 'cancel', 'pause' or 'resume'."
"must be 'active', 'cancelled', 'past_due', 'paused' or 'trialing'"
"paddle_list_subscriptions() works with valid inputs"
"paddle_update_subscription() validates and sends correct body"
"must be a list with `id` and `effective_from`"
"Each item must include at least `price_id`"
"required when updating items or next_billed_at"
"paddle_preview_subscription_update() validates and sends correct body"
"`on_resume` must be 'start_new_billing_period' or 'continue_billing_period'"
"`effective_from` must be one of: 'next_billing_period', 'immediately'"

paddle_list_subscriptions() works with valid inputs

test_that("paddle_list_transactions() validates inputs correctly", {
expect_error(paddle_list_transactions(order_by = "amount[ASC]"), "`order_by` must be one of")
expect_error(paddle_list_transactions(status = c("completed", "failed")), "`status` must be one of")
expect_error(paddle_list_transactions(include = c("customer", "bad_value")), "`include` must be one of")
expect_error(paddle_list_transactions(collection_mode = "bank_transfer"), "`collection_mode` must be one of")
expect_silent(paddle_list_transactions(per_page = 50, billed_at = "2023-04-18T17:03:26"))
test_that("paddle_create_transaction() validates inputs strictly", {
expect_error(paddle_create_transaction(NULL), "`items` must be a non-empty list")
expect_error(paddle_create_transaction(list(list(price_id = "pri_01jwqx23k0b5q42f9g71zjzby7", quantity = ""))),
"`quantity` in each item must be a positive number")
expect_error(paddle_create_transaction(list(list(price_id = "", quantity = 2))),
"`price_id` in each item must be a non-empty string")
items = list(list(price_id = "pri_01jwqx23k0b5q42f9g71zjzby7", quantity = 1)),
"`billing_details` is required when `collection_mode` is 'manual'"
"`currency_code` is required and must be one of: 'USD', 'EUR', 'GBP' when `collection_mode` is 'manual'"
items = list(list(price_id = "pri_01jx33y8mcbkhw0cfbdrq6kkdx", quantity = 2)),
test_that("paddle_update_transaction() handles include query and validation", {
test_that("paddle_preview_transaction() validates inputs and succeeds", {
good_items <- list(list(price_id = "pri_01jx33y8mcbkhw0cfbdrq6kkdx", quantity = 2))
expect_error(paddle_preview_transaction(items = NULL), "must be a non-empty list")
expect_error(paddle_preview_transaction(items = list()), "must be a non-empty list")
expect_error(paddle_preview_transaction(items = list(list(quantity = 1))), "price_id")
expect_error(paddle_preview_transaction(items = list(list(price_id = "x", quantity = 0))), "positive number")
expect_error(paddle_preview_transaction(items = good_items, currency_code = "JPY"), "must be one of")