diff --git a/.gitignore b/.gitignore index 59ce014..2d24213 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ +.idea /.idea/.gitignore /.idea/misc.xml /.idea/modules.xml /.idea/pf-waas-api.iml /.idea/vcs.xml +**.**~ +**.iml diff --git a/README.md b/README.md index fcddd91..1474821 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ # pf-waas-api + +## Обновление Async API + +### Предварительно установить библиотеку + +``` bash +npm install -g @asyncapi/html-template@0.16.0 +``` + +### Запустить пересборку HTML вручную + +``` bash +cd async-api/site/ +ag ../waas-async-api.yaml @asyncapi/html-template +``` +NB! Перед тем, как запускать генерацию HTML нужно закоммитить все изменения в git. +И следовать всем инструкциям. + +### Пересборка оформлена в виде скрипта (linux only) + +> update-async-api.sh + diff --git a/api/waas-api.json b/api/waas-api.json new file mode 100644 index 0000000..e26dff6 --- /dev/null +++ b/api/waas-api.json @@ -0,0 +1,3081 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Profee WaaS integration API", + "description": "
Our API allow you to embed financial services into your product: enable your users to hold funds, manage cash flow,\n issue virtual card and make payments.
\n\n This documentation provides you with the following information divided into sections:\n
\n\n list of tokenized cards issued in other banks available for user to make transfers.\n
\n\n This is a living document to be updated regularly with new functionality. To access our sandbox or address questions\n to our developers please contact: waasteam@profeelab.net\n
", + "license": { + "name": "Profee", + "url": "http://profee.com" + }, + "version": "v0.0.1" + }, + "servers": [ + { + "url": "http://localhost:8080", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Payments", + "description": "We provide the list of payments methods for registered users. For each payment method, we give you a unique `methodId`.\n\nPayment methods are divided by types, provided in `methodType`.\n\n### Method types:\n\n- `Wallet to wallet` - a payment between users and their wallets.\n- `Wallet to partner` - a payment from user's wallet to partner.\n- `Paysafecash to wallet` - a topping up user’s wallet via Paysafecash. Give the opportunity to up user’s wallet with cash.\n- `Shift to card`- a payment from user's wallet to card issued via Profee.\n- `Shift to wallet` - a payment from card issued via Profee to user's wallet.\n\n![WAAS API - payment methods](img/WAAS_API_-_Payment_methods.jpg)\n\nOverview of steps:\n\n![WAAS API - payments steps](img/WAAS_API_-_Payment_steps.jpg)" + }, + { + "name": "Wallets", + "description": "We create a wallet for each User of our partner, which is the registration of users.\nIt is the starting point for interacting with our service\n\nWe have several critical restrictions for registering clients creating wallets:\n\n- The User must be over 18 years old\n- Unique phone number\n- Unique email\n\nOverview of steps:\n\n![WAAS API - Wallet steps](img/WAAS_API_-_Wallet_steps.jpg)" + }, + { + "name": "Cards", + "description": "Our service allows you to issue bank cards for users. We can issue virtual and plastic cards. We also have a partner who will deliver plastic cards. Check the list of countries supported for cards delivery.\n\nWe will provide you different `productId` in order to issue plastic and virtual card on stage and product environments.\n\n> 💡 Сard issuing is available only for verified users and users with level PLUS or PREMIUM. You can check it via request `/get-wallet`\n\nOverview of steps:\n\n![WAAS API - card](img/WAAS_API_-_Card.jpg)" + } + ], + "paths": { + "/wallet/get-wallet": { + "post": { + "tags": [ + "Wallets" + ], + "summary": "Get wallet", + "description": "Returns current limit and wallet status.", + "operationId": "getWallet", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerGetWalletRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerWalletDto" + } + } + } + } + } + } + }, + "/wallet/get-documents-status": { + "post": { + "tags": [ + "Wallets" + ], + "summary": "Getting the status of added documents", + "description": "Get the status of all added documents for verification with a single request. \n\nTo understand what is happening with customer's documents, you should look at the status of each added document in response.\n\n### Warnings\n\nFirst, you need to look at is `documentStatusDTO/warnings`. It will show the precheck result. You can ignore it, or communicate to the customer and ask him to re-upload a particular `documentType`. \n\n### Review answers\n\nGeneral answer on screening of particular document and `documentType` you can find in `documentStatusDTO/reviewResult/reviewAnswer`. \n\n- GREEN - The `documentType`can be accepted and successfully verified. You can upload more then one document for each `documentType`, if you get one `GREEN` for one of them it means this `documentType` approved and you can ignore other documents with the same `documentType`.\n- RED - The document for a particular `documentType` has been rejected.\n\n### Reject types of review answers\n\nYou need to look in `documentStatusDTO/reviewResult/reviewRejectType` to quickly understand is it final or not.\nIf you got `reviewAnswer` RED- `reviewAnswer` we have to understand is it Final or not. \n\n- `Final` - means that document finally rejected, and customer also rejected and will not be approved with another document.\n- `Retry` - The \"retry\" rejection means that customer needs to re-upload a document. For example, by uploading a better quality image. More information about the reason and what to suggest to the customer you can find in the `rejectLabels`.\n", + "operationId": "getDocumentsStatus", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerDocumentsStatusRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerDocumentsStatusDto" + } + } + } + } + } + } + }, + "/wallet/create-wallet": { + "post": { + "tags": [ + "Wallets" + ], + "summary": "Create wallet", + "description": "Creates a wallet to register your users in our system. Specify all the necessary data for new wallet registration.", + "operationId": "createWallet", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerCreateWalletRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerWalletDto" + } + } + } + } + } + } + }, + "/wallet/add-document": { + "post": { + "tags": [ + "Wallets" + ], + "summary": "Add verification document", + "description": "To verify a User’s identity with Profee, we need to receive documentation:\n\n- A document to confirm the User’s identity.\n- A separate document to confirm the User’s place of residence\n- A selfie holding the document provided in the previous point", + "operationId": "addDocument", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerAddDocumentRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerAddDocumentResponseDto" + } + } + } + } + } + } + }, + "/payment/get-payment": { + "post": { + "tags": [ + "Payments" + ], + "summary": "Get payment", + "description": "Returns current information about the payment and its status.", + "operationId": "getPayment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerGetPaymentRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerBasePaymentResponseDto" + } + } + } + } + } + } + }, + "/payment/create-payment": { + "post": { + "tags": [ + "Payments" + ], + "summary": "Create payment", + "description": "Creates a payment on a pre-placed payment order. ", + "operationId": "createPayment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerCreatePaymentRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerBasePaymentResponseDto" + } + } + } + } + } + } + }, + "/payment/create-payment-order": { + "post": { + "tags": [ + "Payments" + ], + "summary": "Create payment order", + "description": "Creates an order to make a payment for registered users.\n\nIt is the first step of making payment. Here we check the possibility to process a payment and calculate fees.\n\nWhen checking the possibility of making payments, we check:\n\n- balance of payment sender\n- daily and monthly limits of wallet\n- availability of another wallet for `Wallet to wallet` payment type\n\n> 💡 You can set up`/to/amount` for many payment methods and `/from/amount`. You should use only one of them: `/to/amount` OR `/from/amount.` This functionality makes it possible to calculate the missing amount by direct or reverse calculation, and we will do it ourselves.\n", + "operationId": "createPaymentOrder", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerBasePaymentOrderRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerBasePaymentOrderResponseDto" + } + } + } + } + } + } + }, + "/card/get-card": { + "post": { + "tags": [ + "Cards" + ], + "summary": "Get Profee card information", + "description": "Get general information about the issued card and its current status.", + "operationId": "getCard", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiRequestContainerGetCardRequestDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponseContainerCardDto" + } + } + } + } + } + } + }, + "/card/get-card-tokens": { + "post": { + "tags": [ + "Cards" + ], + "summary": "Get card tokens", + "description": "After funding a Profee wallet with a bank card, the card data is saved in the form of a token.The following notifications will be sent to partner system. Please provide us with URLs which will be responsible in every notification.
+Accepts the following message:
{
+ "cardId": "string",
+ "walletId": "string",
+ "notification": {
+ "uuid": "string",
+ "status": "string",
+ "type": {
+ "code": "string",
+ "direction": "string",
+ "description": "string"
+ },
+ "mcc": 0,
+ "authDate": "2019-08-24",
+ "authTyme": "14:15:22Z",
+ "postingDate": "string",
+ "authCode": "string",
+ "rrn": 0,
+ "merchantId": 0,
+ "terminalId": 0,
+ "merchantName": "string",
+ "merchantCity": "string",
+ "merchantSum": {
+ "amount": 0,
+ "currency": "string"
+ },
+ "cardSum": {
+ "amount": 0,
+ "currency": "string"
+ },
+ "authDescription": "string"
+ }
+}
+
+'+(n?e:f(e,!0))+"
\n":""+(n?e:f(e,!0))+"
\n"},n.blockquote=function(e){return"\n"+e+"\n"},n.html=function(e){return e},n.heading=function(e,t,n,r){return this.options.headerIds?"
"+e+"
\n"},n.table=function(e,t){return t&&(t=""+t+""),""+e+"
"},n.br=function(){return this.options.xhtml?""+f(e.message+"",!0)+"";throw e}}L.options=L.setOptions=function(t){var n;return k(L.defaults,t),n=L.defaults,e.defaults=n,L},L.getDefaults=a,L.defaults=e.defaults,L.use=function(){for(var e=arguments.length,t=new Array(e),n=0;n
"+f(e.message+"",!0)+"";throw e}},L.Parser=z,L.parser=z.parse,L.Renderer=B,L.TextRenderer=I,L.Lexer=R,L.lexer=R.lex,L.Tokenizer=N,L.Slugger=M,L.parse=L;var U=L.options,$=L.setOptions,H=L.use,V=L.walkTokens,W=L.parseInline,q=L,Y=z.parse,Q=R.lex;e.Lexer=R,e.Parser=z,e.Renderer=B,e.Slugger=M,e.TextRenderer=I,e.Tokenizer=N,e.getDefaults=a,e.lexer=Q,e.marked=L,e.options=U,e.parse=q,e.parseInline=W,e.parser=Y,e.setOptions=$,e.use=H,e.walkTokens=V,Object.defineProperty(e,"__esModule",{value:!0})}(t)},57:function(e,t){e.exports=function(e){const t={literal:"true false null"},n=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],r=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:t},i={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(a,{begin:/:/})].concat(n),illegal:"\\S"},o={begin:"\\[",end:"\\]",contains:[e.inherit(a)],illegal:"\\S"};return r.push(i,o),n.forEach((function(e){r.push(e)})),{name:"JSON",contains:r,keywords:t,illegal:"\\S"}}},58:function(e,t){e.exports=function(e){var t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},a=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),i={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},u={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},s=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},i,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},l,u,r],c=[...s];return c.pop(),c.push(a),o.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:s}}},59:function(e,t){function n(...e){return e.map(e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t}).join("")}e.exports=function(e){const t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:n(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(o);const l={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},u=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),s={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[u,e.SHEBANG(),s,l,e.HASH_COMMENT_MODE,i,o,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}},6:function(e,t,n){const{getMapValueByKey:r}=n(2),a={hasDescription(){return!!this._json.description},description(){return r(this._json,"description")}};e.exports=a},60:function(e,t,n){"use strict";var r=n(88);function a(e,t,n){if(3===arguments.length)return a.set(e,t,n);if(2===arguments.length)return a.get(e,t);var r=a.bind(a,e);for(var i in a)a.hasOwnProperty(i)&&(r[i]=a[i].bind(r,e));return r}e.exports=a,a.get=function(e,t){for(var n=Array.isArray(t)?t:a.parse(t),r=0;r