@agentforge-io/sdk-server 4.55.0 → 4.56.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.
@@ -106,6 +106,16 @@ export declare class CasesResource {
106
106
  amountCents?: number;
107
107
  accountId?: string;
108
108
  }): Promise<CaseView>;
109
+ /**
110
+ * `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
111
+ * sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
112
+ * for Efectivo, `cashTenderedCents` = what they pay with). Only while
113
+ * `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
114
+ * 400 otherwise. The customer hears it in the chat.
115
+ */
116
+ setPaymentMethod(caseId: string, accountId: string, opts?: {
117
+ cashTenderedCents?: number;
118
+ }): Promise<CaseView>;
109
119
  /**
110
120
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
111
121
  * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
@@ -160,6 +160,19 @@ class CasesResource {
160
160
  ...(opts.accountId ? { accountId: opts.accountId } : {}),
161
161
  });
162
162
  }
163
+ /**
164
+ * `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
165
+ * sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
166
+ * for Efectivo, `cashTenderedCents` = what they pay with). Only while
167
+ * `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
168
+ * 400 otherwise. The customer hears it in the chat.
169
+ */
170
+ async setPaymentMethod(caseId, accountId, opts = {}) {
171
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/payment/method`, {
172
+ accountId,
173
+ ...(opts.cashTenderedCents ? { cashTenderedCents: opts.cashTenderedCents } : {}),
174
+ });
175
+ }
163
176
  /**
164
177
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
165
178
  * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
package/dist/types.d.ts CHANGED
@@ -2231,6 +2231,8 @@ export interface CasePayment {
2231
2231
  key: CasePaymentStatus;
2232
2232
  label: string;
2233
2233
  }>;
2234
+ /** AGF-PAYMENT-METHOD-BUSINESS — the business may set or change the method now (`cases.setPaymentMethod`). Absent on an older platform. */
2235
+ methodChangeable?: boolean;
2234
2236
  /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change for the total then. */
2235
2237
  cashTenderedCents?: number;
2236
2238
  changeCents?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.55.0",
3
+ "version": "4.56.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",