@natch-the-storage/heathershaw-platform-types 1.21.5 → 1.22.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.
@@ -312,15 +312,61 @@ export interface OrderAddress {
312
312
  address: Address;
313
313
  deliveryInstructions?: string;
314
314
  }
315
- export interface ChargeOrder {
315
+ /** Mimics the cardFields in the API, this is what the card field names should look like on the frontend */
316
+ export interface PaymentCardDetails {
316
317
  cardNumber: string;
317
318
  cardHolder: string;
318
319
  cardExpiry: string;
319
320
  cvv: string;
320
321
  customerIp?: string;
321
- orderUpdate?: Omit<OrderUpdate, 'id' | 'directUserProfileId' | 'partnerPharmacyProfileId' | 'patientRecordId'>;
322
- patientRecordUpdate?: Omit<PatientRecordUpdate, 'id'>;
323
- isStaff?: boolean;
322
+ }
323
+ /** Links to chargeUpdateFields in the API */
324
+ type chargeUpdateFields = {
325
+ orderUpdate?: Omit<OrderUpdate, 'id' | 'directUserProfileId' | 'partnerPharmacyProfileId' | 'patientRecordId' | 'paymentStatus' | 'paymentLinkToken' | 'paymentReferenceId'>;
326
+ patientRecordUpdate?: Pick<PatientRecordUpdate, 'addresses' | 'healthInfo'>;
327
+ };
328
+ /** Links to chargeOrderBodySchema in the API */
329
+ export type ScaSessionBodySchema = PaymentCardDetails;
330
+ /** Links to scaResultSchema in the API */
331
+ export type ScaResult = {
332
+ xid?: string | null;
333
+ cavv?: string | null;
334
+ par?: string | null;
335
+ ver?: string | null;
336
+ aav?: string | null;
337
+ ucaf?: string | null;
338
+ directoryServerTxnId?: string | null;
339
+ threedsVersion?: string | null;
340
+ };
341
+ export interface ChargeOrderLegacy {
342
+ cardNumber: string;
343
+ cardHolder: string;
344
+ cardExpiry: string;
345
+ cvv: string;
346
+ customerIp?: string;
347
+ }
348
+ /** Links to chargeOrderBodySchema in the API */
349
+ export type ChargeOrder = chargeUpdateFields & {
350
+ cardToken: string;
351
+ sca: ScaResult;
352
+ cardType?: string;
353
+ customerIp?: string;
354
+ };
355
+ /** Links to chargeOrderMotoBodySchema in the API */
356
+ export type ChargeOrderMotoBody = chargeUpdateFields & PaymentCardDetails;
357
+ /** Links to the openScaSession function in the API
358
+ * Is the shape of the response
359
+ */
360
+ export interface ScaSessionResponse {
361
+ accessToken: string;
362
+ verification: string;
363
+ cardToken: string;
364
+ cardType?: string;
365
+ reference: string;
366
+ amount: number;
367
+ currency: string;
368
+ username: string;
369
+ environment: string;
324
370
  }
325
371
  export interface PaperScriptReminder {
326
372
  id: number;
@@ -1224,6 +1270,9 @@ export declare const ApiRoutes: {
1224
1270
  getByPaymentLinkToken: (token: string) => string;
1225
1271
  chargePaymentLink: (token: string) => string;
1226
1272
  chargeOrder: (id: string) => string;
1273
+ paymentLinkScaSession: (token: string) => string;
1274
+ internalScaSession: (id: number) => string;
1275
+ adminMoto: (id: number) => string;
1227
1276
  };
1228
1277
  paperScriptReminders: {
1229
1278
  list: string;
@@ -505,6 +505,9 @@ export const ApiRoutes = {
505
505
  getByPaymentLinkToken: (token) => `/api/orders/payment-links/${token}`,
506
506
  chargePaymentLink: (token) => `/api/orders/payment-links/${token}/charge`,
507
507
  chargeOrder: (id) => `/api/orders/${id}/charge`,
508
+ paymentLinkScaSession: (token) => `/api/orders/payment-links/${token}/sca-session`,
509
+ internalScaSession: (id) => `/api/orders/${id}/sca-session`,
510
+ adminMoto: (id) => `/api/orders/${id}/charge/moto`,
508
511
  },
509
512
  paperScriptReminders: {
510
513
  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.21.5",
3
+ "version": "1.22.0",
4
4
  "description": "Interfaces and routes to use on the client",
5
5
  "license": "ISC",
6
6
  "author": "Natch Surana",