@ngn-net/payment-provider-sdk 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,7 +74,8 @@ export type StripeEvent<T extends keyof EventDataMap = keyof EventDataMap> = {
74
74
  type: T;
75
75
  data: EventDataMap[T];
76
76
  };
77
- export interface RPCResponse<T> {
77
+ export interface EventResponse<T> {
78
+ correlationId: string;
78
79
  code: number;
79
80
  message: string;
80
81
  data: T;
@@ -0,0 +1,79 @@
1
+ export interface NPGetPayment {
2
+ payment_id: number;
3
+ invoice_id: number | null;
4
+ payment_status: "waiting" | "confirming" | "confirmed" | "sending" | "partially_paid" | "finished" | "failed" | "refunded" | "expired";
5
+ pay_address: string;
6
+ payin_extra_id: string | null;
7
+ price_amount: number;
8
+ price_currency: string;
9
+ pay_amount: number;
10
+ actually_paid: number;
11
+ pay_currency: string;
12
+ order_id: string;
13
+ order_description: string;
14
+ purchase_id: number;
15
+ outcome_amount: number;
16
+ outcome_currency: string;
17
+ payout_hash: string | null;
18
+ payin_hash: string | null;
19
+ created_at: string;
20
+ updated_at: string;
21
+ burning_percent: string | null;
22
+ type: "crypto2crypto" | "crypto2fiat";
23
+ }
24
+ export interface NowPaymentsFee {
25
+ currency: string;
26
+ depositFee: number;
27
+ serviceFee: number;
28
+ withdrawalFee: number;
29
+ }
30
+ export type PaymentStatus = "waiting" | "confirming" | "partially_paid" | "confirmed" | "sending" | "finished" | "failed" | "expired";
31
+ export interface NowPaymentsPaymentCallback {
32
+ actually_paid: number;
33
+ actually_paid_at_fiat: number;
34
+ fee: NowPaymentsFee;
35
+ invoice_id: string | null;
36
+ order_description: string;
37
+ order_id: string;
38
+ outcome_amount: number;
39
+ outcome_currency: string;
40
+ parent_payment_id: number | null;
41
+ pay_address: string;
42
+ pay_amount: number;
43
+ pay_currency: string;
44
+ payin_extra_id: string | null;
45
+ payment_extra_ids: string | null;
46
+ payment_id: string;
47
+ payment_status: PaymentStatus;
48
+ price_amount: number;
49
+ price_currency: string;
50
+ purchase_id: string;
51
+ updated_at: number;
52
+ }
53
+ export interface NowPaymentMinAmount {
54
+ fiat_equivalent: number;
55
+ min_amout: number;
56
+ }
57
+ export interface NowPaymentsCreatePaymentResponse {
58
+ payment_id: string;
59
+ payment_status: PaymentStatus;
60
+ pay_address: string;
61
+ price_amount: number;
62
+ price_currency: string;
63
+ pay_amount: number;
64
+ pay_currency: string;
65
+ order_id: string;
66
+ order_description: string;
67
+ ipn_callback_url: string;
68
+ created_at: string;
69
+ updated_at: string;
70
+ purchase_id: string;
71
+ amount_received: number | null;
72
+ payin_extra_id: string | null;
73
+ smart_contract: string;
74
+ network: string;
75
+ network_precision: number;
76
+ time_limit: number | null;
77
+ burning_percent: number | null;
78
+ expiration_estimate_date: string;
79
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import { CreateStripeCheckoutDto, CreateStripePaymentIntentDto } from "./dto/stripe.dto";
2
2
  import { AmqpConnection } from "@golevelup/nestjs-rabbitmq";
3
- import { CreateCryptoIntentResponse, CreateStripeCheckoutResponse, CreateStripePaymentIntentResponse, PaymentEvent } from "./dto/common.interface";
3
+ import { CreateCryptoIntentResponse, CreateStripeCheckoutResponse, CreateStripePaymentIntentResponse } from "./dto/common.interface";
4
4
  import { CreateCryptoPaymentDto } from "./dto/crypto.dto";
5
5
  export declare class PaymentProvider {
6
6
  private readonly rabbit;
@@ -8,5 +8,4 @@ export declare class PaymentProvider {
8
8
  createStripeCheckout(payload: CreateStripeCheckoutDto): Promise<CreateStripeCheckoutResponse>;
9
9
  createStripePaymentIntent(payload: CreateStripePaymentIntentDto): Promise<CreateStripePaymentIntentResponse>;
10
10
  createCryptoPayment(payload: CreateCryptoPaymentDto): Promise<CreateCryptoIntentResponse>;
11
- emitPaymentEvent(event: PaymentEvent): Promise<void>;
12
11
  }
@@ -51,9 +51,6 @@ let PaymentProvider = class PaymentProvider {
51
51
  }
52
52
  return res.data;
53
53
  }
54
- async emitPaymentEvent(event) {
55
- await this.rabbit.publish(common_interface_1.PaymentRabbitApi.exchange, common_interface_1.PaymentRabbitApi.routingkeys.events.key, event);
56
- }
57
54
  };
58
55
  exports.PaymentProvider = PaymentProvider;
59
56
  exports.PaymentProvider = PaymentProvider = __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngn-net/payment-provider-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Payment provider SDK",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",