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

Несоответствие в JSDOC #43

Open
ZakharYA opened this issue Oct 30, 2020 · 0 comments
Open

Несоответствие в JSDOC #43

ZakharYA opened this issue Oct 30, 2020 · 0 comments

Comments

@ZakharYA
Copy link

ZakharYA commented Oct 30, 2020

В функции createBill несоответствующая JSDOC.

/**
* Creating bill
*
* @param {(string|number)} billId The bill identifier
* @param {Object} params The parameters
* @param {(string|number)} params.amount The amount
* @param {string} params.currency The currency
* @param {string} [params.comment] The bill comment
* @param {string} params.expirationDateTime The bill expiration datetime (ISOstring)
* @param {Object} [params.customFields] The bill custom fields
* @param {Object} [params.extra] The bill custom fields (deprecated, will be removed soon)
* @param {string} params.phone The phone
* @param {string} params.email The email
* @param {string} params.account The account
* @param {string} params.successUrl The success url
* @return {Promise<Object>|Error} Return Promise with result
*/
async createBill (billId, params) {
params.customFields = Object.assign({
apiClient: CLIENT_NAME,
apiClientVersion: packageJson.version
}, params.customFields);
const options = {
url: billId,
method: 'PUT',
body: {
amount: {
currency: params.currency,
value: this._normalizeAmount(params.amount)
},
comment: params.comment,
expirationDateTime: params.expirationDateTime,
customer: {
phone: params.phone,
email: params.email,
account: params.account
},
customFields: params.customFields || params.extra // extra is deprecated, will be removed in next minor update
}
};
let bill = await this._requestBuilder(options);
if (bill.payUrl && params.successUrl) {
bill.payUrl = `${bill.payUrl}&successUrl=${encodeURIComponent(params.successUrl)}`;
}
return bill;
}

Несоответствие:

* @param {string} params.phone The phone
* @param {string} params.email The email
* @param {string} params.account The account

phone, email, account не являются обязательными в соответствии с документацией QIWI, но в JSDOC это не так.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant