@ngn-net/payment-provider-sdk 1.0.14 → 1.0.15
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.
|
@@ -67,6 +67,11 @@ export interface RpcEnvelope<T = unknown> extends RpcClientContext {
|
|
|
67
67
|
export interface GetIntentByOrderId {
|
|
68
68
|
orderId: string;
|
|
69
69
|
}
|
|
70
|
+
export interface RefundStripeIntentDto {
|
|
71
|
+
orderId: string;
|
|
72
|
+
/** USD dollars — set for a partial refund; omit/undefined for full */
|
|
73
|
+
amountUsd?: number;
|
|
74
|
+
}
|
|
70
75
|
export interface UpdatePaymentMethodDto {
|
|
71
76
|
name: string;
|
|
72
77
|
enabled: boolean;
|
|
@@ -114,10 +119,10 @@ export interface StripePaymentCompleteEvent {
|
|
|
114
119
|
}
|
|
115
120
|
export interface CreateCryptoIntentResponse {
|
|
116
121
|
id: string;
|
|
117
|
-
paymentId
|
|
122
|
+
paymentId?: string | null;
|
|
118
123
|
amount: number;
|
|
119
|
-
payAdress
|
|
120
|
-
payAmount
|
|
124
|
+
payAdress?: string | null;
|
|
125
|
+
payAmount?: number | null;
|
|
121
126
|
invoiceUrl?: string;
|
|
122
127
|
invoiceId?: string;
|
|
123
128
|
}
|
|
@@ -134,6 +139,10 @@ export interface NPCompleteEvent {
|
|
|
134
139
|
orderId: string;
|
|
135
140
|
amount: number;
|
|
136
141
|
amountRecieved: number;
|
|
142
|
+
/** crypto units the customer paid (e.g. 0.003) */
|
|
143
|
+
payAmount?: number | null;
|
|
144
|
+
/** asset ticker (btc, trx, …) */
|
|
145
|
+
payCurrency?: string | null;
|
|
137
146
|
}
|
|
138
147
|
export interface EventDataMap {
|
|
139
148
|
stripe_succeeded: StripePaymentCompleteEvent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateStripeCheckoutDto, CreateStripePaymentIntentDto } from "./dto/stripe.dto";
|
|
2
2
|
import { AmqpConnection } from "@golevelup/nestjs-rabbitmq";
|
|
3
|
-
import { AvailableMethodsResponse, CreateCryptoIntentResponse, CreateStripeCheckoutResponse, CreateStripePaymentIntentResponse, GetIntentByOrderId, IntentStatusResult, OrderActionResponse, UpdatePaymentMethodDto } from "./dto/common.interface";
|
|
3
|
+
import { AvailableMethodsResponse, CreateCryptoIntentResponse, CreateStripeCheckoutResponse, CreateStripePaymentIntentResponse, GetIntentByOrderId, IntentStatusResult, OrderActionResponse, RefundStripeIntentDto, UpdatePaymentMethodDto } from "./dto/common.interface";
|
|
4
4
|
import { CreateCryptoPaymentDto } from "./dto/crypto.dto";
|
|
5
5
|
export interface PaymentProviderOptions {
|
|
6
6
|
serviceName: string;
|
|
@@ -19,7 +19,7 @@ export declare class PaymentProvider {
|
|
|
19
19
|
createCryptoPayment(payload: CreateCryptoPaymentDto): Promise<CreateCryptoIntentResponse>;
|
|
20
20
|
getIntentStatus(payload: GetIntentByOrderId): Promise<IntentStatusResult | null>;
|
|
21
21
|
markShipped(payload: GetIntentByOrderId): Promise<OrderActionResponse>;
|
|
22
|
-
refundStripeIntent(payload:
|
|
22
|
+
refundStripeIntent(payload: RefundStripeIntentDto): Promise<OrderActionResponse>;
|
|
23
23
|
cancelStripeIntent(payload: GetIntentByOrderId): Promise<OrderActionResponse>;
|
|
24
24
|
getAvailableMethods(): Promise<AvailableMethodsResponse>;
|
|
25
25
|
setPaymentMethodEnabled(payload: UpdatePaymentMethodDto): Promise<AvailableMethodsResponse>;
|
package/dist/payment.provider.js
CHANGED
|
@@ -76,7 +76,8 @@ let PaymentProvider = PaymentProvider_1 = class PaymentProvider {
|
|
|
76
76
|
async markShipped(payload) {
|
|
77
77
|
return this.request(common_interface_1.PaymentRabbitApi.routingkeys.stripe_ship.key, payload);
|
|
78
78
|
}
|
|
79
|
-
/// Refund a Stripe intent
|
|
79
|
+
/// Refund a Stripe intent. Pass `amountUsd` for a partial refund;
|
|
80
|
+
/// omit it for a full refund.
|
|
80
81
|
async refundStripeIntent(payload) {
|
|
81
82
|
return this.request(common_interface_1.PaymentRabbitApi.routingkeys.stripe_refund.key, payload);
|
|
82
83
|
}
|