@natch-the-storage/heathershaw-platform-types 1.22.0 → 1.22.2

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.
@@ -327,6 +327,43 @@ type chargeUpdateFields = {
327
327
  };
328
328
  /** Links to chargeOrderBodySchema in the API */
329
329
  export type ScaSessionBodySchema = PaymentCardDetails;
330
+ /** Used for new ScaSession API endpoint, is the expected request body */
331
+ export type ScaSessionBody = {
332
+ amount: number;
333
+ patientRecordId: number;
334
+ cardNumber: string;
335
+ cardHolder: string;
336
+ cardExpiry: string;
337
+ cvv: string;
338
+ customerIp?: string;
339
+ };
340
+ /** Used for ChargeAndCreateOrder endpoint, for new payment flow */
341
+ export type ChargeAndCreateOrderBody = {
342
+ order: OrderCreate;
343
+ cardToken: string;
344
+ sca: ScaResult;
345
+ cardType?: string;
346
+ customerIp?: string;
347
+ reference: string;
348
+ amount: number;
349
+ };
350
+ /** Used for ChargeAndCreateOrder endpoint, the expected result */
351
+ export type ChargeAndCreateOrderResult = {
352
+ success: true;
353
+ data: Order;
354
+ transactionId: string;
355
+ } | {
356
+ success: false;
357
+ message: string;
358
+ paymentTaken?: undefined;
359
+ }
360
+ /** Charged but not created. Surface transactionId; do NOT retry. */
361
+ | {
362
+ success: false;
363
+ paymentTaken: true;
364
+ transactionId: string;
365
+ message: string;
366
+ };
330
367
  /** Links to scaResultSchema in the API */
331
368
  export type ScaResult = {
332
369
  xid?: string | null;
@@ -1269,10 +1306,16 @@ export declare const ApiRoutes: {
1269
1306
  createPaymentLinkToken: string;
1270
1307
  getByPaymentLinkToken: (token: string) => string;
1271
1308
  chargePaymentLink: (token: string) => string;
1309
+ /** Old chargeOrder flow */
1272
1310
  chargeOrder: (id: string) => string;
1273
1311
  paymentLinkScaSession: (token: string) => string;
1312
+ /** DEPRECATED Sca Session route for old payment flow */
1274
1313
  internalScaSession: (id: number) => string;
1275
1314
  adminMoto: (id: number) => string;
1315
+ /** New Sca Session route for updated payment flow */
1316
+ scaSession: string;
1317
+ /** New charge and create route for updated payment flow */
1318
+ chargeAndCreateOrder: string;
1276
1319
  };
1277
1320
  paperScriptReminders: {
1278
1321
  list: string;
@@ -504,10 +504,16 @@ export const ApiRoutes = {
504
504
  createPaymentLinkToken: '/api/orders/payment-links',
505
505
  getByPaymentLinkToken: (token) => `/api/orders/payment-links/${token}`,
506
506
  chargePaymentLink: (token) => `/api/orders/payment-links/${token}/charge`,
507
+ /** Old chargeOrder flow */
507
508
  chargeOrder: (id) => `/api/orders/${id}/charge`,
508
509
  paymentLinkScaSession: (token) => `/api/orders/payment-links/${token}/sca-session`,
510
+ /** DEPRECATED Sca Session route for old payment flow */
509
511
  internalScaSession: (id) => `/api/orders/${id}/sca-session`,
510
512
  adminMoto: (id) => `/api/orders/${id}/charge/moto`,
513
+ /** New Sca Session route for updated payment flow */
514
+ scaSession: `/api/orders/sca-session`,
515
+ /** New charge and create route for updated payment flow */
516
+ chargeAndCreateOrder: `/api/orders/charge-and-create`,
511
517
  },
512
518
  paperScriptReminders: {
513
519
  list: '/api/paper-script-reminders',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natch-the-storage/heathershaw-platform-types",
3
- "version": "1.22.0",
3
+ "version": "1.22.2",
4
4
  "description": "Interfaces and routes to use on the client",
5
5
  "license": "ISC",
6
6
  "author": "Natch Surana",