@primer-io/primer-js 1.4.3 → 1.5.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ccab0db: feat(sdk-core,primer-js): add custom 3ds dialogs events
8
+ - 56b0d25: fix: full page redirects instead of popups on mobile
9
+ - 7852ebf: fix(bdc): improve security around state processor loading
10
+
11
+ ## 1.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 47378b6: feat: re-evaluate payment methods after `refreshClientSession`
16
+
17
+ After `primer.refreshSession()`, payment methods filtered out by Checkout
18
+ Builder visibility rules now disappear from the rendered list instead of
19
+ staying visible. `refreshClientSession` diffs the new configuration against
20
+ the in-memory payment methods, reconciles the shared list in place, and fires
21
+ a new `onAvailablePaymentMethodsRefresh` callback. `refreshSession()` is a
22
+ no-op (with a `[PRIMER]` warning) while a payment is in progress so methods
23
+ can't be yanked out from under the user mid-flow.
24
+
25
+ ### Patch Changes
26
+
27
+ - 8971d41: fix: stop firing false `primer:payment-failure` events for settled payments
28
+
29
+ Three contract fixes for the false-failure class behind the Easol duplicate
30
+ charges (ESC-980). Resume (`POST /payments/{id}/resume`) can answer HTTP 202
31
+ `NoActionsToHandle` while the processor authorisation is still in flight; the
32
+ SDK misread that as an inconsistent state and fired a payment-failure ~2s
33
+ before the AUTHORIZED webhook landed. `resumePaymentUntilSettled` now re-polls
34
+ the unconsumed resume token (2s interval, 30s window) until the payment
35
+ settles, and on window exhaustion fails honestly with the payment id instead
36
+ of claiming failure. `processPayment` no longer drops the created payment's
37
+ `id` when the resume response is leaner, and failure events now surface the
38
+ request `X-Request-Id` as `diagnosticsId` (including for errors deserialized
39
+ across the hosted-pages `postMessage` boundary) so failures are reconcilable
40
+ with backend logs.
41
+
3
42
  ## 1.4.3
4
43
 
5
44
  ### Patch Changes
package/README.md CHANGED
@@ -101,6 +101,33 @@ checkout.addEventListener('primer:state-change', (event) => {
101
101
  });
102
102
  ```
103
103
 
104
+ ### `primer:payment-approval-required` (MANUAL approval flow)
105
+
106
+ Emitted in the MANUAL approval flow when the payment is awaiting the merchant's
107
+ explicit approval. Send `clientSessionId` and `paymentAttemptId` to your
108
+ backend (which calls `/approve` or `/abort`), then call `continueFlow()` to let
109
+ the SDK fetch the session and resolve the result.
110
+
111
+ ```javascript
112
+ checkout.addEventListener('primer:payment-approval-required', async (event) => {
113
+ const {
114
+ clientSessionId,
115
+ paymentAttemptId,
116
+ paymentMethodToken,
117
+ continueFlow,
118
+ } = event.detail;
119
+
120
+ const response = await fetch('/my-backend/handle-payment-approval', {
121
+ method: 'POST',
122
+ body: JSON.stringify({ clientSessionId, paymentAttemptId }),
123
+ });
124
+
125
+ if (response.ok) {
126
+ await continueFlow();
127
+ }
128
+ });
129
+ ```
130
+
104
131
  ## Support
105
132
 
106
133
  - **Documentation**: [Web Components Documentation](https://primer.io/docs/sdk/primer-checkout-web/sdk-reference-overview)