@alphawebai/hs-prism 0.1.0-rc.28 → 0.1.0-rc.30
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/alphaweb/index.d.ts +2 -0
- package/dist/src/alphaweb/index.js +4 -1
- package/dist/src/alphaweb/manifest.d.ts +30 -2
- package/dist/src/alphaweb/manifest.js +52 -3
- package/dist/src/alphaweb/paypal-connector.d.ts +63 -0
- package/dist/src/alphaweb/paypal-connector.js +1214 -0
- package/dist/src/alphaweb/stripe-connector.js +15 -4
- package/dist/src/alphaweb/types.d.ts +107 -5
- package/dist/src/payments/generated/libconnector_service_ffi.so +0 -0
- package/dist/src/payments/generated/proto.d.ts +145 -1
- package/dist/src/payments/generated/proto.js +383 -0
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './contracts';
|
|
2
|
+
export { PrismPayPalConnector, verifyPrismPayPalRuntimeCredential, } from './paypal-connector';
|
|
3
|
+
export type { PrismPayPalConnectorDependencies } from './paypal-connector';
|
|
2
4
|
export { PrismStripeConnector, verifyPrismStripeRuntimeCredential, } from './stripe-connector';
|
|
3
5
|
export type { PrismStripeConnectorDependencies } from './stripe-connector';
|
|
@@ -14,8 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.verifyPrismStripeRuntimeCredential = exports.PrismStripeConnector = void 0;
|
|
17
|
+
exports.verifyPrismStripeRuntimeCredential = exports.PrismStripeConnector = exports.verifyPrismPayPalRuntimeCredential = exports.PrismPayPalConnector = void 0;
|
|
18
18
|
__exportStar(require("./contracts"), exports);
|
|
19
|
+
var paypal_connector_1 = require("./paypal-connector");
|
|
20
|
+
Object.defineProperty(exports, "PrismPayPalConnector", { enumerable: true, get: function () { return paypal_connector_1.PrismPayPalConnector; } });
|
|
21
|
+
Object.defineProperty(exports, "verifyPrismPayPalRuntimeCredential", { enumerable: true, get: function () { return paypal_connector_1.verifyPrismPayPalRuntimeCredential; } });
|
|
19
22
|
var stripe_connector_1 = require("./stripe-connector");
|
|
20
23
|
Object.defineProperty(exports, "PrismStripeConnector", { enumerable: true, get: function () { return stripe_connector_1.PrismStripeConnector; } });
|
|
21
24
|
Object.defineProperty(exports, "verifyPrismStripeRuntimeCredential", { enumerable: true, get: function () { return stripe_connector_1.verifyPrismStripeRuntimeCredential; } });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const ALPHAWEB_STRIPE_WEBHOOK_EVENTS: readonly ["charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "refund.created", "refund.failed", "refund.updated", "setup_intent.canceled", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded"];
|
|
2
|
+
export declare const ALPHAWEB_PAYPAL_WEBHOOK_EVENTS: readonly ["CHECKOUT.ORDER.APPROVED", "CHECKOUT.ORDER.COMPLETED", "CHECKOUT.ORDER.PROCESSED", "CHECKOUT.PAYMENT-APPROVAL.REVERSED", "CUSTOMER.DISPUTE.CREATED", "CUSTOMER.DISPUTE.RESOLVED", "CUSTOMER.DISPUTE.UPDATED", "PAYMENT.AUTHORIZATION.CREATED", "PAYMENT.AUTHORIZATION.VOIDED", "PAYMENT.CAPTURE.COMPLETED", "PAYMENT.CAPTURE.DECLINED", "PAYMENT.CAPTURE.PENDING", "PAYMENT.CAPTURE.REFUNDED", "PAYMENT.CAPTURE.REVERSED", "PAYMENT.REFUND.FAILED", "PAYMENT.REFUND.PENDING", "RISK.DISPUTE.CREATED", "VAULT.PAYMENT-TOKEN.CREATED", "VAULT.PAYMENT-TOKEN.DELETED", "VAULT.PAYMENT-TOKEN.DELETION-INITIATED"];
|
|
2
3
|
export declare const ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST: Readonly<{
|
|
3
|
-
readonly release: "0.1.0-rc.
|
|
4
|
+
readonly release: "0.1.0-rc.30";
|
|
4
5
|
readonly upstreamCommit: "b07af7d9dac271de729548e74217ddcf895c602b";
|
|
5
6
|
readonly medusaRange: ">=2.17.2 <2.18.0";
|
|
6
7
|
readonly stripeApiVersion: "2026-06-24.dahlia";
|
|
@@ -9,12 +10,39 @@ export declare const ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST: Readonly<{
|
|
|
9
10
|
readonly stripeWebhookEventSetSha256: "5f9eeb16bed529b9dcb66de5985ec34ab8a818a3d9980204dbadd495d409d428";
|
|
10
11
|
readonly stripeWebhookEventSetEncoding: "utf8-sorted-lf-v1";
|
|
11
12
|
readonly stripeJsContract: "payment-element-v1";
|
|
13
|
+
readonly paypalJsContract: "react-sdk-v6";
|
|
14
|
+
readonly paypalPayerIdentityUpstreamCommit: "0ee9a686d92830a1c4733d41bf1160b78dcd3bd5";
|
|
15
|
+
readonly paypalWebhookEvents: readonly ["CHECKOUT.ORDER.APPROVED", "CHECKOUT.ORDER.COMPLETED", "CHECKOUT.ORDER.PROCESSED", "CHECKOUT.PAYMENT-APPROVAL.REVERSED", "CUSTOMER.DISPUTE.CREATED", "CUSTOMER.DISPUTE.RESOLVED", "CUSTOMER.DISPUTE.UPDATED", "PAYMENT.AUTHORIZATION.CREATED", "PAYMENT.AUTHORIZATION.VOIDED", "PAYMENT.CAPTURE.COMPLETED", "PAYMENT.CAPTURE.DECLINED", "PAYMENT.CAPTURE.PENDING", "PAYMENT.CAPTURE.REFUNDED", "PAYMENT.CAPTURE.REVERSED", "PAYMENT.REFUND.FAILED", "PAYMENT.REFUND.PENDING", "RISK.DISPUTE.CREATED", "VAULT.PAYMENT-TOKEN.CREATED", "VAULT.PAYMENT-TOKEN.DELETED", "VAULT.PAYMENT-TOKEN.DELETION-INITIATED"];
|
|
16
|
+
readonly paypalWebhookEventSetSha256: "f3a433f416d547d0d5071c789216e4c0312e9352c09d65d350760c206bb3f10c";
|
|
17
|
+
readonly paypalWebhookEventSetEncoding: "utf8-sorted-lf-v1";
|
|
12
18
|
readonly webhookSchemaVersion: 1;
|
|
13
19
|
readonly reusableReferenceVersion: 1;
|
|
14
20
|
readonly normalizedStatusMappingVersion: 1;
|
|
15
21
|
readonly nativeAbiVersion: 1;
|
|
16
22
|
readonly nativeAbi: readonly ["linux-x64-gnu"];
|
|
17
|
-
readonly connectors: readonly ["stripe"];
|
|
23
|
+
readonly connectors: readonly ["stripe", "paypal"];
|
|
24
|
+
readonly connectorCapabilities: {
|
|
25
|
+
readonly stripe: {
|
|
26
|
+
readonly browserSession: "stripe_payment_element";
|
|
27
|
+
readonly oneTimePayment: true;
|
|
28
|
+
readonly futureUse: true;
|
|
29
|
+
readonly repeatPayment: true;
|
|
30
|
+
readonly refund: true;
|
|
31
|
+
readonly disputeProjection: true;
|
|
32
|
+
readonly webhookParse: true;
|
|
33
|
+
readonly webhookEndpointManagement: true;
|
|
34
|
+
};
|
|
35
|
+
readonly paypal: {
|
|
36
|
+
readonly browserSession: "paypal_checkout";
|
|
37
|
+
readonly oneTimePayment: true;
|
|
38
|
+
readonly futureUse: true;
|
|
39
|
+
readonly repeatPayment: true;
|
|
40
|
+
readonly refund: true;
|
|
41
|
+
readonly disputeProjection: true;
|
|
42
|
+
readonly webhookParse: true;
|
|
43
|
+
readonly webhookEndpointManagement: true;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
18
46
|
readonly features: {
|
|
19
47
|
readonly oneTimePayment: true;
|
|
20
48
|
readonly futureUse: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST = exports.ALPHAWEB_STRIPE_WEBHOOK_EVENTS = void 0;
|
|
3
|
+
exports.ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST = exports.ALPHAWEB_PAYPAL_WEBHOOK_EVENTS = exports.ALPHAWEB_STRIPE_WEBHOOK_EVENTS = void 0;
|
|
4
4
|
exports.ALPHAWEB_STRIPE_WEBHOOK_EVENTS = Object.freeze([
|
|
5
5
|
'charge.dispute.closed',
|
|
6
6
|
'charge.dispute.created',
|
|
@@ -26,8 +26,30 @@ exports.ALPHAWEB_STRIPE_WEBHOOK_EVENTS = Object.freeze([
|
|
|
26
26
|
'setup_intent.setup_failed',
|
|
27
27
|
'setup_intent.succeeded',
|
|
28
28
|
]);
|
|
29
|
+
exports.ALPHAWEB_PAYPAL_WEBHOOK_EVENTS = Object.freeze([
|
|
30
|
+
'CHECKOUT.ORDER.APPROVED',
|
|
31
|
+
'CHECKOUT.ORDER.COMPLETED',
|
|
32
|
+
'CHECKOUT.ORDER.PROCESSED',
|
|
33
|
+
'CHECKOUT.PAYMENT-APPROVAL.REVERSED',
|
|
34
|
+
'CUSTOMER.DISPUTE.CREATED',
|
|
35
|
+
'CUSTOMER.DISPUTE.RESOLVED',
|
|
36
|
+
'CUSTOMER.DISPUTE.UPDATED',
|
|
37
|
+
'PAYMENT.AUTHORIZATION.CREATED',
|
|
38
|
+
'PAYMENT.AUTHORIZATION.VOIDED',
|
|
39
|
+
'PAYMENT.CAPTURE.COMPLETED',
|
|
40
|
+
'PAYMENT.CAPTURE.DECLINED',
|
|
41
|
+
'PAYMENT.CAPTURE.PENDING',
|
|
42
|
+
'PAYMENT.CAPTURE.REFUNDED',
|
|
43
|
+
'PAYMENT.CAPTURE.REVERSED',
|
|
44
|
+
'PAYMENT.REFUND.FAILED',
|
|
45
|
+
'PAYMENT.REFUND.PENDING',
|
|
46
|
+
'RISK.DISPUTE.CREATED',
|
|
47
|
+
'VAULT.PAYMENT-TOKEN.CREATED',
|
|
48
|
+
'VAULT.PAYMENT-TOKEN.DELETED',
|
|
49
|
+
'VAULT.PAYMENT-TOKEN.DELETION-INITIATED',
|
|
50
|
+
]);
|
|
29
51
|
exports.ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST = Object.freeze({
|
|
30
|
-
release: '0.1.0-rc.
|
|
52
|
+
release: '0.1.0-rc.30',
|
|
31
53
|
upstreamCommit: 'b07af7d9dac271de729548e74217ddcf895c602b',
|
|
32
54
|
medusaRange: '>=2.17.2 <2.18.0',
|
|
33
55
|
stripeApiVersion: '2026-06-24.dahlia',
|
|
@@ -36,12 +58,39 @@ exports.ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST = Object.freeze({
|
|
|
36
58
|
stripeWebhookEventSetSha256: '5f9eeb16bed529b9dcb66de5985ec34ab8a818a3d9980204dbadd495d409d428',
|
|
37
59
|
stripeWebhookEventSetEncoding: 'utf8-sorted-lf-v1',
|
|
38
60
|
stripeJsContract: 'payment-element-v1',
|
|
61
|
+
paypalJsContract: 'react-sdk-v6',
|
|
62
|
+
paypalPayerIdentityUpstreamCommit: '0ee9a686d92830a1c4733d41bf1160b78dcd3bd5',
|
|
63
|
+
paypalWebhookEvents: exports.ALPHAWEB_PAYPAL_WEBHOOK_EVENTS,
|
|
64
|
+
paypalWebhookEventSetSha256: 'f3a433f416d547d0d5071c789216e4c0312e9352c09d65d350760c206bb3f10c',
|
|
65
|
+
paypalWebhookEventSetEncoding: 'utf8-sorted-lf-v1',
|
|
39
66
|
webhookSchemaVersion: 1,
|
|
40
67
|
reusableReferenceVersion: 1,
|
|
41
68
|
normalizedStatusMappingVersion: 1,
|
|
42
69
|
nativeAbiVersion: 1,
|
|
43
70
|
nativeAbi: ['linux-x64-gnu'],
|
|
44
|
-
connectors: ['stripe'],
|
|
71
|
+
connectors: ['stripe', 'paypal'],
|
|
72
|
+
connectorCapabilities: {
|
|
73
|
+
stripe: {
|
|
74
|
+
browserSession: 'stripe_payment_element',
|
|
75
|
+
oneTimePayment: true,
|
|
76
|
+
futureUse: true,
|
|
77
|
+
repeatPayment: true,
|
|
78
|
+
refund: true,
|
|
79
|
+
disputeProjection: true,
|
|
80
|
+
webhookParse: true,
|
|
81
|
+
webhookEndpointManagement: true,
|
|
82
|
+
},
|
|
83
|
+
paypal: {
|
|
84
|
+
browserSession: 'paypal_checkout',
|
|
85
|
+
oneTimePayment: true,
|
|
86
|
+
futureUse: true,
|
|
87
|
+
repeatPayment: true,
|
|
88
|
+
refund: true,
|
|
89
|
+
disputeProjection: true,
|
|
90
|
+
webhookParse: true,
|
|
91
|
+
webhookEndpointManagement: true,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
45
94
|
features: {
|
|
46
95
|
oneTimePayment: true,
|
|
47
96
|
futureUse: true,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { types } from '../payments/generated/proto';
|
|
2
|
+
import type { PrismAuthorizeApprovedPaymentInput, PrismCancelInput, PrismCaptureInput, PrismCreateWebhookEndpointInput, PrismDeleteWebhookEndpointInput, PrismDisputeResult, PrismEstablishReusableReferenceInput, PrismFindPaymentInput, PrismFindRefundInput, PrismMerchantOperation, PrismPayPalConnectorOptions, PrismPayPalConnectorV1, PrismPayPalRuntimeVerification, PrismPayPalRuntimeVerificationInput, PrismPaymentResult, PrismRefundInput, PrismRefundResult, PrismRetrieveDisputeInput, PrismRetrievePaymentInput, PrismRetrieveRefundInput, PrismRetrieveWebhookEndpointInput, PrismRetryPaymentInput, PrismReusableReferenceDerivation, PrismUpdateWebhookEndpointInput, PrismWebhookEndpoint, PrismWebhookEndpointCreated, PrismWebhookParseInput, PrismWebhookParseResult } from './types';
|
|
3
|
+
interface MerchantAuthenticationPort {
|
|
4
|
+
createServerAuthenticationToken(input: types.IMerchantAuthenticationServiceCreateServerAuthenticationTokenRequest): Promise<types.MerchantAuthenticationServiceCreateServerAuthenticationTokenResponse>;
|
|
5
|
+
}
|
|
6
|
+
interface PaymentPort {
|
|
7
|
+
authorize(input: types.IPaymentServiceAuthorizeRequest): Promise<types.PaymentServiceAuthorizeResponse>;
|
|
8
|
+
capture(input: types.IPaymentServiceCaptureRequest): Promise<types.PaymentServiceCaptureResponse>;
|
|
9
|
+
createOrder(input: types.IPaymentServiceCreateOrderRequest): Promise<types.PaymentServiceCreateOrderResponse>;
|
|
10
|
+
get(input: types.IPaymentServiceGetRequest): Promise<types.PaymentServiceGetResponse>;
|
|
11
|
+
refund(input: types.IPaymentServiceRefundRequest): Promise<types.RefundResponse>;
|
|
12
|
+
void(input: types.IPaymentServiceVoidRequest): Promise<types.PaymentServiceVoidResponse>;
|
|
13
|
+
}
|
|
14
|
+
interface RecurringPaymentPort {
|
|
15
|
+
charge(input: types.IRecurringPaymentServiceChargeRequest): Promise<types.RecurringPaymentServiceChargeResponse>;
|
|
16
|
+
}
|
|
17
|
+
interface RefundPort {
|
|
18
|
+
refundGet(input: types.IRefundServiceGetRequest): Promise<types.RefundResponse>;
|
|
19
|
+
}
|
|
20
|
+
export interface PrismPayPalConnectorDependencies {
|
|
21
|
+
merchantAuthentication: MerchantAuthenticationPort;
|
|
22
|
+
payments: PaymentPort;
|
|
23
|
+
recurringPayments: RecurringPaymentPort;
|
|
24
|
+
refunds: RefundPort;
|
|
25
|
+
fetch: typeof fetch;
|
|
26
|
+
}
|
|
27
|
+
export declare class PrismPayPalConnector implements PrismPayPalConnectorV1 {
|
|
28
|
+
readonly options: Readonly<PrismPayPalConnectorOptions>;
|
|
29
|
+
private readonly dependencies;
|
|
30
|
+
private accessToken;
|
|
31
|
+
constructor(options: PrismPayPalConnectorOptions, dependencies?: PrismPayPalConnectorDependencies);
|
|
32
|
+
private validateOptions;
|
|
33
|
+
private assertOperation;
|
|
34
|
+
private connectorState;
|
|
35
|
+
private paypalRequest;
|
|
36
|
+
private retrievePayPalVaultState;
|
|
37
|
+
createPayment(input: PrismMerchantOperation): Promise<PrismPaymentResult>;
|
|
38
|
+
authorizeApprovedPayment(input: PrismAuthorizeApprovedPaymentInput): Promise<PrismPaymentResult>;
|
|
39
|
+
repeatPayment(input: PrismMerchantOperation): Promise<PrismPaymentResult>;
|
|
40
|
+
retryPayment(input: PrismRetryPaymentInput): Promise<PrismPaymentResult>;
|
|
41
|
+
retrievePayment(input: PrismRetrievePaymentInput): Promise<PrismPaymentResult>;
|
|
42
|
+
establishReusableReference(input: PrismEstablishReusableReferenceInput): Promise<PrismReusableReferenceDerivation>;
|
|
43
|
+
findPaymentsByMerchantOperation(_input: PrismFindPaymentInput): Promise<PrismPaymentResult[]>;
|
|
44
|
+
capturePayment(input: PrismCaptureInput): Promise<PrismPaymentResult>;
|
|
45
|
+
cancelPayment(input: PrismCancelInput): Promise<PrismPaymentResult>;
|
|
46
|
+
refundPayment(input: PrismRefundInput): Promise<PrismRefundResult>;
|
|
47
|
+
retrieveRefund(input: PrismRetrieveRefundInput): Promise<PrismRefundResult>;
|
|
48
|
+
findRefundsByMerchantOperation(_input: PrismFindRefundInput): Promise<PrismRefundResult[]>;
|
|
49
|
+
retrieveDispute(input: PrismRetrieveDisputeInput): Promise<PrismDisputeResult>;
|
|
50
|
+
parseWebhookEvent(input: PrismWebhookParseInput): Promise<PrismWebhookParseResult>;
|
|
51
|
+
createWebhookEndpoint(input: PrismCreateWebhookEndpointInput): Promise<PrismWebhookEndpointCreated>;
|
|
52
|
+
updateWebhookEndpoint(input: PrismUpdateWebhookEndpointInput): Promise<PrismWebhookEndpoint>;
|
|
53
|
+
deleteWebhookEndpoint(input: PrismDeleteWebhookEndpointInput): Promise<void>;
|
|
54
|
+
retrieveWebhookEndpoint(input: PrismRetrieveWebhookEndpointInput): Promise<PrismWebhookEndpoint>;
|
|
55
|
+
private normalizeEndpoint;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Verifies a PayPal REST application credential pair and constructs the pinned
|
|
59
|
+
* native connector. The browser-safe client ID is the stable provider binding
|
|
60
|
+
* identity; no secret or access token is returned.
|
|
61
|
+
*/
|
|
62
|
+
export declare function verifyPrismPayPalRuntimeCredential(input: PrismPayPalRuntimeVerificationInput, dependencies?: PrismPayPalConnectorDependencies): Promise<PrismPayPalRuntimeVerification>;
|
|
63
|
+
export {};
|