@shipengine/js-api 4.2.0 → 4.2.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.
@@ -1,4 +1,15 @@
1
1
  export type AccountBillingProvider = "visa" | "mastercard" | "americanExpress" | "discover";
2
+ type PaymentMethod = {
3
+ bankAccountInfo: {
4
+ lastFour: string;
5
+ provider: string;
6
+ } | null;
7
+ creditCardInfo: {
8
+ cardNumberLastFour: string;
9
+ provider: AccountBillingProvider;
10
+ } | null;
11
+ paymentMethodId?: string;
12
+ };
2
13
  export type AccountBillingResponse = {
3
14
  addressLine1: string;
4
15
  addressLine2?: string;
@@ -7,12 +18,7 @@ export type AccountBillingResponse = {
7
18
  countryCode: string;
8
19
  email: string;
9
20
  fullName: string;
10
- paymentMethod?: {
11
- creditCardInfo: {
12
- cardNumberLastFour: string;
13
- provider: AccountBillingProvider;
14
- };
15
- };
21
+ paymentMethod?: PaymentMethod;
16
22
  phone: string;
17
23
  postalCode: string;
18
24
  stateProvince: string;
@@ -32,3 +38,4 @@ export type UpsertAccountBillingRequestBody = {
32
38
  postalCode: string;
33
39
  stateProvince: string;
34
40
  };
41
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Money } from "../payments";
3
3
  import { CreationRangeQuery, PageableQuery } from "../resources";
4
- import { AddFundsResponse, AuctanePayInfo, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceCreateResponse, FundingSourceTransactionsResponse, InsuranceFundingSourceAcceptedTermsResponse, MetadataResponse } from "./types";
4
+ import { AddFundsResponse, AuctanePayInfo, BankAccountInfo, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceCreateResponse, FundingSourceTransactionsResponse, InsuranceFundingSourceAcceptedTermsResponse, MetadataResponse } from "./types";
5
5
  /**
6
6
  * @internal
7
7
  * # Funding Sources API module - /v1/funding_sources
@@ -30,7 +30,7 @@ export declare class FundingSourcesAPI {
30
30
  * user to update the billing address or payment information associated with the
31
31
  * funding source.
32
32
  */
33
- update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo | undefined, auctanePayInfo: AuctanePayInfo | undefined, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
33
+ update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo | undefined, bankAccountInfo: BankAccountInfo | undefined, auctanePayInfo: AuctanePayInfo | undefined, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
34
34
  fundingSource: FundingSource;
35
35
  }, any>>;
36
36
  /**
@@ -12,6 +12,7 @@ export type CreateFundingSource = {
12
12
  billingInfo: FundingSourceAddress;
13
13
  iovationBlackBox: IovationBlackBox;
14
14
  paymentMethod: {
15
+ bankAccountInfo?: BankAccountInfo;
15
16
  creditCardInfo?: CreditCardInfo;
16
17
  paymentMethodId?: string;
17
18
  sessionId?: string;
@@ -25,6 +26,7 @@ export type FundingSource = {
25
26
  defaultCarrierId: string;
26
27
  fundingSourceId: string;
27
28
  paymentMethod: {
29
+ bankAccountInfo: BankAccountInfo | null;
28
30
  creditCardInfo: AbbreviatedCreditCardInfo | null;
29
31
  paymentMethodId?: string;
30
32
  sessionId?: string;
@@ -92,6 +94,10 @@ export interface CreditCardInfo {
92
94
  name: string;
93
95
  provider: Provider;
94
96
  }
97
+ export interface BankAccountInfo {
98
+ lastFour: string;
99
+ provider: string;
100
+ }
95
101
  /** @internal */
96
102
  export interface Term {
97
103
  termType: string;
package/index.js CHANGED
@@ -3545,7 +3545,7 @@ class FundingSourcesAPI {
3545
3545
  * user to update the billing address or payment information associated with the
3546
3546
  * funding source.
3547
3547
  */
3548
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3548
+ this.update = (billingInfo, creditCardInfo, bankAccountInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3549
3549
  const endUserIpAddress = yield getEndUserIpAddress();
3550
3550
  if (!endUserIpAddress) {
3551
3551
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3556,6 +3556,7 @@ class FundingSourcesAPI {
3556
3556
  billingInfo,
3557
3557
  endUserIpAddress,
3558
3558
  paymentMethod: __spreadValues$3({
3559
+ bankAccountInfo,
3559
3560
  creditCardInfo
3560
3561
  }, auctanePayInfo)
3561
3562
  }
package/index.mjs CHANGED
@@ -3541,7 +3541,7 @@ class FundingSourcesAPI {
3541
3541
  * user to update the billing address or payment information associated with the
3542
3542
  * funding source.
3543
3543
  */
3544
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3544
+ this.update = (billingInfo, creditCardInfo, bankAccountInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3545
3545
  const endUserIpAddress = yield getEndUserIpAddress();
3546
3546
  if (!endUserIpAddress) {
3547
3547
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3552,6 +3552,7 @@ class FundingSourcesAPI {
3552
3552
  billingInfo,
3553
3553
  endUserIpAddress,
3554
3554
  paymentMethod: __spreadValues$3({
3555
+ bankAccountInfo,
3555
3556
  creditCardInfo
3556
3557
  }, auctanePayInfo)
3557
3558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {