connect-react-native
Advanced tools
Comparing version 2.42.1 to 2.43.0
@@ -0,1 +1,5 @@ | ||
## 2.43.0 | ||
- Added support for createACHPullTransfer. | ||
## 2.42.1 | ||
@@ -2,0 +6,0 @@ |
@@ -448,2 +448,20 @@ "use strict"; | ||
} | ||
async createACHPullTransfer(description, fromAccount, amount) { | ||
return new Promise(async (resolve, reject) => { | ||
await _nativeInterface.default.createACHPullTransfer(this.userID, description, fromAccount ? fromAccount.id : null, amount).then(response => { | ||
let accountID = response.account; | ||
let amnt = response.amount; | ||
let operationID = response.operationID; | ||
resolve(new TransferResponse(amnt, operationID, accountID, undefined, undefined)); | ||
}).catch(error => { | ||
let { | ||
message, | ||
type, | ||
operationID, | ||
account | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -450,0 +468,0 @@ exports.DapiConnection = DapiConnection; |
@@ -414,2 +414,20 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
} | ||
async createACHPullTransfer(description, fromAccount, amount) { | ||
return new Promise(async (resolve, reject) => { | ||
await NativeInterface.createACHPullTransfer(this.userID, description, fromAccount ? fromAccount.id : null, amount).then(response => { | ||
let accountID = response.account; | ||
let amnt = response.amount; | ||
let operationID = response.operationID; | ||
resolve(new TransferResponse(amnt, operationID, accountID, undefined, undefined)); | ||
}).catch(error => { | ||
let { | ||
message, | ||
type, | ||
operationID, | ||
account | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -416,0 +434,0 @@ export class DapiPair { |
@@ -71,2 +71,3 @@ import { IDapiConfigurations, IAccount, ICard, IBeneficiary, IWireBeneficiary, IDapiConnection, IPair, IAccountResponse, IIdentityResponse, ITransactionResponse, IAccountsMetadataResponse, DapiEnvironment, IBankBeneficiaryResponse, IBankWireBeneficiaryResponse, IDapiResult, DapiEndpoint, ITransferResponse, ICardResponse, ICardBalance, ILineAddress, IAccountBalance, DapiTransactionsType, IDapiThemeConfigurations, DapiTheme, DapiLanguage } from './internal/types'; | ||
createWireTransferToExistingBeneficiary(fromAccount: IAccount, toBeneficiaryID: string, amount: number, remark: string | null): Promise<ITransferResponse>; | ||
createACHPullTransfer(description: string, fromAccount: IAccount | null, amount: number): Promise<ITransferResponse>; | ||
} | ||
@@ -73,0 +74,0 @@ export declare class DapiPair implements IPair { |
@@ -31,3 +31,4 @@ import { DapiConnection } from '..'; | ||
presentAccountSelection(userID: string): Promise<string>; | ||
createACHPullTransfer(userID: string, description: string, accountID: string | null, amount: number): Promise<any>; | ||
} | ||
//# sourceMappingURL=privateTypes.d.ts.map |
@@ -388,2 +388,3 @@ export interface IDapiConfigurations { | ||
createWireBeneficiary(beneficiary: IWireBeneficiary): Promise<IDapiResult>; | ||
createACHPullTransfer(description: string, fromAccount: IAccount | null, amount: number): Promise<ITransferResponse>; | ||
getParameters(): Promise<string>; | ||
@@ -390,0 +391,0 @@ presentAccountSelection(): Promise<string | undefined>; |
{ | ||
"name": "connect-react-native", | ||
"version": "2.42.1", | ||
"version": "2.43.0", | ||
"description": "Financial APIs to connect users' bank accounts", | ||
@@ -5,0 +5,0 @@ "react-native": "src/index.ts", |
@@ -468,3 +468,22 @@ import NativeInterface from './internal/nativeInterface'; | ||
} | ||
async createACHPullTransfer(description: string, fromAccount: IAccount | null, amount: number): Promise<ITransferResponse> { | ||
return new Promise < ITransferResponse > (async (resolve, reject) => { | ||
await NativeInterface.createACHPullTransfer( | ||
this.userID, | ||
description, | ||
fromAccount ? fromAccount.id : null, | ||
amount, | ||
).then(response => { | ||
let accountID = response.account; | ||
let amnt = response.amount; | ||
let operationID = response.operationID; | ||
resolve(new TransferResponse(amnt, operationID, accountID, undefined, undefined)); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -471,0 +490,0 @@ export class DapiPair implements IPair { |
@@ -112,2 +112,9 @@ import { DapiConnection } from '..'; | ||
createACHPullTransfer( | ||
userID: string, | ||
description: string, | ||
accountID: string | null, | ||
amount: number, | ||
): Promise<any>; | ||
} |
@@ -495,2 +495,8 @@ export interface IDapiConfigurations { | ||
createACHPullTransfer( | ||
description: string, | ||
fromAccount: IAccount | null, | ||
amount: number, | ||
): Promise<ITransferResponse>; | ||
getParameters(): Promise<string> | ||
@@ -497,0 +503,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1359156
3363