@shipengine/js-api 4.9.0 → 4.11.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.
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { ConfigResponse, CreateSessionRequest, CreateSessionResponse, PreviewTransactionRequest, PreviewTransactionResponse } from "./types";
2
+ import { ConfigResponse, CreateSessionRequest, CreateSessionResponse, PaymentMethodsResponse, PreviewTransactionRequest, PreviewTransactionResponse } from "./types";
3
3
  /**
4
4
  * # Auctane Pay API module - /v1/payments
5
5
  *
@@ -28,4 +28,9 @@ export declare class AuctanePayAPI {
28
28
  * @returns a promise that resolves to the transaction preview with fees
29
29
  */
30
30
  previewTransaction: (request: PreviewTransactionRequest) => Promise<import("axios").AxiosResponse<PreviewTransactionResponse, any>>;
31
+ /**
32
+ * The `getPaymentMethods` method retrieve the list of Payment Methods for a given user.
33
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/5906662077/AUCTANE+PAY+ENDPOINTS+FOR+SHIPSTATION+API#Get-payment-methods
34
+ */
35
+ getPaymentMethods: () => Promise<import("axios").AxiosResponse<PaymentMethodsResponse, any>>;
31
36
  }
@@ -51,7 +51,7 @@ export interface CreateSessionRequest {
51
51
  /**
52
52
  * @category Entities
53
53
  */
54
- export interface PaymentMethodHolderAddress {
54
+ export interface PaymentMethod {
55
55
  /** Account holder address */
56
56
  accountHolderAddress: {
57
57
  addressLine1: string;
@@ -63,28 +63,34 @@ export interface PaymentMethodHolderAddress {
63
63
  } | null;
64
64
  /** Account holder name */
65
65
  accountHolderName: string | null;
66
- /** The last four of the account number, this is only
66
+ /**
67
+ * The last four of the account number, this is only
67
68
  * provided for bank accounts and card schemes.
68
69
  */
69
70
  accountNumberLastFour: string;
70
- /** An account number preview, for a CC this is the last 4 digits, but shown like 1234.
71
+ /**
72
+ * An account number preview, for a CC this is the last 4 digits, but shown like 1234.
71
73
  * For an e-mail account it might be ay@auctane.com, etc.
72
74
  */
73
75
  accountNumberPreview: string;
74
- /** If applicable/available, the current expiration
76
+ /**
77
+ * If applicable/available, the current expiration
75
78
  * we have on file for the payment method.
76
79
  */
77
80
  assignedPreferences: AuctanePayTransactionCategory[];
78
- /** Date the payment method was last used.
81
+ /**
82
+ * Date the payment method was last used.
79
83
  * If the date it was last used is unavailable,
80
84
  * this will be the date created/updated.
81
85
  */
82
86
  dateLastUsed: string;
83
- /** List of processes or payment gateways
87
+ /**
88
+ * List of processes or payment gateways
84
89
  * in which this Payment Method is registered
85
90
  */
86
91
  enrolledProcessors: string[];
87
- /** If applicable/available, the current expiration
92
+ /**
93
+ * If applicable/available, the current expiration
88
94
  * we have on file for the payment method.
89
95
  */
90
96
  expiration: string;
@@ -92,14 +98,19 @@ export interface PaymentMethodHolderAddress {
92
98
  fees: PaymentMethodDetailFee[];
93
99
  /** The Payment Method ID */
94
100
  id: string;
101
+ /** Usually the Bank name */
102
+ institutionName: string | null;
95
103
  /** The nickname of the payment method */
96
104
  nickname: string;
97
105
  /** Enumeration of supported payment methods. */
98
106
  paymentMethod: "unknown" | "visa" | "mastercard" | "amex" | "discover" | "maestro" | "dinersclub" | "ach" | "jcb" | "pulse" | "star" | "unionpay";
99
- /** The Display Name to show in any text
107
+ /**
108
+ * The Display Name to show in any text
100
109
  * based UI/context for the Logo.
101
110
  */
102
111
  paymentMethodDisplayName: string;
112
+ /** Payment method type */
113
+ paymentMethodType: AuctanePayPaymentMethod;
103
114
  /** Source account ID */
104
115
  sourceAccountId: string;
105
116
  }
@@ -114,12 +125,13 @@ export interface ConfigResponse {
114
125
  */
115
126
  export interface CreateSessionResponse {
116
127
  /** Active payment methods */
117
- activePaymentMethods: PaymentMethodHolderAddress[];
128
+ activePaymentMethods: PaymentMethod[];
118
129
  /** Client key */
119
130
  clientKey: string;
120
131
  /** Eligible payment method types */
121
132
  eligiblePaymentMethodTypes: AuctanePayPaymentMethod[];
122
- /** The Auctane Pay Internal Session ID,
133
+ /**
134
+ * The Auctane Pay Internal Session ID,
123
135
  * use this ID to request the result of this session
124
136
  * and payment methods created from it.
125
137
  */
@@ -129,7 +141,7 @@ export interface CreateSessionResponse {
129
141
  /** Payment Method Meta Type Details */
130
142
  paymentMethodMetaTypeDetails: Record<keyof AuctanePayPaymentMethod, AuctanePayPaymentMethodDetails> | null;
131
143
  /** Recent payment methods */
132
- recentPaymentMethods: PaymentMethodHolderAddress[];
144
+ recentPaymentMethods: PaymentMethod[];
133
145
  /** @deprecated */
134
146
  sessionData: string;
135
147
  /** @deprecated */
@@ -137,6 +149,13 @@ export interface CreateSessionResponse {
137
149
  /** Category of the transaction */
138
150
  transactionCategory: AuctanePayTransactionCategory;
139
151
  }
152
+ /**
153
+ * @category Entities
154
+ */
155
+ export interface PaymentMethodsResponse {
156
+ activePaymentMethods: Array<PaymentMethod>;
157
+ recentPaymentMethods: Array<PaymentMethod>;
158
+ }
140
159
  /**
141
160
  * @category Entities
142
161
  * Request body for preview transaction endpoint
package/index.js CHANGED
@@ -272,6 +272,13 @@ class AuctanePayAPI {
272
272
  request
273
273
  );
274
274
  };
275
+ /**
276
+ * The `getPaymentMethods` method retrieve the list of Payment Methods for a given user.
277
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/5906662077/AUCTANE+PAY+ENDPOINTS+FOR+SHIPSTATION+API#Get-payment-methods
278
+ */
279
+ this.getPaymentMethods = () => {
280
+ return this.client.get("/v1/payments/payment_methods");
281
+ };
275
282
  this.client = client;
276
283
  }
277
284
  }
package/index.mjs CHANGED
@@ -268,6 +268,13 @@ class AuctanePayAPI {
268
268
  request
269
269
  );
270
270
  };
271
+ /**
272
+ * The `getPaymentMethods` method retrieve the list of Payment Methods for a given user.
273
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/5906662077/AUCTANE+PAY+ENDPOINTS+FOR+SHIPSTATION+API#Get-payment-methods
274
+ */
275
+ this.getPaymentMethods = () => {
276
+ return this.client.get("/v1/payments/payment_methods");
277
+ };
271
278
  this.client = client;
272
279
  }
273
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.9.0",
3
+ "version": "4.11.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -4,7 +4,7 @@ import { WeightUnit } from "../weight";
4
4
  /**
5
5
  * @category Entities
6
6
  */
7
- export type RuleIdentifier = "MAX_DIMENSION" | "NUMBER_OF_PACKAGES" | "SHIP_FROM_ADDRESS_RESIDENTIAL_INDICATOR" | "SHIP_FROM_COUNTRY_CODE" | "SHIP_TO_ADDRESS_RESIDENTIAL_INDICATOR" | "SHIP_TO_COUNTRY_CODE" | "SHIP_TO_POSTAL_CODE" | "SHIP_FROM_POSTAL_CODE" | "SHIPMENT_VALUE" | "WAREHOUSE_ID" | "WEIGHT";
7
+ export type RuleIdentifier = "MAX_DIMENSION" | "NUMBER_OF_PACKAGES" | "SHIP_FROM_ADDRESS_RESIDENTIAL_INDICATOR" | "SHIP_FROM_COUNTRY_CODE" | "SHIP_TO_ADDRESS_RESIDENTIAL_INDICATOR" | "SHIP_TO_COUNTRY_CODE" | "SHIP_TO_POSTAL_CODE" | "SHIP_FROM_POSTAL_CODE" | "SHIPMENT_VALUE" | "WAREHOUSE_ID" | "WEIGHT" | "LENGTH" | "WIDTH" | "HEIGHT" | "CUSTOM_FIELD1" | "CUSTOM_FIELD2" | "CUSTOM_FIELD3";
8
8
  /**
9
9
  * @category Entities
10
10
  */