Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,13 @@ Here you have all the possible SDK specific errors:
| BadGateway | 502 | undefined |
| ValidationError | 422 | object |
| TooManyRequestsError | 429 | object/undefined |
| ValueError | 429 | string describing error |
| ValueError | - | string describing error |

Identifiers passed to client methods (for example a payment id) are sent as single, percent-encoded path
segments: pass them unencoded. A `ValueError` is thrown before any request is sent when an identifier is
`undefined`, `null`, empty, `.` or `..`, contains text that is not valid (an unpaired surrogate), or contains
`/`, `\` or an ASCII control character (U+0000 to U+001F, U+007F). To retrieve a customer whose email contains
`/` or `\`, use the customer's ID.


# :white_check_mark: Testing
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/baloto.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class Baloto {
* @param {string} id Payment id.
* @memberof Baloto
* @return {Promise<Object>} A promise to the Baloto response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async succeed(id) {
try {
Expand All @@ -51,7 +52,8 @@ export default class Baloto {
* @param {string} id Payment id.
* @memberof Baloto
* @return {Promise<Object>} A promise to the Baloto response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async expire(id) {
try {
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/boleto.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class Boleto {
* @param {string} id Payment id.
* @memberof Boleto
* @return {Promise<Object>} A promise to the Boleto response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async succeed(id) {
try {
Expand All @@ -51,7 +52,8 @@ export default class Boleto {
* @param {string} id Payment id.
* @memberof Boleto
* @return {Promise<Object>} A promise to the Boleto response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async expire(id) {
try {
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/fawry.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class Fawry {
* @param {string} reference Reference.
* @memberof Fawry
* @return {Promise<Object>} A promise to the Fawry response.
* @throws {ValueError} If reference is undefined, null, empty, "." or "..".
* @throws {ValueError} If reference is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async approve(reference) {
try {
Expand All @@ -51,7 +52,8 @@ export default class Fawry {
* @param {string} reference Reference.
* @memberof Fawry
* @return {Promise<Object>} A promise to the Fawry response.
* @throws {ValueError} If reference is undefined, null, empty, "." or "..".
* @throws {ValueError} If reference is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async cancel(reference) {
try {
Expand Down
9 changes: 6 additions & 3 deletions src/api/apm-specific/klarna.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default class Klarna {
*
* @param {string} id Session id.
* @return {Promise<Object>} A promise to the Klarna response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async getSession(id) {
const url = this.config.host.includes('sandbox')
Expand All @@ -70,7 +71,8 @@ export default class Klarna {
* @param {string} id Payment id.
* @param {Object} body Capture details.
* @return {Promise<Object>} A promise to the Klarna response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async capture(id, body) {
const url = this.config.host.includes('sandbox')
Expand All @@ -96,7 +98,8 @@ export default class Klarna {
* @param {string} id Payment id.
* @param {Object} [body] Void details.
* @return {Promise<Object>} A promise to the Klarna response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async void(id, body) {
const url = this.config.host.includes('sandbox')
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/oxxo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class Oxxo {
* @param {string} id Payment id.
* @memberof Oxxo
* @return {Promise<Object>} A promise to the Oxxo response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async succeed(id) {
try {
Expand All @@ -51,7 +52,8 @@ export default class Oxxo {
* @param {string} id Payment id.
* @memberof Oxxo
* @return {Promise<Object>} A promise to the Oxxo response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async expire(id) {
try {
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/pagofacil.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class PagoFacil {
* @param {string} id Payment id.
* @memberof PagoFacil
* @return {Promise<Object>} A promise to the PagoFacil response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async succeed(id) {
try {
Expand All @@ -51,7 +52,8 @@ export default class PagoFacil {
* @param {string} id Payment id.
* @memberof PagoFacil
* @return {Promise<Object>} A promise to the PagoFacil response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async expire(id) {
try {
Expand Down
6 changes: 4 additions & 2 deletions src/api/apm-specific/rapipago.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class Rapipago {
* @param {string} id Payment id.
* @memberof Rapipago
* @return {Promise<Object>} A promise to the Rapipago response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async succeed(id) {
try {
Expand All @@ -51,7 +52,8 @@ export default class Rapipago {
* @param {string} id Payment id.
* @memberof Rapipago
* @return {Promise<Object>} A promise to the Rapipago response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async expire(id) {
try {
Expand Down
12 changes: 8 additions & 4 deletions src/api/apm-specific/sepa.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default class Sepa {
*
* @param {string} id Source id
* @return {Promise<Object>} A promise to the Sepa response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async getMandate(id) {
const url = this.config.host.includes('sandbox')
Expand All @@ -44,7 +45,8 @@ export default class Sepa {
*
* @param {string} id Source id
* @return {Promise<Object>} A promise to the Sepa response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async cancelMandate(id) {
const url = this.config.host.includes('sandbox')
Expand All @@ -64,7 +66,8 @@ export default class Sepa {
*
* @param {string} id Source id
* @return {Promise<Object>} A promise to the Sepa response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async getPPROMandate(id) {
const url = this.config.host.includes('sandbox')
Expand All @@ -83,7 +86,8 @@ export default class Sepa {
*
* @param {string} id Source id
* @return {Promise<Object>} A promise to the Sepa response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async cancelPPROMandate(id) {
const url = this.config.host.includes('sandbox')
Expand Down
6 changes: 4 additions & 2 deletions src/api/balances/balances.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default class Balances {
* that point in time. Forwarded verbatim as the `balancesAt` (camelCase)
* query parameter, as defined in swagger.
* @return {Promise<Object>} A promise to the balances response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async retrieve(id, options) {
try {
Expand Down Expand Up @@ -113,7 +114,8 @@ export default class Balances {
* @param {string} currencyAccountId The ID of the sub-account to retrieve top-up
* instructions for.
* @return {Promise<Object>} A promise to the top-up instructions response.
* @throws {ValueError} If entityId or currencyAccountId is undefined, null, empty, "." or "..".
* @throws {ValueError} If entityId or currencyAccountId is undefined, null, empty, "." or "..",
* or contains "/", "\", an ASCII control character or an unpaired surrogate.
*/
async retrieveTopUpInstructions(entityId, currencyAccountId) {
try {
Expand Down
6 changes: 4 additions & 2 deletions src/api/compliance-requests/compliance-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default class ComplianceRequests {
* @memberof ComplianceRequests
* @param {string} paymentId The payment id whose compliance request to fetch.
* @return {Promise<Object>} A promise to the compliance request response.
* @throws {ValueError} If paymentId is undefined, null, empty, "." or "..".
* @throws {ValueError} If paymentId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getComplianceRequest(paymentId) {
try {
Expand All @@ -49,7 +50,8 @@ export default class ComplianceRequests {
* @param {string} paymentId The payment id whose compliance request to respond to.
* @param {Object} body Compliance response body.
* @return {Promise<Object>} A promise to the response.
* @throws {ValueError} If paymentId is undefined, null, empty, "." or "..".
* @throws {ValueError} If paymentId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async respondToComplianceRequest(paymentId, body) {
try {
Expand Down
12 changes: 8 additions & 4 deletions src/api/customers/customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export default class Customers {
* Get a customer
*
* @memberof Customers
* @param {string} id Customer id.
* @param {string} id The customer's ID or email. An email that contains "/" or "\" is rejected
* before any request is sent: use the customer's ID instead.
* @return {Promise<Object>} A promise to the customer details response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async get(id) {
try {
Expand All @@ -67,7 +69,8 @@ export default class Customers {
* @param {string} id Customer id.
* @param {Object} body Customer object body.
* @return {Promise<Object>} A promise to the request customer response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async update(id, body) {
try {
Expand All @@ -94,7 +97,8 @@ export default class Customers {
* @memberof Customers
* @param {string} id Customer id.
* @return {Promise<Object>} A promise to the customer response.
* @throws {ValueError} If id is undefined, null, empty, "." or "..".
* @throws {ValueError} If id is undefined, null, empty, "." or "..", or contains "/", "\", an
* ASCII control character or an unpaired surrogate.
*/
async delete(id) {
try {
Expand Down
27 changes: 18 additions & 9 deletions src/api/disputes/disputes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the dispute response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getDetails(disputeId) {
try {
Expand All @@ -69,7 +70,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the dispute response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async accept(disputeId) {
try {
Expand Down Expand Up @@ -98,7 +100,8 @@ export default class Disputes {
* @param {string} disputeId Dispute id.
* @param {Object} body Evidence
* @return {Promise<Object>} A promise to the dispute response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async provideEvidence(disputeId, body) {
try {
Expand All @@ -121,7 +124,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the dispute response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getEvidence(disputeId) {
try {
Expand All @@ -145,7 +149,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the dispute response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async submit(disputeId) {
try {
Expand All @@ -169,7 +174,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the compiled submitted evidence response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getCompiledSubmittedEvidence(disputeId) {
try {
Expand All @@ -192,7 +198,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the dispute scheme files response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getDisputeSchemeFiles(disputeId) {
try {
Expand All @@ -216,7 +223,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<void>} A promise that resolves when evidence is submitted successfully (204 No Content).
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async submitArbitrationEvidence(disputeId) {
try {
Expand Down Expand Up @@ -244,7 +252,8 @@ export default class Disputes {
* @memberof Disputes
* @param {string} disputeId Dispute id.
* @return {Promise<Object>} A promise to the compiled submitted arbitration evidence response.
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..".
* @throws {ValueError} If disputeId is undefined, null, empty, "." or "..", or contains "/",
* "\", an ASCII control character or an unpaired surrogate.
*/
async getCompiledSubmittedArbitrationEvidence(disputeId) {
try {
Expand Down
Loading
Loading