-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from mercadopago/mercadopago/request-config
*Adding custom configuration per request (override access token, custom headers) *Adding Card operations *Adding Card Token operations *Adding Refund resource *Adding DiscountCampaign resource *Adjust payment refund *Add payment capture *Changing Customer address street_number from string to integer
- Loading branch information
Showing
13 changed files
with
375 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* istanbul ignore next */ | ||
module.exports = { | ||
additionalProperties: false, // Fails if an extra param is added to the model | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
token: { | ||
type: 'string' | ||
}, | ||
customer_id: { | ||
type: 'string' | ||
}, | ||
expiration_month: { | ||
type: 'integer' | ||
}, | ||
expiration_year: { | ||
type: 'integer' | ||
}, | ||
first_six_digits: { | ||
type: 'string' | ||
}, | ||
last_four_digits: { | ||
type: 'string' | ||
}, | ||
payment_method: { | ||
type: 'object', | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
name: { | ||
type: 'string' | ||
}, | ||
payment_type_id: { | ||
type: 'string' | ||
}, | ||
thumbnail: { | ||
type: 'string' | ||
}, | ||
secure_thumbnail: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
security_code: { | ||
type: 'object', | ||
properties: { | ||
length: { | ||
type: 'integer' | ||
}, | ||
card_location: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
issuer: { | ||
type: 'object', | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
name: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
cardholder: { | ||
type: 'object', | ||
properties: { | ||
name: { | ||
type: 'string' | ||
}, | ||
identification: { | ||
type: 'object', | ||
properties: { | ||
number: { | ||
type: 'string' | ||
}, | ||
sub_type: { | ||
type: 'string' | ||
}, | ||
type: { | ||
type: 'string' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
date_created: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
date_last_updated: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
payment_method_id: { | ||
type: 'string' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* istanbul ignore next */ | ||
module.exports = { | ||
additionalProperties: false, // Fails if an extra param is added to the model | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
customer_id: { | ||
type: 'string' | ||
}, | ||
card_id: { | ||
type: 'string' | ||
}, | ||
security_code: { | ||
type: 'string' | ||
}, | ||
status: { | ||
type: 'string' | ||
}, | ||
date_created: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
date_last_updated: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
date_due: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
luhn_validation: { | ||
type: 'boolean' | ||
}, | ||
live_mode: { | ||
type: 'boolean' | ||
}, | ||
require_esc: { | ||
type: 'boolean' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ module.exports = { | |
type: 'string' | ||
}, | ||
street_number: { | ||
type: 'string' | ||
type: 'integer' | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* istanbul ignore next */ | ||
module.exports = { | ||
additionalProperties: false, // Fails if an extra param is added to the model | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
name: { | ||
type: 'string' | ||
}, | ||
percent_off: { | ||
type: 'number' | ||
}, | ||
amount_off: { | ||
type: 'number' | ||
}, | ||
coupon_amount: { | ||
type: 'number' | ||
}, | ||
currency_id: { | ||
type: 'string' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* istanbul ignore next */ | ||
module.exports = { | ||
additionalProperties: false, // Fails if an extra param is added to the model | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
payment_id: { | ||
type: 'string' | ||
}, | ||
amount: { | ||
type: 'number' | ||
}, | ||
source: { | ||
type: 'object', | ||
properties: { | ||
id: { | ||
type: 'string' | ||
}, | ||
name: { | ||
type: 'string' | ||
}, | ||
type: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
date_created: { | ||
type: 'string', | ||
pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}-[0-9]{2}:[0-9]{2}$' | ||
}, | ||
unique_sequence_number: { | ||
type: 'string' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var requestManager = require('../request-manager'); | ||
var cardModel = require('../models/cardModel'); | ||
|
||
var card = module.exports = { | ||
schema: cardModel | ||
}; | ||
|
||
card.all = requestManager.describe({ | ||
path: '/v1/customers/:customer_id/cards', | ||
method: 'GET' | ||
}); | ||
|
||
card.get = requestManager.describe({ | ||
path: '/v1/customers/:customer_id/cards/:id', | ||
method: 'GET' | ||
}); | ||
|
||
card.findById = card.get; | ||
|
||
card.create = requestManager.describe({ | ||
path: '/v1/customers/:customer_id/cards', | ||
method: 'POST' | ||
}); | ||
|
||
card.save = card.create; | ||
|
||
card.update = requestManager.describe({ | ||
path: '/v1/customers/:customer_id/cards', | ||
method: 'PUT' | ||
}); | ||
|
||
card.delete = requestManager.describe({ | ||
path: '/v1/customers/:customer_id/cards/:id', | ||
method: 'DELETE' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var requestManager = require('../request-manager'); | ||
var cardTokenModel = require('../models/cardTokenModel'); | ||
|
||
var cardToken = module.exports = { | ||
schema: cardTokenModel | ||
}; | ||
|
||
cardToken.get = requestManager.describe({ | ||
path: '/v1/card_tokens/:id', | ||
method: 'GET' | ||
}); | ||
|
||
cardToken.findById = cardToken.get; | ||
|
||
cardToken.create = requestManager.describe({ | ||
path: '/v1/card_tokens', | ||
method: 'POST' | ||
}); | ||
|
||
cardToken.save = cardToken.create; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var requestManager = require('../request-manager'); | ||
var discountCampaignModel = require('../models/discountCampaignModel'); | ||
|
||
var discountCampaign = module.exports = { | ||
schema: discountCampaignModel | ||
}; | ||
|
||
discountCampaign.get = requestManager.describe({ | ||
path: '/v1/discount_campaigns', | ||
method: 'GET' | ||
}); |
Oops, something went wrong.