@delopay/sdk 0.271.0 → 0.274.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/index.cjs CHANGED
@@ -7846,8 +7846,9 @@ var BuyerAccount = class {
7846
7846
  });
7847
7847
  }
7848
7848
  /**
7849
- * A message from a confirmed record to one of its shops. Sending again with
7850
- * the same `client_message_id` returns the message the first send stored.
7849
+ * A message from a confirmed record to one of its shops. A message to a
7850
+ * closed conversation reopens it. Sending again with the same
7851
+ * `client_message_id` returns the message the first send stored.
7851
7852
  */
7852
7853
  async sendRecordMessage(record, message, options) {
7853
7854
  return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
@@ -8074,8 +8075,9 @@ var BuyerPortal = class {
8074
8075
  });
8075
8076
  }
8076
8077
  /**
8077
- * A message to the shop. Sending again with the same `client_message_id`
8078
- * returns the message the first send stored; a closed conversation refuses it.
8078
+ * A message to the shop. A message to a closed conversation reopens it.
8079
+ * Sending again with the same `client_message_id` returns the message the
8080
+ * first send stored.
8079
8081
  */
8080
8082
  async sendMessage(message, options) {
8081
8083
  return this.request("POST", "/buyer-portal/messages", { body: message, ...options });
@@ -12793,6 +12795,12 @@ var CheckoutSession = class {
12793
12795
  * channel the backend's locale resolution reads; a `?locale=` query is
12794
12796
  * silently ignored by this route.
12795
12797
  *
12798
+ * `cardOnly` is a direct link to the card form (`payment_method=card`):
12799
+ * when the Stripe card form being prepared is the one the link names, its
12800
+ * PaymentIntent is created for `card` alone. `cardProvider` and
12801
+ * `cardAccount` name that form's connector and account; absent or blank
12802
+ * matches any.
12803
+ *
12796
12804
  * `GET /payment-link/data/{merchantId}/{paymentId}`
12797
12805
  */
12798
12806
  async fetchCheckoutData(params, options) {
@@ -12801,7 +12809,13 @@ var CheckoutSession = class {
12801
12809
  "GET",
12802
12810
  `/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,
12803
12811
  {
12804
- query: { theme: params?.theme, country: country || void 0 },
12812
+ query: {
12813
+ theme: params?.theme,
12814
+ country: country || void 0,
12815
+ card_only: params?.cardOnly || void 0,
12816
+ card_provider: params?.cardOnly ? params.cardProvider?.trim() || void 0 : void 0,
12817
+ card_account: params?.cardOnly ? params.cardAccount?.trim() || void 0 : void 0
12818
+ },
12805
12819
  ...options,
12806
12820
  headers: {
12807
12821
  ...params?.locale ? {
@@ -13020,22 +13034,18 @@ var CheckoutSession = class {
13020
13034
  });
13021
13035
  }
13022
13036
  /**
13023
- * Report a PayPal order's progress from `onApprove` on an experimental PayPal
13024
- * SDK pane: the approval, before asking PayPal to capture — and capture only
13025
- * once the router has it — then the capture PayPal answered, or a decline.
13026
- * When the approval's answer is lost, do not capture: report `NOT_CAPTURED`
13027
- * instead, which releases an approval the router may have recorded.
13028
- *
13029
- * The router records each on the payment and relays a capture that took money
13030
- * to e-Payouts the way e-Payouts' own PayPal page does. It does not mark the
13031
- * payment paid: that happens only on e-Payouts' notification, so poll the
13032
- * payment's status afterwards. A repeated report is answered, not recorded
13033
- * twice.
13037
+ * Report PayPal's refusal of the card or the payer on the PayPal Express or
13038
+ * Pay with card pane (for example `INSTRUMENT_DECLINED`, `PAYER_CANNOT_PAY`,
13039
+ * or `AUTHENTICATION_FAILED` for a failed 3-D Secure). The attempt is
13040
+ * recorded declined and the payment stays payable with another card or
13041
+ * method. An issue that is not a refusal, or a payment that no longer awaits
13042
+ * PayPal, is left as it is (`declined: false`). Nothing here captures: the
13043
+ * payment settles from e-Payouts' notification.
13034
13044
  *
13035
- * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-capture`
13045
+ * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-decline`
13036
13046
  */
13037
- async epayoutsPaypalCapture(params, options) {
13038
- return this.client.request("POST", `${this.linkBase}/epayouts/paypal-capture`, {
13047
+ async epayoutsPaypalDecline(params, options) {
13048
+ return this.client.request("POST", `${this.linkBase}/epayouts/paypal-decline`, {
13039
13049
  body: params,
13040
13050
  ...options,
13041
13051
  headers: this.bearerHeaders(options?.headers)
@@ -13397,6 +13407,29 @@ var CheckoutSession = class {
13397
13407
  }
13398
13408
  );
13399
13409
  }
13410
+ /**
13411
+ * Reopen a provider session the buyer switched away from, when they pick the
13412
+ * same method again, instead of opening a second session at the provider
13413
+ * (delopay-todos#401). Pass an `attempt_id` from the checkout's
13414
+ * `reopenable_attempts`; the attempt becomes the payment's active one again
13415
+ * and `redirect_url` sends the buyer back to it. Refused (`IR_16`) when the
13416
+ * payment no longer awaits a method, a payment is under way on the checkout,
13417
+ * or the session can no longer be reopened (settled, lapsed at the provider,
13418
+ * ended by the switch); open a new session as usual then.
13419
+ *
13420
+ * `POST /payments/{paymentId}/reopen-attempt` (publishable key + client secret)
13421
+ */
13422
+ async reopenAttempt(attemptId, options) {
13423
+ return this.client.request(
13424
+ "POST",
13425
+ `/payments/${encodeURIComponent(this.paymentId)}/reopen-attempt`,
13426
+ {
13427
+ body: { client_secret: this.requireClientSecret(), attempt_id: attemptId },
13428
+ ...options,
13429
+ headers: this.pkHeaders(options?.headers)
13430
+ }
13431
+ );
13432
+ }
13400
13433
  /**
13401
13434
  * Payment methods available for this payment.
13402
13435
  *