mirror of
https://github.com/valitydev/koffing.git
synced 2024-11-06 17:25:22 +00:00
FE-454: new webhooks: PaymentProcessed, PaymentCancelled, PaymentRefunded (#160)
This commit is contained in:
parent
734e34155a
commit
6420bc7b35
@ -3,7 +3,7 @@ import { RouterModule } from '@angular/router';
|
||||
|
||||
import { InvoicesComponent } from 'koffing/invoices/invoices.component';
|
||||
import { RegistryComponent } from 'koffing/documents/registry/registry.component';
|
||||
import { WebhookComponent } from 'koffing/webhooks/webhook.component';
|
||||
import { WebhooksComponent } from 'koffing/webhooks/webhooks.component';
|
||||
import { TokenComponent } from 'koffing/tokenization/components/token/token.component';
|
||||
import { AnalyticsComponent } from 'koffing/analytics/analytics.component';
|
||||
import { ManagementComponent } from 'koffing/management/management.component';
|
||||
@ -72,7 +72,7 @@ import { ShopInfoComponent } from 'koffing/shop-info/shop-info.component';
|
||||
},
|
||||
{
|
||||
path: 'webhooks',
|
||||
component: WebhookComponent
|
||||
component: WebhooksComponent
|
||||
},
|
||||
{
|
||||
path: 'webhook/create',
|
||||
|
@ -19,15 +19,19 @@ export class CreateWebhookService {
|
||||
new EventTypePresent('InvoiceCancelled', 'инвойс отменен по истечению срока давности'),
|
||||
new EventTypePresent('InvoiceFulfilled', 'инвойс успешно погашен'),
|
||||
new EventTypePresent('PaymentStarted', 'создан платеж'),
|
||||
new EventTypePresent('PaymentProcessed', 'платеж в обработке'),
|
||||
new EventTypePresent('PaymentCaptured', 'платеж успешно завершен'),
|
||||
new EventTypePresent('PaymentCancelled', 'платеж успешно отменен'),
|
||||
new EventTypePresent('PaymentRefunded', 'платеж успешно возвращен'),
|
||||
new EventTypePresent('PaymentFailed', 'при проведении платежа возникла ошибка')
|
||||
];
|
||||
|
||||
constructor(private fb: FormBuilder,
|
||||
private webhooksService: WebhooksService) {
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
private webhooksService: WebhooksService
|
||||
) {
|
||||
this.createWebhookGroup = this.prepareForm(this.eventTypes);
|
||||
this.createWebhookGroup.controls.eventTypes.setValidators(this.eventTypesValidator);
|
||||
|
||||
}
|
||||
|
||||
public createWebhook(shopID: string): Observable<Webhook> {
|
||||
|
@ -9,21 +9,25 @@
|
||||
u Webhooks
|
||||
.col-xs-6.text-right
|
||||
a.btn.btn-primary((click)="createWebhook()") Создать webhook
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th URL
|
||||
th Статус
|
||||
th
|
||||
tbody(*ngFor="let item of webhooksTableItems")
|
||||
tr
|
||||
td {{item.webhook.url}}
|
||||
td
|
||||
span.label.label-success([ngClass]="{'label-danger': !item.webhook.active}") {{item.webhook.active | kofWebhookStatus}}
|
||||
td
|
||||
.pull-right
|
||||
button.btn.btn-xs.btn-default((click)="toggleWebhookDetailsPanel(item)")
|
||||
| {{item.visible ? 'Скрыть' : 'Показать'}} детали
|
||||
tr(*ngIf="item.visible")
|
||||
td.row(colspan="5")
|
||||
kof-webhook-details([webhook]="item.webhook", (onWebhookDelete)="prepareTableItems()")
|
||||
|
||||
.x_content
|
||||
table.table.table-striped(*ngIf="webhooksTableItems?.length")
|
||||
thead
|
||||
tr
|
||||
th URL
|
||||
th Статус
|
||||
th
|
||||
tbody(*ngFor="let item of webhooksTableItems")
|
||||
tr
|
||||
td {{item.webhook.url}}
|
||||
td
|
||||
span.label.label-success([ngClass]="{'label-danger': !item.webhook.active}") {{item.webhook.active | kofWebhookStatus}}
|
||||
td
|
||||
.pull-right
|
||||
button.btn.btn-xs.btn-default((click)="toggleWebhookDetailsPanel(item)")
|
||||
| {{item.visible ? 'Скрыть' : 'Показать'}} детали
|
||||
tr(*ngIf="item.visible")
|
||||
td.row(colspan="5")
|
||||
kof-webhook-details([webhook]="item.webhook", (onWebhookDelete)="prepareTableItems()")
|
||||
|
||||
div(*ngIf="!webhooksTableItems?.length") Webhook'и отсутствуют
|
||||
|
@ -7,7 +7,7 @@ import { WebhookTableItem } from './webhook-table-item';
|
||||
@Component({
|
||||
templateUrl: './webhooks.component.pug',
|
||||
})
|
||||
export class WebhookComponent implements OnInit {
|
||||
export class WebhooksComponent implements OnInit {
|
||||
|
||||
public webhooksTableItems: WebhookTableItem[];
|
||||
|
@ -2,7 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { WebhookComponent } from './webhook.component';
|
||||
import { WebhooksComponent } from './webhooks.component';
|
||||
import { WebhooksListDetailsComponent } from './webhook-details/webhook-details.component';
|
||||
import { CommonModule } from 'koffing/common/common.module';
|
||||
import { CreateWebhookComponent } from './create-webhook/create-webhook.component';
|
||||
@ -16,7 +16,7 @@ import { WebhookStatusPipe } from './webhook-status.pipe';
|
||||
CommonModule
|
||||
],
|
||||
declarations: [
|
||||
WebhookComponent,
|
||||
WebhooksComponent,
|
||||
WebhooksListDetailsComponent,
|
||||
CreateWebhookComponent,
|
||||
WebhookStatusPipe
|
||||
|
Loading…
Reference in New Issue
Block a user