hs-playlib 0.6.0 → 0.7.0
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.
- package/dist/src/payments/_generated_connector_client_flows.d.ts +8 -0
- package/dist/src/payments/_generated_connector_client_flows.js +16 -1
- package/dist/src/payments/_generated_flows.js +9 -0
- package/dist/src/payments/_generated_uniffi_client_flows.d.ts +12 -0
- package/dist/src/payments/_generated_uniffi_client_flows.js +24 -0
- package/dist/src/payments/connector_client.d.ts +1 -1
- package/dist/src/payments/connector_client.js +7 -6
- package/dist/src/payments/generated/libconnector_service_ffi.dylib +0 -0
- package/dist/src/payments/generated/proto.d.ts +2569 -1753
- package/dist/src/payments/generated/proto.js +7718 -4547
- package/dist/src/payments/uniffi_client.js +9 -0
- package/package.json +2 -2
|
@@ -4,6 +4,14 @@ export declare class CustomerClient extends _ConnectorClientBase {
|
|
|
4
4
|
/** CustomerService.Create — Create customer record in the payment processor system. Stores customer details for future payment operations without re-sending personal information. */
|
|
5
5
|
create(requestMsg: types.ICustomerServiceCreateRequest, options?: types.IRequestConfig | null): Promise<types.CustomerServiceCreateResponse>;
|
|
6
6
|
}
|
|
7
|
+
export declare class DisputeClient extends _ConnectorClientBase {
|
|
8
|
+
/** DisputeService.Accept — Concede dispute and accepts chargeback loss. Acknowledges liability and stops dispute defense process when evidence is insufficient. */
|
|
9
|
+
accept(requestMsg: types.IDisputeServiceAcceptRequest, options?: types.IRequestConfig | null): Promise<types.DisputeServiceAcceptResponse>;
|
|
10
|
+
/** DisputeService.Defend — Submit defense with reason code for dispute. Presents formal argument against customer's chargeback claim with supporting documentation. */
|
|
11
|
+
defend(requestMsg: types.IDisputeServiceDefendRequest, options?: types.IRequestConfig | null): Promise<types.DisputeServiceDefendResponse>;
|
|
12
|
+
/** DisputeService.SubmitEvidence — Upload evidence to dispute customer chargeback. Provides documentation like receipts and delivery proof to contest fraudulent transaction claims. */
|
|
13
|
+
submitEvidence(requestMsg: types.IDisputeServiceSubmitEvidenceRequest, options?: types.IRequestConfig | null): Promise<types.DisputeServiceSubmitEvidenceResponse>;
|
|
14
|
+
}
|
|
7
15
|
export declare class EventClient extends _ConnectorClientBase {
|
|
8
16
|
/** EventService.HandleEvent — Process webhook notifications from connectors. Translates connector events into standardized responses for asynchronous payment state updates. */
|
|
9
17
|
handleEvent(requestMsg: types.IEventServiceHandleRequest, options?: types.IRequestConfig | null): Promise<types.EventServiceHandleResponse>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED — do not edit by hand.
|
|
3
3
|
// Source: services.proto ∩ bindings/uniffi.rs | Regenerate: make generate
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.RecurringPaymentClient = exports.PaymentClient = exports.PaymentMethodClient = exports.PaymentMethodAuthenticationClient = exports.MerchantAuthenticationClient = exports.EventClient = exports.CustomerClient = void 0;
|
|
5
|
+
exports.RecurringPaymentClient = exports.PaymentClient = exports.PaymentMethodClient = exports.PaymentMethodAuthenticationClient = exports.MerchantAuthenticationClient = exports.EventClient = exports.DisputeClient = exports.CustomerClient = void 0;
|
|
6
6
|
const connector_client_1 = require("./connector_client");
|
|
7
7
|
class CustomerClient extends connector_client_1.ConnectorClient {
|
|
8
8
|
/** CustomerService.Create — Create customer record in the payment processor system. Stores customer details for future payment operations without re-sending personal information. */
|
|
@@ -11,6 +11,21 @@ class CustomerClient extends connector_client_1.ConnectorClient {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.CustomerClient = CustomerClient;
|
|
14
|
+
class DisputeClient extends connector_client_1.ConnectorClient {
|
|
15
|
+
/** DisputeService.Accept — Concede dispute and accepts chargeback loss. Acknowledges liability and stops dispute defense process when evidence is insufficient. */
|
|
16
|
+
async accept(requestMsg, options) {
|
|
17
|
+
return this._executeFlow('accept', requestMsg, options, 'DisputeServiceAcceptRequest', 'DisputeServiceAcceptResponse');
|
|
18
|
+
}
|
|
19
|
+
/** DisputeService.Defend — Submit defense with reason code for dispute. Presents formal argument against customer's chargeback claim with supporting documentation. */
|
|
20
|
+
async defend(requestMsg, options) {
|
|
21
|
+
return this._executeFlow('defend', requestMsg, options, 'DisputeServiceDefendRequest', 'DisputeServiceDefendResponse');
|
|
22
|
+
}
|
|
23
|
+
/** DisputeService.SubmitEvidence — Upload evidence to dispute customer chargeback. Provides documentation like receipts and delivery proof to contest fraudulent transaction claims. */
|
|
24
|
+
async submitEvidence(requestMsg, options) {
|
|
25
|
+
return this._executeFlow('submit_evidence', requestMsg, options, 'DisputeServiceSubmitEvidenceRequest', 'DisputeServiceSubmitEvidenceResponse');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DisputeClient = DisputeClient;
|
|
14
29
|
class EventClient extends connector_client_1.ConnectorClient {
|
|
15
30
|
/** EventService.HandleEvent — Process webhook notifications from connectors. Translates connector events into standardized responses for asynchronous payment state updates. */
|
|
16
31
|
async handleEvent(requestMsg, options) {
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
"use strict";
|
|
4
4
|
|
|
5
5
|
const FLOWS = {
|
|
6
|
+
// accept: DisputeService.Accept — Concede dispute and accepts chargeback loss. Acknowledges liability and stops dispute defense process when evidence is insufficient.
|
|
7
|
+
accept : { request: "DisputeServiceAcceptRequest", response: "DisputeServiceAcceptResponse" },
|
|
8
|
+
|
|
6
9
|
// authenticate: PaymentMethodAuthenticationService.Authenticate — Execute 3DS challenge or frictionless verification. Authenticates customer via bank challenge or behind-the-scenes verification for fraud prevention.
|
|
7
10
|
authenticate : { request: "PaymentMethodAuthenticationServiceAuthenticateRequest", response: "PaymentMethodAuthenticationServiceAuthenticateResponse" },
|
|
8
11
|
|
|
@@ -27,6 +30,9 @@ const FLOWS = {
|
|
|
27
30
|
// create_session_token: MerchantAuthenticationService.CreateSessionToken — Create session token for payment processing. Maintains session state across multiple payment operations for improved security and tracking.
|
|
28
31
|
create_session_token : { request: "MerchantAuthenticationServiceCreateSessionTokenRequest", response: "MerchantAuthenticationServiceCreateSessionTokenResponse" },
|
|
29
32
|
|
|
33
|
+
// defend: DisputeService.Defend — Submit defense with reason code for dispute. Presents formal argument against customer's chargeback claim with supporting documentation.
|
|
34
|
+
defend : { request: "DisputeServiceDefendRequest", response: "DisputeServiceDefendResponse" },
|
|
35
|
+
|
|
30
36
|
// get: PaymentService.Get — Retrieve current payment status from the payment processor. Enables synchronization between your system and payment processors for accurate state tracking.
|
|
31
37
|
get : { request: "PaymentServiceGetRequest", response: "PaymentServiceGetResponse" },
|
|
32
38
|
|
|
@@ -45,6 +51,9 @@ const FLOWS = {
|
|
|
45
51
|
// setup_recurring: PaymentService.SetupRecurring — Setup a recurring payment instruction for future payments/ debits. This could be for SaaS subscriptions, monthly bill payments, insurance payments and similar use cases.
|
|
46
52
|
setup_recurring : { request: "PaymentServiceSetupRecurringRequest", response: "PaymentServiceSetupRecurringResponse" },
|
|
47
53
|
|
|
54
|
+
// submit_evidence: DisputeService.SubmitEvidence — Upload evidence to dispute customer chargeback. Provides documentation like receipts and delivery proof to contest fraudulent transaction claims.
|
|
55
|
+
submit_evidence : { request: "DisputeServiceSubmitEvidenceRequest", response: "DisputeServiceSubmitEvidenceResponse" },
|
|
56
|
+
|
|
48
57
|
// tokenize: PaymentMethodService.Tokenize — Tokenize payment method for secure storage. Replaces raw card details with secure token for one-click payments and recurring billing.
|
|
49
58
|
tokenize : { request: "PaymentMethodServiceTokenizeRequest", response: "PaymentMethodServiceTokenizeResponse" },
|
|
50
59
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { UniffiClient as _UniffiClientBase } from "./uniffi_client";
|
|
2
2
|
export declare class UniffiClient extends _UniffiClientBase {
|
|
3
|
+
/** Build connector HTTP request for accept flow. */
|
|
4
|
+
acceptReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
5
|
+
/** Parse connector HTTP response for accept flow. */
|
|
6
|
+
acceptRes(responseBytes: Buffer | Uint8Array, requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
3
7
|
/** Build connector HTTP request for authenticate flow. */
|
|
4
8
|
authenticateReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
5
9
|
/** Parse connector HTTP response for authenticate flow. */
|
|
@@ -32,6 +36,10 @@ export declare class UniffiClient extends _UniffiClientBase {
|
|
|
32
36
|
createSessionTokenReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
33
37
|
/** Parse connector HTTP response for create_session_token flow. */
|
|
34
38
|
createSessionTokenRes(responseBytes: Buffer | Uint8Array, requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
39
|
+
/** Build connector HTTP request for defend flow. */
|
|
40
|
+
defendReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
41
|
+
/** Parse connector HTTP response for defend flow. */
|
|
42
|
+
defendRes(responseBytes: Buffer | Uint8Array, requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
35
43
|
/** Build connector HTTP request for get flow. */
|
|
36
44
|
getReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
37
45
|
/** Parse connector HTTP response for get flow. */
|
|
@@ -56,6 +64,10 @@ export declare class UniffiClient extends _UniffiClientBase {
|
|
|
56
64
|
setupRecurringReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
57
65
|
/** Parse connector HTTP response for setup_recurring flow. */
|
|
58
66
|
setupRecurringRes(responseBytes: Buffer | Uint8Array, requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
67
|
+
/** Build connector HTTP request for submit_evidence flow. */
|
|
68
|
+
submitEvidenceReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
69
|
+
/** Parse connector HTTP response for submit_evidence flow. */
|
|
70
|
+
submitEvidenceRes(responseBytes: Buffer | Uint8Array, requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
59
71
|
/** Build connector HTTP request for tokenize flow. */
|
|
60
72
|
tokenizeReq(requestBytes: Buffer | Uint8Array, optionsBytes: Buffer | Uint8Array): Buffer;
|
|
61
73
|
/** Parse connector HTTP response for tokenize flow. */
|
|
@@ -5,6 +5,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.UniffiClient = void 0;
|
|
6
6
|
const uniffi_client_1 = require("./uniffi_client");
|
|
7
7
|
class UniffiClient extends uniffi_client_1.UniffiClient {
|
|
8
|
+
/** Build connector HTTP request for accept flow. */
|
|
9
|
+
acceptReq(requestBytes, optionsBytes) {
|
|
10
|
+
return this.callReq('accept', requestBytes, optionsBytes);
|
|
11
|
+
}
|
|
12
|
+
/** Parse connector HTTP response for accept flow. */
|
|
13
|
+
acceptRes(responseBytes, requestBytes, optionsBytes) {
|
|
14
|
+
return this.callRes('accept', responseBytes, requestBytes, optionsBytes);
|
|
15
|
+
}
|
|
8
16
|
/** Build connector HTTP request for authenticate flow. */
|
|
9
17
|
authenticateReq(requestBytes, optionsBytes) {
|
|
10
18
|
return this.callReq('authenticate', requestBytes, optionsBytes);
|
|
@@ -69,6 +77,14 @@ class UniffiClient extends uniffi_client_1.UniffiClient {
|
|
|
69
77
|
createSessionTokenRes(responseBytes, requestBytes, optionsBytes) {
|
|
70
78
|
return this.callRes('create_session_token', responseBytes, requestBytes, optionsBytes);
|
|
71
79
|
}
|
|
80
|
+
/** Build connector HTTP request for defend flow. */
|
|
81
|
+
defendReq(requestBytes, optionsBytes) {
|
|
82
|
+
return this.callReq('defend', requestBytes, optionsBytes);
|
|
83
|
+
}
|
|
84
|
+
/** Parse connector HTTP response for defend flow. */
|
|
85
|
+
defendRes(responseBytes, requestBytes, optionsBytes) {
|
|
86
|
+
return this.callRes('defend', responseBytes, requestBytes, optionsBytes);
|
|
87
|
+
}
|
|
72
88
|
/** Build connector HTTP request for get flow. */
|
|
73
89
|
getReq(requestBytes, optionsBytes) {
|
|
74
90
|
return this.callReq('get', requestBytes, optionsBytes);
|
|
@@ -117,6 +133,14 @@ class UniffiClient extends uniffi_client_1.UniffiClient {
|
|
|
117
133
|
setupRecurringRes(responseBytes, requestBytes, optionsBytes) {
|
|
118
134
|
return this.callRes('setup_recurring', responseBytes, requestBytes, optionsBytes);
|
|
119
135
|
}
|
|
136
|
+
/** Build connector HTTP request for submit_evidence flow. */
|
|
137
|
+
submitEvidenceReq(requestBytes, optionsBytes) {
|
|
138
|
+
return this.callReq('submit_evidence', requestBytes, optionsBytes);
|
|
139
|
+
}
|
|
140
|
+
/** Parse connector HTTP response for submit_evidence flow. */
|
|
141
|
+
submitEvidenceRes(responseBytes, requestBytes, optionsBytes) {
|
|
142
|
+
return this.callRes('submit_evidence', responseBytes, requestBytes, optionsBytes);
|
|
143
|
+
}
|
|
120
144
|
/** Build connector HTTP request for tokenize flow. */
|
|
121
145
|
tokenizeReq(requestBytes, optionsBytes) {
|
|
122
146
|
return this.callReq('tokenize', requestBytes, optionsBytes);
|
|
@@ -20,7 +20,7 @@ export declare class ConnectorClient {
|
|
|
20
20
|
/**
|
|
21
21
|
* Initialize the client with mandatory config and optional request defaults.
|
|
22
22
|
*
|
|
23
|
-
* @param config - Immutable connector
|
|
23
|
+
* @param config - Immutable connector config and environment (ConnectorSpecificConfig, SdkOptions).
|
|
24
24
|
* @param defaults - Optional per-request defaults (Http, Vault).
|
|
25
25
|
* @param libPath - optional path to the UniFFI shared library.
|
|
26
26
|
*/
|
|
@@ -27,7 +27,7 @@ class ConnectorClient {
|
|
|
27
27
|
/**
|
|
28
28
|
* Initialize the client with mandatory config and optional request defaults.
|
|
29
29
|
*
|
|
30
|
-
* @param config - Immutable connector
|
|
30
|
+
* @param config - Immutable connector config and environment (ConnectorSpecificConfig, SdkOptions).
|
|
31
31
|
* @param defaults - Optional per-request defaults (Http, Vault).
|
|
32
32
|
* @param libPath - optional path to the UniFFI shared library.
|
|
33
33
|
*/
|
|
@@ -35,8 +35,10 @@ class ConnectorClient {
|
|
|
35
35
|
this.uniffi = new uniffi_client_1.UniffiClient(libPath);
|
|
36
36
|
this.config = proto_1.types.ConnectorConfig.create(config);
|
|
37
37
|
this.defaults = defaults;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const hasConnectorVariant = !!config.connectorConfig
|
|
39
|
+
&& Object.values(config.connectorConfig).some((value) => value != null);
|
|
40
|
+
if (!hasConnectorVariant) {
|
|
41
|
+
throw new http_client_1.ConnectorError("connectorConfig with a connector variant is required in ConnectorConfig", 400, "CLIENT_INITIALIZATION");
|
|
40
42
|
}
|
|
41
43
|
// Instance-level cache: create the primary connection pool at startup
|
|
42
44
|
this.dispatcher = (0, http_client_1.createDispatcher)(defaults.http || {});
|
|
@@ -57,9 +59,8 @@ class ConnectorClient {
|
|
|
57
59
|
caCert: overrideHttp.caCert ?? clientHttp.caCert,
|
|
58
60
|
};
|
|
59
61
|
const ffi = proto_1.types.FfiOptions.create({
|
|
60
|
-
environment: this.config.environment ?? proto_1.types.Environment.SANDBOX,
|
|
61
|
-
|
|
62
|
-
auth: this.config.auth,
|
|
62
|
+
environment: this.config.options?.environment ?? proto_1.types.Environment.SANDBOX,
|
|
63
|
+
connectorConfig: this.config.connectorConfig,
|
|
63
64
|
});
|
|
64
65
|
return { ffi, http };
|
|
65
66
|
}
|
|
Binary file
|