mirror of
https://github.com/therootcompany/paypal-checkout.js.git
synced 2025-05-13 17:46:42 +00:00
bugfix: test Product.list and set paging to max size
This commit is contained in:
parent
0b5e0ab292
commit
82d225cafc
@ -129,7 +129,7 @@ Product.create = async function _createProduct({
|
||||
};
|
||||
Product.list = async function _listProducts() {
|
||||
return await PayPal.request({
|
||||
url: "/v1/catalogs/products",
|
||||
url: "/v1/catalogs/products?page_size=20&total_required=true",
|
||||
json: true,
|
||||
})
|
||||
.then(must201or200)
|
||||
@ -210,8 +210,9 @@ Plan.create = async function _createPlan({
|
||||
};
|
||||
|
||||
Plan.list = async function _listPlans() {
|
||||
// TODO paging
|
||||
return await PayPal.request({
|
||||
url: "/v1/billing/plans",
|
||||
url: "/v1/billing/plans?page_size=20&total_required=true",
|
||||
json: true,
|
||||
})
|
||||
.then(must201or200)
|
||||
|
@ -14,7 +14,7 @@ let PayPal = require("../");
|
||||
let { Plan, Product, Subscription } = PayPal;
|
||||
|
||||
async function test() {
|
||||
let products = await Plan.list();
|
||||
let products = await Product.list();
|
||||
console.info();
|
||||
console.info("Products:");
|
||||
console.info(JSON.stringify(products, null, 2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user