TD-138: github actions, openapi 3.0 (#5)

* TD-138: github actions, openapi 3.0

* Fix .gitignore

* Fix pom.xml

* Fix signature.yaml

* Fix path

* Fix openapi.yaml

* Fix openapi.yaml

* Removed property 'name'

* Added 404 error

* Change server to client

* Feedback fixes

Co-authored-by: Inal Arsanukaev <inalarsanukaev@192.168.1.5>
This commit is contained in:
Inal Arsanukaev 2022-02-11 18:17:07 +03:00 committed by GitHub
parent fa9108525a
commit 9f0c660a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 7563 additions and 742 deletions

View File

@ -0,0 +1,7 @@
name: Build Artifact
on:
- pull_request
jobs:
build:
uses: valitydev/java-workflow/.github/workflows/maven-swag-build.yml@v1

View File

@ -0,0 +1,12 @@
name: Deploy Artifact
on:
push:
branches: [master]
jobs:
deploy:
uses: valitydev/java-workflow/.github/workflows/maven-swag-deploy.yml@v1
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

28
.github/workflows/gh-pages.yaml vendored Normal file
View File

@ -0,0 +1,28 @@
name: gh-pages
on:
push:
branches: [master]
env:
NODEJS_VERSION: '16'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODEJS_VERSION }}
cache: npm
- run: npm install
- name: Bundle specification
run: npm run build
- name: Publish ReDoc on Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
exclude_assets: 'swagger-ui'

28
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Dir for API portal deploy
web_deploy
dist
out
# Logs
logs
@ -35,10 +36,27 @@ node_modules
# CI
.wercker
# Generated
web_deploy/
/target/
# User-specific stuff:
.idea/
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
*.iml
.DS_Store
package-lock.json
swagger.json
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
java/
# Gradle:
.idea/gradle.xml
.idea/libraries

4
.gitmodules vendored
View File

@ -1,4 +0,0 @@
[submodule "build_utils"]
path = build_utils
url = git@github.com:rbkmoney/build_utils.git
branch = master

18
.redocly.yaml Normal file
View File

@ -0,0 +1,18 @@
# See https://docs.redoc.ly/cli/configuration/ for more information.
apiDefinitions:
core: 'openapi/openapi.yaml'
lint:
plugins:
- './plugins/local.js'
extends:
- recommended
rules:
tag-description: off
preprocessors:
local/merge-schemas: on
referenceDocs:
showConsole: true
layout:
scope: section
routingStrategy: browser
htmlTemplate: ./web/index.html

40
Jenkinsfile vendored
View File

@ -1,40 +0,0 @@
#!groovy
build('swag-webhook-events', 'docker-host') {
checkoutRepo()
loadBuildUtils()
def pipeDefault
def gitUtils
runStage('load pipeline') {
env.JENKINS_LIB = "build_utils/jenkins_lib"
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
}
pipeDefault() {
runStage('init') {
withGithubSshCredentials {
sh 'make wc_init'
}
}
runStage('build') {
sh 'make wc_build'
}
// Java
runStage('Build client & server') {
withCredentials([[$class: 'FileBinding', credentialsId: 'java-maven-settings.xml', variable: 'SETTINGS_XML']]) {
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_client_old'
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_client'
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_server'
} else {
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.compile_client_old'
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.compile_client'
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.compile_server'
}
}
}
}
}

128
Makefile
View File

@ -1,128 +0,0 @@
SUBMODULES = build_utils
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
UTILS_PATH := build_utils
TEMPLATES_PATH := .
# Name of the service
SERVICE_NAME := swag-webhook-events
# Service image default tag
SERVICE_IMAGE_TAG ?= $(shell git rev-parse HEAD)
# The tag for service image to be pushed with
SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
BUILD_IMAGE_TAG := f3732d29a5e622aabf80542b5138b3631a726adb
CALL_ANYWHERE := \
all submodules init build java.compile java.deploy
CALL_W_CONTAINER := $(CALL_ANYWHERE)
all: compile
-include $(UTILS_PATH)/make_lib/utils_image.mk
-include $(UTILS_PATH)/make_lib/utils_container.mk
.PHONY: $(CALL_W_CONTAINER)
$(SUBTARGETS): %/.git: %
git submodule update --init $<
touch $@
submodules: $(SUBTARGETS)
init:
npm install
build:
npm run build
# Java
ifdef SETTINGS_XML
DOCKER_RUN_OPTS = -v $(SETTINGS_XML):$(SETTINGS_XML)
DOCKER_RUN_OPTS += -e SETTINGS_XML=$(SETTINGS_XML)
endif
ifdef LOCAL_BUILD
DOCKER_RUN_OPTS += -v $$HOME/.m2:/home/$(UNAME)/.m2:rw
endif
COMMIT_HASH := $(shell git --no-pager log -1 --pretty=format:"%h")
NUMBER_COMMITS := $(shell git rev-list --count HEAD)
JAVA_PKG_VERSION := 1.$(NUMBER_COMMITS)-$(COMMIT_HASH)
ifdef BRANCH_NAME
ifeq "$(findstring epic,$(BRANCH_NAME))" "epic"
JAVA_PKG_VERSION := $(JAVA_PKG_VERSION)-epic
endif
endif
MVN = mvn -s $(SETTINGS_XML) -Dcommit.number="$(NUMBER_COMMITS)"
java.swag.compile_client_old:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) compile -P="client-old"
java.swag.deploy_client_old:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client-old" && \
$(MVN) deploy -P="client-old"
java.swag.install_client_old:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client-old" && \
$(MVN) install -P="client-old"
java.swag.compile_client:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) compile -P="client"
java.swag.deploy_client:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
$(MVN) deploy -P="client"
java.swag.install_client:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
$(MVN) install -P="client"
java.swag.compile_server:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) compile -P="server"
java.swag.deploy_server:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
$(MVN) deploy -P="server"
java.swag.install_server:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
$(MVN) install -P="server"
java.compile: java.settings
$(MVN) compile
java.deploy: java.settings
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
$(MVN) deploy
java.install: java.settings
$(MVN) clean && \
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
$(MVN) install
java.settings:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)

@ -1 +0,0 @@
Subproject commit ccf618949b95590d572157b248289428abeaa2e5

View File

@ -1,50 +0,0 @@
var gulp = require('gulp');
var util = require('gulp-util')
var gulpConnect = require('gulp-connect');
var connect = require('connect');
var cors = require('cors');
var path = require('path');
var exec = require('child_process').exec;
var portfinder = require('portfinder');
var swaggerRepo = require('swagger-repo');
var DIST_DIR = 'web_deploy';
gulp.task('edit', function() {
portfinder.getPort({port: 5000}, function (err, port) {
var app = connect();
app.use(swaggerRepo.swaggerEditorMiddleware());
app.listen(port);
util.log(util.colors.green('swagger-editor started http://localhost:' + port));
});
});
gulp.task('build', function (cb) {
exec('npm run build', function (err, stdout, stderr) {
console.log(stderr);
cb(err);
});
});
gulp.task('reload', gulp.parallel('build', function () {
gulp.src(DIST_DIR).pipe(gulpConnect.reload())
}));
gulp.task('watch', function () {
gulp.watch(['spec/**/*', 'web/**/*'], gulp.series(['reload']));
});
gulp.task('serve', gulp.parallel('build', 'watch', 'edit', function() {
portfinder.getPort({port: 3000}, function (err, port) {
gulpConnect.server({
root: [DIST_DIR],
livereload: true,
port: port,
middleware: function (gulpConnect, opt) {
return [
cors()
]
}
});
});
}));

View File

@ -0,0 +1,7 @@
name: Content-Signature
in: header
description: >
Подпись сообщения, сформированная согласно указанным выше правилам
required: true
schema:
type: string

View File

@ -0,0 +1,5 @@
description: Заданный ресурс не найден
content:
application/json; charset=utf-8:
schema:
$ref: '../schemas/GeneralError.yaml'

View File

@ -2,4 +2,4 @@ required:
- cryptoCurrency
properties:
cryptoCurrency:
$ref: '#/definitions/CryptoCurrency'
$ref: '../schemas/CryptoCurrency.yaml'

View File

@ -20,7 +20,7 @@ properties:
- ready
- unready
contactInfo:
$ref: '#/definitions/ContactInfo'
$ref: '../schemas/ContactInfo.yaml'
metadata:
description: Связанные с плательщиком метаданные
type: object

View File

@ -1,7 +1,7 @@
description: Привязка плательщика к платежному средству
type: object
allOf:
- $ref: '#/definitions/CustomerBindingStatus'
- $ref: '../schemas/CustomerBindingStatus.yaml'
- type: object
required:
- id
@ -11,4 +11,4 @@ allOf:
description: Идентификатор привязки
type: string
paymentResource:
$ref: '#/definitions/PaymentResource'
$ref: '../schemas/PaymentResource.yaml'

View File

@ -1,12 +1,12 @@
description: Событие о неуспешной привязке плательщика к платежному средству
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
- binding
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'
binding:
$ref: '#/definitions/CustomerBinding'
$ref: '../schemas/CustomerBinding.yaml'

View File

@ -1,12 +1,12 @@
description: Событие о создании привязки плательщика к платежному средству
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
- binding
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'
binding:
$ref: '#/definitions/CustomerBinding'
$ref: '../schemas/CustomerBinding.yaml'

View File

@ -11,4 +11,4 @@ properties:
- succeeded
- failed
error:
$ref: '#/definitions/CustomerBindingError'
$ref: '../schemas/CustomerBindingError.yaml'

View File

@ -1,12 +1,12 @@
description: Событие об успешной привязке плательщика к платежному средству
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
- binding
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'
binding:
$ref: '#/definitions/CustomerBinding'
$ref: '../schemas/CustomerBinding.yaml'

View File

@ -1,9 +1,9 @@
description: Событие о создании нового плательщика
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'

View File

@ -1,9 +1,9 @@
description: Событие об удалении плательщика
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'

View File

@ -1,6 +1,6 @@
type: object
allOf:
- $ref: '#/definitions/Payer'
- $ref: '../schemas/Payer.yaml'
- type: object
required:
- customerID

View File

@ -1,9 +1,9 @@
description: Событие о наступлении готовности плательщика к проведению оплаты
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- customer
properties:
customer:
$ref: '#/definitions/Customer'
$ref: '../schemas/Customer.yaml'

View File

@ -0,0 +1,11 @@
required:
- digitalWalletDetailsType
properties:
digitalWalletDetailsType:
type: string
enum:
- DigitalWalletDetailsQIWI
discriminator:
propertyName: digitalWalletDetailsType
mapping:
'DigitalWalletDetailsQIWI': '../schemas/DigitalWalletDetailsQIWI.yaml'

View File

@ -1,5 +1,5 @@
allOf:
- $ref: '#/definitions/DigitalWalletDetails'
- $ref: '../schemas/DigitalWalletDetails.yaml'
- type: object
required:
- phoneNumberMask

View File

@ -0,0 +1,69 @@
description: Данные события
type: object
required:
- eventID
- occuredAt
- topic
- eventType
properties:
eventID:
description: Идентификатор события в системе
type: integer
occuredAt:
description: Дата и время возникновения события
type: string
format: date-time
topic:
description: Предмет оповещения
type: string
enum:
- InvoicesTopic
- CustomersTopic
eventType:
type: string
description: Тип произошедшего с предметом оповещения события
enum:
- InvoiceCreated
- InvoicePaid
- InvoiceCancelled
- InvoiceFulfilled
- PaymentStarted
- PaymentProcessed
- PaymentCaptured
- PaymentCancelled
- PaymentRefunded
- PaymentFailed
- RefundCreated
- RefundPending
- RefundSucceeded
- RefundFailed
- CustomerCreated
- CustomerDeleted
- CustomerReady
- CustomerBindingStarted
- CustomerBindingSucceeded
- CustomerBindingFailed
discriminator:
propertyName: eventType
mapping:
'InvoiceCreated': '../schemas/InvoiceCreated.yaml'
'InvoicePaid': '../schemas/InvoicePaid.yaml'
'InvoiceCancelled': '../schemas/InvoiceCancelled.yaml'
'InvoiceFulfilled': '../schemas/InvoiceFulfilled.yaml'
'PaymentStarted': '../schemas/PaymentStarted.yaml'
'PaymentProcessed': '../schemas/PaymentProcessed.yaml'
'PaymentCaptured': '../schemas/PaymentCaptured.yaml'
'PaymentCancelled': '../schemas/PaymentCancelled.yaml'
'PaymentRefunded': '../schemas/PaymentRefunded.yaml'
'PaymentFailed': '../schemas/PaymentFailed.yaml'
'RefundCreated': '../schemas/RefundCreated.yaml'
'RefundPending': '../schemas/RefundPending.yaml'
'RefundSucceeded': '../schemas/RefundSucceeded.yaml'
'RefundFailed': '../schemas/RefundFailed.yaml'
'CustomerCreated': '../schemas/CustomerCreated.yaml'
'CustomerDeleted': '../schemas/CustomerDeleted.yaml'
'CustomerReady': '../schemas/CustomerReady.yaml'
'CustomerBindingStarted': '../schemas/CustomerBindingStarted.yaml'
'CustomerBindingSucceeded': '../schemas/CustomerBindingSucceeded.yaml'
'CustomerBindingFailed': '../schemas/CustomerBindingFailed.yaml'

View File

@ -0,0 +1,6 @@
type: object
required:
- message
properties:
message:
type: string

View File

@ -66,4 +66,4 @@ properties:
minItems: 1
maxItems: 100
items:
$ref: '#/definitions/InvoiceCartLine'
$ref: '../schemas/InvoiceCartLine.yaml'

View File

@ -2,10 +2,10 @@ description: |
Событие об отмене инвойса с указанием причины, например истечение его срока
жизни
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'

View File

@ -1,9 +1,9 @@
description: Событие о создании нового инвойса
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'

View File

@ -1,9 +1,9 @@
description: Событие о погашении обязательств по инвойсу
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'

View File

@ -2,10 +2,10 @@ description: |
Событие о полной оплате инвойса, являющееся поводом начать предоставление
плательщику товаров или услуг
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'

View File

@ -0,0 +1,17 @@
type: object
required:
- payerType
properties:
payerType:
description: Тип платежного средства
type: string
enum:
- CustomerPayer
- PaymentResourcePayer
- RecurrentPayer
discriminator:
propertyName: payerType
mapping:
'CustomerPayer': '../schemas/CustomerPayer.yaml'
'PaymentResourcePayer': '../schemas/PaymentResourcePayer.yaml'
'RecurrentPayer': '../schemas/RecurrentPayer.yaml'

View File

@ -28,7 +28,7 @@ properties:
- refunded
- failed
error:
$ref: '#/definitions/PaymentError'
$ref: '../schemas/PaymentError.yaml'
amount:
description: >
Стоимость предлагаемых товаров или услуг, в минорных денежных единицах,
@ -82,7 +82,7 @@ properties:
Уникальный отпечаток user agent'а плательщика
type: string
payer:
$ref: '#/definitions/Payer'
$ref: '../schemas/Payer.yaml'
fee:
description: >
Комиссия системы, в минорных денежных единицах.

View File

@ -2,13 +2,13 @@ description: |
Событие об отмене платежа, в результате которого списание денежных средств с
плательщика аннулируется
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -2,13 +2,13 @@ description: |
Событие об успешном завершении платежа, что является подтверждением
возникновения денежных обязательств платформы перед вами
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -15,4 +15,4 @@ properties:
Описание ошибки
type: string
subError:
$ref: '#/definitions/SubError'
$ref: '../schemas/SubError.yaml'

View File

@ -2,13 +2,13 @@ description: |
Событие о неуспешном завершении платежа с указанием причины, например в
случае отсутствия достаточного количества денежных средств у плательщика
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -1,12 +1,12 @@
description: Событие об успешной обработке платежа
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -1,12 +1,12 @@
description: Событие об успешном осуществлении возврата платежа
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -13,6 +13,6 @@ properties:
type: string
maxLength: 1000
paymentToolDetails:
$ref: '#/definitions/PaymentToolDetails'
$ref: '../schemas/PaymentToolDetails.yaml'
clientInfo:
$ref: '#/definitions/ClientInfo'
$ref: '../schemas/ClientInfo.yaml'

View File

@ -1,11 +1,11 @@
type: object
description: Платежное средство
allOf:
- $ref: '#/definitions/Payer'
- $ref: '#/definitions/PaymentResource'
- $ref: '../schemas/Payer.yaml'
- $ref: '../schemas/PaymentResource.yaml'
- type: object
required:
- contactInfo
properties:
contactInfo:
$ref: '#/definitions/ContactInfo'
$ref: '../schemas/ContactInfo.yaml'

View File

@ -1,12 +1,12 @@
description: Событие о запуске платежа в рамках инвойса
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
- payment
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'

View File

@ -0,0 +1,22 @@
type: object
description: Детали платежного средства
required:
- detailsType
properties:
detailsType:
description: Тип информации о платежном средстве
type: string
enum:
- PaymentToolDetailsBankCard
- PaymentToolDetailsPaymentTerminal
- PaymentToolDetailsDigitalWallet
- PaymentToolDetailsCryptoWallet
- PaymentToolDetailsMobileCommerce
discriminator:
propertyName: detailsType
mapping:
'PaymentToolDetailsBankCard': '../schemas/PaymentToolDetailsBankCard.yaml'
'PaymentToolDetailsPaymentTerminal': '../schemas/PaymentToolDetailsPaymentTerminal.yaml'
'PaymentToolDetailsDigitalWallet': '../schemas/PaymentToolDetailsDigitalWallet.yaml'
'PaymentToolDetailsCryptoWallet': '../schemas/PaymentToolDetailsCryptoWallet.yaml'
'PaymentToolDetailsMobileCommerce': '../schemas/PaymentToolDetailsMobileCommerce.yaml'

View File

@ -0,0 +1,4 @@
type: object
allOf:
- $ref: '../schemas/PaymentToolDetails.yaml'
- $ref: '../schemas/BankCardDetails.yaml'

View File

@ -0,0 +1,4 @@
type: object
allOf:
- $ref: '../schemas/PaymentToolDetails.yaml'
- $ref: '../schemas/CryptoWalletDetails.yaml'

View File

@ -0,0 +1,4 @@
type: object
allOf:
- $ref: '../schemas/PaymentToolDetails.yaml'
- $ref: '../schemas/DigitalWalletDetails.yaml'

View File

@ -0,0 +1,4 @@
type: object
allOf:
- $ref: '../schemas/PaymentToolDetails.yaml'
- $ref: '../schemas/MobileCommerceDetails.yaml'

View File

@ -0,0 +1,4 @@
type: object
allOf:
- $ref: '../schemas/PaymentToolDetails.yaml'
- $ref: '../schemas/PaymentTerminalDetails.yaml'

View File

@ -1,13 +1,13 @@
type: object
description: Многоразовое платежное средство на основе другого платежа
allOf:
- $ref: '#/definitions/Payer'
- $ref: '../schemas/Payer.yaml'
- type: object
required:
- contactInfo
- recurrentParentPayment
properties:
contactInfo:
$ref: '#/definitions/ContactInfo'
$ref: '../schemas/ContactInfo.yaml'
recurrentParentPayment:
$ref: '#/definitions/PaymentRecurrentParent'
$ref: '../schemas/PaymentRecurrentParent.yaml'

View File

@ -1,6 +1,6 @@
description: Событие о запуске рефанда в рамках платежа
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
@ -8,8 +8,8 @@ allOf:
- refund
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'
refund:
$ref: '#/definitions/Refund'
$ref: '../schemas/Refund.yaml'

View File

@ -1,6 +1,6 @@
description: Событие о неуспешном завершении рефанда
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
@ -8,8 +8,8 @@ allOf:
- refund
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'
refund:
$ref: '#/definitions/Refund'
$ref: '../schemas/Refund.yaml'

View File

@ -1,6 +1,6 @@
description: Событие о статусе ожидания рефанда
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
@ -8,8 +8,8 @@ allOf:
- refund
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'
refund:
$ref: '#/definitions/Refund'
$ref: '../schemas/Refund.yaml'

View File

@ -1,6 +1,6 @@
description: Событие об успешном завершении рефанда
allOf:
- $ref: '#/definitions/Event'
- $ref: '../schemas/Event.yaml'
- type: object
required:
- invoice
@ -8,8 +8,8 @@ allOf:
- refund
properties:
invoice:
$ref: '#/definitions/Invoice'
$ref: '../schemas/Invoice.yaml'
payment:
$ref: '#/definitions/Payment'
$ref: '../schemas/Payment.yaml'
refund:
$ref: '#/definitions/Refund'
$ref: '../schemas/Refund.yaml'

View File

@ -7,4 +7,4 @@ properties:
description: Детализация кода ошибки
type: string
subError:
$ref: '#/definitions/SubError'
$ref: '../schemas/SubError.yaml'

View File

@ -1,12 +1,14 @@
swagger: '2.0'
openapi: 3.0.0
info:
version: '1.0'
title: RBKmoney Webhooks Events API
termsOfService: 'http://rbkmoney.com/'
version: 2.0.0
title: Vality Webhooks Events API
termsOfService: https://vality.dev/
contact:
name: RBKmoney support team
email: tech-support@rbkmoney.com
url: 'https://api.rbk.money'
name: Vality support team
email: support@vality.dev
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
description: |
## Webhooks Events API
@ -19,8 +21,8 @@ info:
Webhook — это подписка на определенный тип события либо их группу,
касающихся различных объектов в рамках вашей организации. Для управления
webhook'ами используются методы RBKmoney API, описанные в спецификации
[RBKmoney Webhooks Management API](https://rbkmoney.github.io/api#Webhooks).
webhook'ами используются методы Vality API, описанные в спецификации
[Vality Webhooks Management API](https://vality.github.io/api#Webhooks).
Когда наступает одно из событий в рамках определенного инвойса (например,
изменение статуса инвойса или платежа по этому инвойсу), платформа выбирает
webhook, подходящий под этот тип события, и отправляет HTTP-запрос,
@ -80,22 +82,12 @@ info:
Набор атрибутов заголовка и список возможных алгоритмов формирования подписи
в дальнейшем могут быть расширены.
schemes:
- https
consumes:
- application/json; charset=utf-8
produces:
- application/json; charset=utf-8
parameters:
signature:
name: Content-Signature
in: header
description: >
Подпись сообщения, сформированная согласно указанным выше правилам
required: true
type: string
servers:
- url: 'https://merchant.site'
tags:
- name: Event Notifications
x-displayName: Оповещения
description: Доставка оповещений о событиях платформы.
paths:
'/webhook':
$ref: './paths/webhook-url.yaml'

View File

@ -0,0 +1,19 @@
post:
tags:
- Event Notifications
summary: Оповестить о событии
operationId: notifyWebhookEvent
parameters:
- $ref: '../components/parameters/signature.yaml'
requestBody:
description: Данные произошедшего в платформе события
required: true
content:
application/json:
schema:
$ref: '../components/schemas/Event.yaml'
responses:
'200':
description: Оповещение обработано
'404':
$ref: '../components/responses/NotFound.yaml'

7015
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,15 @@
{
"name": "RBKmoney-openapi-spec",
"version": "0.0.1",
"dependencies": {
"bower": "^1.7.7",
"connect": "^3.4.1",
"cors": "^2.7.1",
"deploy-to-gh-pages": "^1.1.0",
"gulp": "^4.0.2",
"gulp-connect": "^5.7.0",
"gulp-util": "^3.0.8",
"npm": "^7.11.2",
"portfinder": "^1.0.3",
"shelljs": "^0.7.0",
"swagger-repo": "^1.0.0",
"swagger-ui": "^2.1.4"
},
"name": "swag-webhook-events",
"version": "1.0.0",
"private": true,
"dependencies": {
"@redocly/openapi-cli": "^1.0.0-beta.79",
"json-merge-patch": "^1.0.2",
"redoc-cli": "^0.13.2"
},
"scripts": {
"build": "node ./scripts/build.js",
"swagger": "swagger-repo",
"test": "swagger-repo validate",
"start": "gulp serve"
"start": "openapi preview-docs",
"build": "openapi bundle -o web_deploy/openapi.yaml && openapi bundle -o web_deploy/openapi.json",
"validate": "openapi lint"
}
}
}

50
plugins/local.js Normal file
View File

@ -0,0 +1,50 @@
const jsonmergepatch = require('json-merge-patch');
module.exports = {
id: 'local',
preprocessors: {
oas3: {
'merge-schemas': MergeSchemas
}
}
};
function MergeSchemas() {
const trigger = 'x-mergeSchemas';
return {
Schema: {
leave(node, ctx) {
if (!node[trigger]) {
return;
}
var schemas = node[trigger];
if (!Array.isArray(schemas)) {
return ctx.report({
message: "Argument should be an array of schemas",
location: ctx.location.child(trigger)
});
}
let merged = null;
for (index = schemas.length - 1; index >= 0; --index) {
let schema = schemas[index];
if (typeof schema !== 'object') {
return ctx.report({
message: "Non-object value",
location: ctx.location.child(trigger).child(index)
});
}
if (schema.$ref && typeof schema.$ref === 'string') {
schema = ctx.resolve(schema).node;
}
merged = jsonmergepatch.apply(merged, schema);
console.log(merged);
};
Object.assign(node, merged);
delete node[trigger];
}
}
}
}

225
pom.xml
View File

@ -5,58 +5,68 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.rbkmoney</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
<groupId>dev.vality</groupId>
<artifactId>library-parent-pom</artifactId>
<version>1.0.2</version>
</parent>
<artifactId>swag-webhook-events</artifactId>
<version>SNAPSHOT</version>
<version>${revision}</version>
<packaging>jar</packaging>
<name>Webhook events</name>
<description>Generates jar artifact containing compiled openapi classes based on generated openapi yaml files
</description>
<properties>
<default.package>com.rbkmoney.swag_webhook_events</default.package>
<default.package>dev.vality.swag_webhook_events</default.package>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.21</swagger-annotations-version>
<jodatime-version>2.7</jodatime-version>
<revision>SNAPSHOT</revision>
<maven-plugin-version>1.0.0</maven-plugin-version>
<java.version>1.8</java.version>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<jetty-version>9.2.15.v20160210</jetty-version>
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.12</junit-version>
<slf4j-version>1.7.33</slf4j-version>
<junit-version>4.13.2</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<jackson-version>2.13.1</jackson-version>
<spring-version>2.6.1</spring-version>
<springfox-version>3.0.0</springfox-version>
<jackson-version>2.11.3</jackson-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<spring-version>5.3.1</spring-version>
<javax.version>1.3.2</javax.version>
<jaxb.version>2.3.1</jaxb.version>
<javax-validation.version>1.1.0.Final</javax-validation.version>
<http-client.version>4.5.2</http-client.version>
<gson.version>2.8.5</gson.version>
<okhttp.version>2.7.5</okhttp.version>
<gson.fire.version>1.0.1</gson.fire.version>
<javax-annotation-api-version>1.3.2</javax-annotation-api-version>
<jaxb-version>2.3.1</jaxb-version>
<openapi-generator-version>5.3.1</openapi-generator-version>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-version}</version>
<scope>provided</scope>
</dependency>
<!--Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>${spring-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>${spring-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>${spring-version}</version>
<scope>provided</scope>
</dependency>
@ -66,22 +76,21 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
@ -89,36 +98,6 @@
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
<version>${gson.fire.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@ -128,25 +107,37 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.version}</version>
<version>${javax-annotation-api-version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax-validation.version}</version>
<version>2.0.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${http-client.version}</version>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -157,27 +148,30 @@
<build>
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-version}</version>
<executions>
<execution>
<id>generate-server</id>
<phase>generate-sources</phase>
<id>spring-server</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>web_deploy/swagger.yaml</inputSpec>
<configOptions>
<dateLibrary>java8</dateLibrary>
</configOptions>
<language>spring</language>
<library>spring-mvc</library>
<inputSpec>web_deploy/openapi.yaml</inputSpec>
<generatorName>spring</generatorName>
<generateModels>true</generateModels>
<generateApis>true</generateApis>
<generateApiDocumentation>true</generateApiDocumentation>
<generateSupportingFiles>true</generateSupportingFiles>
<apiPackage>${default.package}.api</apiPackage>
<modelPackage>${default.package}.model</modelPackage>
<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
<configOptions>
<dateLibrary>java8</dateLibrary>
<delegatePattern>true</delegatePattern>
<useBeanValidation>true</useBeanValidation>
</configOptions>
</configuration>
</execution>
</executions>
@ -190,25 +184,22 @@
<build>
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-version}</version>
<executions>
<execution>
<id>generate-client</id>
<phase>generate-sources</phase>
<id>remote</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>web_deploy/swagger.yaml</inputSpec>
<inputSpec>web_deploy/openapi.yaml</inputSpec>
<generatorName>java</generatorName>
<configOptions>
<dateLibrary>java8</dateLibrary>
</configOptions>
<language>java</language>
<library>resttemplate</library>
<apiPackage>${default.package}.api</apiPackage>
<modelPackage>${default.package}.model</modelPackage>
</configuration>
@ -218,39 +209,5 @@
</plugins>
</build>
</profile>
<profile>
<id>client-old</id>
<build>
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>generate-client</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>web_deploy/swagger.yaml</inputSpec>
<configOptions>
<dateLibrary>java8</dateLibrary>
</configOptions>
<language>java</language>
<apiPackage>${default.package}.api</apiPackage>
<modelPackage>${default.package}.model</modelPackage>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

18
renovate.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
}

View File

@ -1,23 +0,0 @@
#!/usr/bin/env node
'use strict';
var Path = require('path');
var TARGET_DIR = 'web_deploy'
if (process.argv[2]) {
TARGET_DIR = process.argv[2]
}
require('shelljs/global');
set('-e');
mkdir('-p', TARGET_DIR);
cp('-R', 'web/*', TARGET_DIR + '/');
exec('npm run swagger bundle -- -o ' + TARGET_DIR + '/swagger.json');
exec('npm run swagger bundle -- --yaml -o ' + TARGET_DIR + '/swagger.yaml');
var SWAGGER_UI_DIST = Path.dirname(require.resolve('swagger-ui'));
rm('-rf', TARGET_DIR + '/swagger-ui/')
cp('-R', SWAGGER_UI_DIST, TARGET_DIR + '/swagger-ui/')
sed('-i', 'http://petstore.swagger.io/v2/swagger.json', '../swagger.json', TARGET_DIR + '/swagger-ui/index.html')

View File

@ -1,24 +0,0 @@
## Global headers
In order to minimize duplications you can use `headers` global object (similar to `definitions`, `responses`).
During build process all references to global `headers` will be inlined and `headers` will be removed form resulting spec so spec will be valid (global `headers` is not allowed by Swagger spec):
Example:
```yaml
...
headers:
Rate-Limit-Limit:
description: The number of allowed requests in the current period
type: integer
...
paths:
/api-keys:
get:
summary: Retrieve a list of api keys
responses:
200:
description: A list of api keys was retrieved successfully
headers:
Rate-Limit-Limit:
$ref: "#/headers/Rate-Limit-Limit"
```

View File

@ -1,9 +0,0 @@
Code samples
=====
Generate [x-code-samples](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-code-samples)
Path `<lang>/<path>/<HTTP verb>.<extension>` where:
* `<lang>` - name of the language from [this](https://github.com/github/linguist/blob/master/lib/linguist/popular.yml) list.
* `<path>` - path of target method, where all slashes replaced with `@` sign.
* `<HTTP verb>` - verb of target method.
* `<extension>` - ignored.

View File

@ -1,8 +0,0 @@
discriminator: digitalWalletDetailsType
required:
- digitalWalletDetailsType
properties:
digitalWalletDetailsType:
type: string
enum:
- DigitalWalletDetailsQIWI

View File

@ -1,46 +0,0 @@
description: Данные события
type: object
discriminator: eventType
required:
- eventID
- occuredAt
- topic
- eventType
properties:
eventID:
description: Идентификатор события в системе
type: integer
occuredAt:
description: Дата и время возникновения события
type: string
format: date-time
topic:
description: Предмет оповещения
type: string
enum:
- InvoicesTopic
- CustomersTopic
eventType:
type: string
description: Тип произошедшего с предметом оповещения события
enum:
- InvoiceCreated
- InvoicePaid
- InvoiceCancelled
- InvoiceFulfilled
- PaymentStarted
- PaymentProcessed
- PaymentCaptured
- PaymentCancelled
- PaymentRefunded
- PaymentFailed
- RefundCreated
- RefundPending
- RefundSucceeded
- RefundFailed
- CustomerCreated
- CustomerDeleted
- CustomerReady
- CustomerBindingStarted
- CustomerBindingSucceeded
- CustomerBindingFailed

View File

@ -1,12 +0,0 @@
type: object
discriminator: payerType
required:
- payerType
properties:
payerType:
description: Тип платежного средства
type: string
enum:
- CustomerPayer
- PaymentResourcePayer
- RecurrentPayer

View File

@ -1,15 +0,0 @@
type: object
discriminator: detailsType
description: Детали платежного средства
required:
- detailsType
properties:
detailsType:
description: Тип информации о платежном средстве
type: string
enum:
- PaymentToolDetailsBankCard
- PaymentToolDetailsPaymentTerminal
- PaymentToolDetailsDigitalWallet
- PaymentToolDetailsCryptoWallet
- PaymentToolDetailsMobileCommerce

View File

@ -1,4 +0,0 @@
type: object
allOf:
- $ref: '#/definitions/PaymentToolDetails'
- $ref: '#/definitions/BankCardDetails'

View File

@ -1,4 +0,0 @@
type: object
allOf:
- $ref: '#/definitions/PaymentToolDetails'
- $ref: '#/definitions/CryptoWalletDetails'

View File

@ -1,4 +0,0 @@
type: object
allOf:
- $ref: '#/definitions/PaymentToolDetails'
- $ref: '#/definitions/DigitalWalletDetails'

View File

@ -1,4 +0,0 @@
type: object
allOf:
- $ref: '#/definitions/PaymentToolDetails'
- $ref: '#/definitions/MobileCommerceDetails'

View File

@ -1,4 +0,0 @@
type: object
allOf:
- $ref: '#/definitions/PaymentToolDetails'
- $ref: '#/definitions/PaymentTerminalDetails'

View File

@ -1,16 +0,0 @@
post:
tags:
- Event Notifications
summary: Оповестить о событии
operationId: notifyWebhookEvent
parameters:
- $ref: '#/parameters/signature'
- in: body
name: event
description: Данные произошедшего в платформе события
required: true
schema:
$ref: '#/definitions/Event'
responses:
'200':
description: Оповещение обработано

View File

@ -1,63 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>RBKmoney Webhooks Events API</title>
<!-- needed for adaptive design -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
ReDoc uses font options from the parent element
So override default browser styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url="./swagger.json" suppress-warnings="true" lazy-rendering="true">
</redoc>
<script src="//rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js"> </script>
<!-- GA -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
<head>
<title>Vality Webhook Events API</title>
<!-- needed for adaptive design -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
ga('create', 'UA-92343978-1', 'auto');
ga('send', 'pageview');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter42980494 = new Ya.Metrika({
id:42980494,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/42980494" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>
<!--
ReDoc uses font options from the parent element
So override default browser styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
{{{redocHead}}}
</head>
<body>
{{{redocHTML}}}
</body>
</html>

View File

@ -1,26 +0,0 @@
box:
id: node:16
username: ${DOCKER_ID}
password: ${DOCKER_PWD}
build:
steps:
- npm-install
- npm-test
- script:
name: build docsite
code: npm run build -- ${WERCKER_OUTPUT_DIR}
after-steps:
- slack-notifier:
url: ${SLACK_WEBHOOK_URL}
username: "wercker"
deploy:
steps:
- lukevivier/gh-pages:
repo: rbkmoney/webhooks-events-api
token: ${GITHUB_API_TOKEN}
after-steps:
- slack-notifier:
url: ${SLACK_WEBHOOK_URL}
username: "wercker"