@shipengine/js-api 3.11.0 → 3.12.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.
- package/auctane-pay/api.d.ts +18 -0
- package/auctane-pay/index.d.ts +2 -0
- package/auctane-pay/types.d.ts +122 -0
- package/client.d.ts +8 -0
- package/index.d.ts +1 -0
- package/index.js +26 -0
- package/index.mjs +26 -1
- package/package.json +1 -1
- package/types.d.ts +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { CreateSessionRequest, CreateSessionResponse } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* # Auctane Pay API module - /internal/auctane_pay
|
|
5
|
+
*
|
|
6
|
+
* This module provides access to the Auctane Pay endpoints in ShipEngine API.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AuctanePayAPI {
|
|
9
|
+
private client;
|
|
10
|
+
constructor(client: AxiosInstance);
|
|
11
|
+
/**
|
|
12
|
+
* The `createSession` method creates a new payment session.
|
|
13
|
+
*
|
|
14
|
+
* @param request - The request object containing the session details
|
|
15
|
+
* @returns a promise that resolves to the created session
|
|
16
|
+
*/
|
|
17
|
+
createSession: (request: CreateSessionRequest) => Promise<import("axios").AxiosResponse<CreateSessionResponse, any>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Entities
|
|
3
|
+
* Note: This is similar to but distinct from the TransactionCategory in funding-sources
|
|
4
|
+
*/
|
|
5
|
+
export type AuctanePayTransactionCategory = "add_funds" | "subscription" | "store";
|
|
6
|
+
/**
|
|
7
|
+
* @category Entities
|
|
8
|
+
*/
|
|
9
|
+
export type AuctanePayPaymentMethod = "credit_card" | "pay_pal" | "pay_by_bank_us" | "pay_by_bank_eu";
|
|
10
|
+
/**
|
|
11
|
+
* @category Entities
|
|
12
|
+
*/
|
|
13
|
+
export interface CreateSessionRequest {
|
|
14
|
+
/**
|
|
15
|
+
* URL to redirect after payment session completion
|
|
16
|
+
* @example "https://dashboard.shipengine.com/?sessionId=:id"
|
|
17
|
+
*/
|
|
18
|
+
returnUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Category of the transaction
|
|
21
|
+
* @example "add_funds"
|
|
22
|
+
*/
|
|
23
|
+
transactionCategory: AuctanePayTransactionCategory;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @category Entities
|
|
27
|
+
*/
|
|
28
|
+
export interface PaymentMethodHolderAddress {
|
|
29
|
+
/**
|
|
30
|
+
* Account holder address
|
|
31
|
+
*/
|
|
32
|
+
accountHolderAddress?: {
|
|
33
|
+
addressLine1: string;
|
|
34
|
+
addressLine2: string;
|
|
35
|
+
cityLocality: string;
|
|
36
|
+
countryCode: string;
|
|
37
|
+
postalCode: string;
|
|
38
|
+
stateProvince: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Account holder name
|
|
42
|
+
*/
|
|
43
|
+
accountHolderName?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The last four of the account number, this is only provided for bank accounts and card schemes.
|
|
46
|
+
*/
|
|
47
|
+
accountNumberLastFour: string;
|
|
48
|
+
/**
|
|
49
|
+
* An account number preview, for a CC this is the last 4 digits, but shown like 1234.
|
|
50
|
+
* For an e-mail account it might be ay@auctane.com, etc.
|
|
51
|
+
*/
|
|
52
|
+
accountNumberPreview: string;
|
|
53
|
+
/**
|
|
54
|
+
* If applicable/available, the current expiration we have on file for the payment method.
|
|
55
|
+
*/
|
|
56
|
+
assignedPreferences: AuctanePayTransactionCategory[];
|
|
57
|
+
/**
|
|
58
|
+
* Date the payment method was last used. If the date it was last used is unavailable,
|
|
59
|
+
* this will be the date created/updated.
|
|
60
|
+
*/
|
|
61
|
+
dateLastUsed: string;
|
|
62
|
+
/**
|
|
63
|
+
* If applicable/available, the current expiration we have on file for the payment method.
|
|
64
|
+
*/
|
|
65
|
+
expiration: string;
|
|
66
|
+
/**
|
|
67
|
+
* The Payment Method ID
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* The nickname of the payment method
|
|
72
|
+
*/
|
|
73
|
+
nickname: string;
|
|
74
|
+
/**
|
|
75
|
+
* Enumeration of supported payment methods.
|
|
76
|
+
*/
|
|
77
|
+
paymentMethod: "Unknown" | "Visa" | "Mastercard" | "Amex" | "Discover" | "Maestro" | "DinersClub" | "ACH" | "JCB" | "Pulse" | "Star" | "UnionPay";
|
|
78
|
+
/**
|
|
79
|
+
* The Display Name to show in any text based UI/context for the Logo.
|
|
80
|
+
*/
|
|
81
|
+
paymentMethodDisplayName: string;
|
|
82
|
+
/**
|
|
83
|
+
* Source account ID
|
|
84
|
+
*/
|
|
85
|
+
sourceAccountId: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @category Entities
|
|
89
|
+
*/
|
|
90
|
+
export interface CreateSessionResponse {
|
|
91
|
+
/**
|
|
92
|
+
* Active payment methods
|
|
93
|
+
*/
|
|
94
|
+
activePaymentMethods: PaymentMethodHolderAddress[];
|
|
95
|
+
/**
|
|
96
|
+
* Client key
|
|
97
|
+
*/
|
|
98
|
+
clientKey: string;
|
|
99
|
+
/**
|
|
100
|
+
* Eligible payment method types
|
|
101
|
+
*/
|
|
102
|
+
eligiblePaymentMethodTypes: AuctanePayPaymentMethod[];
|
|
103
|
+
/**
|
|
104
|
+
* The Auctane Pay Internal Session ID, use this ID to request the result of this session
|
|
105
|
+
* and payment methods created from it.
|
|
106
|
+
*/
|
|
107
|
+
id: string;
|
|
108
|
+
/**
|
|
109
|
+
* Metadata
|
|
110
|
+
*/
|
|
111
|
+
metadata: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Recent payment methods
|
|
116
|
+
*/
|
|
117
|
+
recentPaymentMethods: PaymentMethodHolderAddress[];
|
|
118
|
+
/** @deprecated */
|
|
119
|
+
sessionData: string;
|
|
120
|
+
/** @deprecated */
|
|
121
|
+
sessionId: string;
|
|
122
|
+
}
|
package/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AxiosError, AxiosRequestHeaders } from "axios";
|
|
|
2
2
|
import { AccountBillingPlanAPI } from "./account-billing-plan";
|
|
3
3
|
import { AccountSettingsAPI } from "./account-settings";
|
|
4
4
|
import { AddressesAPI } from "./addresses";
|
|
5
|
+
import { AuctanePayAPI } from "./auctane-pay";
|
|
5
6
|
import { CarriersAPI } from "./carriers";
|
|
6
7
|
import { ConnectionsAPI } from "./connections";
|
|
7
8
|
import { CustomPackagesAPI } from "./custom-packages";
|
|
@@ -238,4 +239,11 @@ export declare class ShipEngineAPI {
|
|
|
238
239
|
* @see {@link SellersAPI | The Sellers API module}
|
|
239
240
|
*/
|
|
240
241
|
get sellers(): SellersAPI;
|
|
242
|
+
/**
|
|
243
|
+
* The `auctanePay` method provides access to the Auctane Pay endpoints in ShipEngine
|
|
244
|
+
* API. e.g. Create Payment Session
|
|
245
|
+
*
|
|
246
|
+
* @see {@link AuctanePayAPI | The Auctane Pay API module}
|
|
247
|
+
*/
|
|
248
|
+
get auctanePay(): AuctanePayAPI;
|
|
241
249
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -240,6 +240,22 @@ class AddressesAPI {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
class AuctanePayAPI {
|
|
244
|
+
constructor(client) {
|
|
245
|
+
this.client = client;
|
|
246
|
+
/**
|
|
247
|
+
* The `createSession` method creates a new payment session.
|
|
248
|
+
*
|
|
249
|
+
* @param request - The request object containing the session details
|
|
250
|
+
* @returns a promise that resolves to the created session
|
|
251
|
+
*/
|
|
252
|
+
this.createSession = (request) => {
|
|
253
|
+
return this.client.post("/internal/auctane_pay/sessions", request);
|
|
254
|
+
};
|
|
255
|
+
this.client = client;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
243
259
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
244
260
|
const isCodedError = (err) => !!err.errorCode;
|
|
245
261
|
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
@@ -21897,10 +21913,20 @@ class ShipEngineAPI {
|
|
|
21897
21913
|
get sellers() {
|
|
21898
21914
|
return new SellersAPI(this.client);
|
|
21899
21915
|
}
|
|
21916
|
+
/**
|
|
21917
|
+
* The `auctanePay` method provides access to the Auctane Pay endpoints in ShipEngine
|
|
21918
|
+
* API. e.g. Create Payment Session
|
|
21919
|
+
*
|
|
21920
|
+
* @see {@link AuctanePayAPI | The Auctane Pay API module}
|
|
21921
|
+
*/
|
|
21922
|
+
get auctanePay() {
|
|
21923
|
+
return new AuctanePayAPI(this.client);
|
|
21924
|
+
}
|
|
21900
21925
|
}
|
|
21901
21926
|
|
|
21902
21927
|
exports.AccountSettingsAPI = AccountSettingsAPI;
|
|
21903
21928
|
exports.AddressesAPI = AddressesAPI;
|
|
21929
|
+
exports.AuctanePayAPI = AuctanePayAPI;
|
|
21904
21930
|
exports.CarriersAPI = CarriersAPI;
|
|
21905
21931
|
exports.CodedError = CodedError;
|
|
21906
21932
|
exports.ConfirmationType = ConfirmationType;
|
package/index.mjs
CHANGED
|
@@ -236,6 +236,22 @@ class AddressesAPI {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
class AuctanePayAPI {
|
|
240
|
+
constructor(client) {
|
|
241
|
+
this.client = client;
|
|
242
|
+
/**
|
|
243
|
+
* The `createSession` method creates a new payment session.
|
|
244
|
+
*
|
|
245
|
+
* @param request - The request object containing the session details
|
|
246
|
+
* @returns a promise that resolves to the created session
|
|
247
|
+
*/
|
|
248
|
+
this.createSession = (request) => {
|
|
249
|
+
return this.client.post("/internal/auctane_pay/sessions", request);
|
|
250
|
+
};
|
|
251
|
+
this.client = client;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
239
255
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
240
256
|
const isCodedError = (err) => !!err.errorCode;
|
|
241
257
|
const isDataCodedErrors = (data) => !!data.errors && isCodedErrors(data.errors);
|
|
@@ -21893,6 +21909,15 @@ class ShipEngineAPI {
|
|
|
21893
21909
|
get sellers() {
|
|
21894
21910
|
return new SellersAPI(this.client);
|
|
21895
21911
|
}
|
|
21912
|
+
/**
|
|
21913
|
+
* The `auctanePay` method provides access to the Auctane Pay endpoints in ShipEngine
|
|
21914
|
+
* API. e.g. Create Payment Session
|
|
21915
|
+
*
|
|
21916
|
+
* @see {@link AuctanePayAPI | The Auctane Pay API module}
|
|
21917
|
+
*/
|
|
21918
|
+
get auctanePay() {
|
|
21919
|
+
return new AuctanePayAPI(this.client);
|
|
21920
|
+
}
|
|
21896
21921
|
}
|
|
21897
21922
|
|
|
21898
|
-
export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
|
|
21923
|
+
export { AccountSettingsAPI, AddressesAPI, AuctanePayAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
|
2
2
|
export * from "./account-settings/types";
|
|
3
3
|
export * from "./account-billing-plan/types";
|
|
4
4
|
export * from "./addresses/types";
|
|
5
|
+
export * from "./auctane-pay/types";
|
|
5
6
|
export * from "./carriers/types";
|
|
6
7
|
export * from "./connections/types";
|
|
7
8
|
export * from "./custom-packages/types";
|