@shipengine/js-api 4.10.0 → 4.11.1
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/auctane-pay/api.d.ts +6 -1
- package/auctane-pay/types.d.ts +30 -11
- package/carriers/api.d.ts +1 -1
- package/index.js +8 -3
- package/index.mjs +8 -3
- package/package.json +1 -1
package/auctane-pay/api.d.ts
CHANGED
|
@@ -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
|
}
|
package/auctane-pay/types.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface CreateSessionRequest {
|
|
|
51
51
|
/**
|
|
52
52
|
* @category Entities
|
|
53
53
|
*/
|
|
54
|
-
export interface
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* List of processes or payment gateways
|
|
84
89
|
* in which this Payment Method is registered
|
|
85
90
|
*/
|
|
86
91
|
enrolledProcessors: string[];
|
|
87
|
-
/**
|
|
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
|
-
/**
|
|
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:
|
|
128
|
+
activePaymentMethods: PaymentMethod[];
|
|
118
129
|
/** Client key */
|
|
119
130
|
clientKey: string;
|
|
120
131
|
/** Eligible payment method types */
|
|
121
132
|
eligiblePaymentMethodTypes: AuctanePayPaymentMethod[];
|
|
122
|
-
/**
|
|
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:
|
|
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/carriers/api.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare class CarriersAPI {
|
|
|
46
46
|
* If no auto-funding rules have been set, the response will contain the default
|
|
47
47
|
* values for auto-funding. Auto-funding is disabled by default.
|
|
48
48
|
*/
|
|
49
|
-
getAutoFunding: (carrierId: string) => Promise<import("axios").AxiosResponse<
|
|
49
|
+
getAutoFunding: (carrierId: string) => Promise<import("axios").AxiosResponse<CarrierAutoFundingSettings, any>>;
|
|
50
50
|
/**
|
|
51
51
|
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|
|
52
52
|
*/
|
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
|
}
|
|
@@ -1242,9 +1249,7 @@ class CarriersAPI {
|
|
|
1242
1249
|
* values for auto-funding. Auto-funding is disabled by default.
|
|
1243
1250
|
*/
|
|
1244
1251
|
this.getAutoFunding = (carrierId) => {
|
|
1245
|
-
return this.client.get(
|
|
1246
|
-
`/v1/carriers/${carrierId}/auto_funding`
|
|
1247
|
-
);
|
|
1252
|
+
return this.client.get(`/v1/carriers/${carrierId}/auto_funding`);
|
|
1248
1253
|
};
|
|
1249
1254
|
/**
|
|
1250
1255
|
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|
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
|
}
|
|
@@ -1238,9 +1245,7 @@ class CarriersAPI {
|
|
|
1238
1245
|
* values for auto-funding. Auto-funding is disabled by default.
|
|
1239
1246
|
*/
|
|
1240
1247
|
this.getAutoFunding = (carrierId) => {
|
|
1241
|
-
return this.client.get(
|
|
1242
|
-
`/v1/carriers/${carrierId}/auto_funding`
|
|
1243
|
-
);
|
|
1248
|
+
return this.client.get(`/v1/carriers/${carrierId}/auto_funding`);
|
|
1244
1249
|
};
|
|
1245
1250
|
/**
|
|
1246
1251
|
* The `getServices` method retrieves a list of shipping services that a given carrier offers.
|