bugfix: test Product.list and set paging to max size

This commit is contained in:
AJ ONeal 2021-10-11 18:30:05 -06:00
parent 0b5e0ab292
commit 82d225cafc
2 changed files with 4 additions and 3 deletions

View File

@ -129,7 +129,7 @@ Product.create = async function _createProduct({
}; };
Product.list = async function _listProducts() { Product.list = async function _listProducts() {
return await PayPal.request({ return await PayPal.request({
url: "/v1/catalogs/products", url: "/v1/catalogs/products?page_size=20&total_required=true",
json: true, json: true,
}) })
.then(must201or200) .then(must201or200)
@ -210,8 +210,9 @@ Plan.create = async function _createPlan({
}; };
Plan.list = async function _listPlans() { Plan.list = async function _listPlans() {
// TODO paging
return await PayPal.request({ return await PayPal.request({
url: "/v1/billing/plans", url: "/v1/billing/plans?page_size=20&total_required=true",
json: true, json: true,
}) })
.then(must201or200) .then(must201or200)

View File

@ -14,7 +14,7 @@ let PayPal = require("../");
let { Plan, Product, Subscription } = PayPal; let { Plan, Product, Subscription } = PayPal;
async function test() { async function test() {
let products = await Plan.list(); let products = await Product.list();
console.info(); console.info();
console.info("Products:"); console.info("Products:");
console.info(JSON.stringify(products, null, 2)); console.info(JSON.stringify(products, null, 2));