-
Notifications
You must be signed in to change notification settings - Fork 4
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 #27 from aron123/feature/new-email-transfer
Implement the new way of email transfer and related functionalities
- Loading branch information
Showing
13 changed files
with
652 additions
and
31 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
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,24 @@ | ||
const Joi = require('@hapi/joi'); | ||
const { CaseInsensitiveSchema } = require('../schema'); | ||
|
||
const Money = require('./common/Money'); | ||
|
||
/** | ||
* Used to send e-money to a given e-mail address. | ||
* | ||
* @see {@link https://docs.barion.com/Transfer-Email-v2|Barion API Documentation} | ||
*/ | ||
const schema = Joi.object({ | ||
UserName: Joi.string().required() | ||
.email(), | ||
Password: Joi.string().required(), | ||
SourceAccountId: Joi.string().required() | ||
.guid(), | ||
Amount: Money.required(), | ||
TargetEmail: Joi.string().required() | ||
.email(), | ||
Comment: Joi.string().optional() | ||
.max(1000) | ||
}); | ||
|
||
module.exports = new CaseInsensitiveSchema(schema); |
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,15 @@ | ||
const Joi = require('@hapi/joi'); | ||
const { CaseInsensitiveSchema } = require('../schema'); | ||
|
||
/** | ||
* Used to query the existing accounts of the calling user. | ||
* | ||
* @see {@link https://docs.barion.com/Accounts-Get-v2|Barion API Documentation} | ||
*/ | ||
const schema = Joi.object({ | ||
UserName: Joi.string().required() | ||
.email(), | ||
Password: Joi.string().required() | ||
}); | ||
|
||
module.exports = new CaseInsensitiveSchema(schema); |
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,18 @@ | ||
const Joi = require('@hapi/joi'); | ||
const { CaseInsensitiveSchema } = require('../../schema'); | ||
|
||
const constraints = require('../_constraints'); | ||
|
||
/** | ||
* This structure represents an amount of money in the Barion system. | ||
* | ||
* @see {@link https://docs.barion.com/Money|Barion API Documentation} | ||
*/ | ||
const schema = Joi.object({ | ||
Currency: Joi.string().required() | ||
.valid(...constraints.Currency), | ||
Value: Joi.number().required() | ||
.greater(0) | ||
}); | ||
|
||
module.exports = new CaseInsensitiveSchema(schema); |
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
Oops, something went wrong.