@shipengine/js-api 0.16.0 → 0.16.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.
- package/funding-sources/api.d.ts +7 -3
- package/funding-sources/types.d.ts +11 -19
- package/index.js +5 -1
- package/index.mjs +5 -1
- package/package.json +1 -1
package/funding-sources/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource,
|
|
2
|
+
import { CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress } from "./types";
|
|
3
3
|
export declare class FundingSourcesAPI {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: AxiosInstance);
|
|
@@ -7,7 +7,11 @@ export declare class FundingSourcesAPI {
|
|
|
7
7
|
fundingSources: FundingSource[];
|
|
8
8
|
}, any>>;
|
|
9
9
|
get: (fundingSourceId: string) => Promise<import("axios").AxiosResponse<FundingSource, any>>;
|
|
10
|
-
create: (createFundingSource: CreateFundingSource) => Promise<import("axios").AxiosResponse<
|
|
11
|
-
|
|
10
|
+
create: (createFundingSource: CreateFundingSource) => Promise<import("axios").AxiosResponse<{
|
|
11
|
+
fundingSource: FundingSource;
|
|
12
|
+
}, any>>;
|
|
13
|
+
update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
|
|
14
|
+
fundingSource: FundingSource;
|
|
15
|
+
}, any>>;
|
|
12
16
|
registerCarrier: (carrier: CarrierRegistration) => Promise<import("axios").AxiosResponse<CarrierRegistrationResponse, any>>;
|
|
13
17
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { CreditCardVendor } from "../payments";
|
|
2
1
|
export type CreateFundingSource = {
|
|
3
2
|
acceptedTerms: Term[];
|
|
4
3
|
agreeToTerms: boolean;
|
|
5
4
|
billingInfo: FundingSourceAddress;
|
|
6
|
-
paymentMethod:
|
|
5
|
+
paymentMethod: {
|
|
6
|
+
creditCardInfo: CreditCardInfo;
|
|
7
|
+
};
|
|
7
8
|
};
|
|
8
9
|
export type FundingSource = {
|
|
9
|
-
billingInfo: FundingSourceAddress;
|
|
10
10
|
currencyCode: string;
|
|
11
11
|
fundingSourceId: string;
|
|
12
|
-
paymentMethod:
|
|
13
|
-
creditCardInfo: null;
|
|
12
|
+
paymentMethod: {
|
|
13
|
+
creditCardInfo: AbbreviatedCreditCardInfo | null;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
export type AbbreviatedCreditCardInfo = {
|
|
17
|
+
cardNumberLastFour: string;
|
|
18
|
+
provider: Provider;
|
|
19
|
+
};
|
|
20
|
+
export type Provider = "visa" | "mastercard" | "americanExpress" | "discover";
|
|
16
21
|
export interface CarrierRegistration {
|
|
17
22
|
carriers: [
|
|
18
23
|
{
|
|
@@ -42,10 +47,7 @@ export interface CreditCardInfo {
|
|
|
42
47
|
expirationMonth: number;
|
|
43
48
|
expirationYear: number;
|
|
44
49
|
name: string;
|
|
45
|
-
provider:
|
|
46
|
-
}
|
|
47
|
-
export interface PaymentMethod {
|
|
48
|
-
creditCardInfo: CreditCardInfo;
|
|
50
|
+
provider: Provider;
|
|
49
51
|
}
|
|
50
52
|
export interface Term {
|
|
51
53
|
termType: string;
|
|
@@ -62,13 +64,3 @@ export interface CarrierRegistrationResponse {
|
|
|
62
64
|
}
|
|
63
65
|
];
|
|
64
66
|
}
|
|
65
|
-
export interface CreateFundingSourceResponse {
|
|
66
|
-
fundingSource: {
|
|
67
|
-
billingInfo: FundingSourceAddress;
|
|
68
|
-
currencyCode: string;
|
|
69
|
-
fundingSourceId: string;
|
|
70
|
-
PaymentMethod: PaymentMethod | {
|
|
71
|
-
creditCardInfo: null;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
}
|
package/index.js
CHANGED
|
@@ -3208,7 +3208,11 @@ class FundingSourcesAPI {
|
|
|
3208
3208
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
3209
3209
|
return yield this.client.put(
|
|
3210
3210
|
`/v1/funding_sources/${fundingSourceId}`,
|
|
3211
|
-
{
|
|
3211
|
+
{
|
|
3212
|
+
billingInfo,
|
|
3213
|
+
endUserIpAddress,
|
|
3214
|
+
paymentMethod: { creditCardInfo }
|
|
3215
|
+
}
|
|
3212
3216
|
);
|
|
3213
3217
|
});
|
|
3214
3218
|
this.registerCarrier = (carrier) => __async$2(this, null, function* () {
|
package/index.mjs
CHANGED
|
@@ -3204,7 +3204,11 @@ class FundingSourcesAPI {
|
|
|
3204
3204
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
3205
3205
|
return yield this.client.put(
|
|
3206
3206
|
`/v1/funding_sources/${fundingSourceId}`,
|
|
3207
|
-
{
|
|
3207
|
+
{
|
|
3208
|
+
billingInfo,
|
|
3209
|
+
endUserIpAddress,
|
|
3210
|
+
paymentMethod: { creditCardInfo }
|
|
3211
|
+
}
|
|
3208
3212
|
);
|
|
3209
3213
|
});
|
|
3210
3214
|
this.registerCarrier = (carrier) => __async$2(this, null, function* () {
|