|
1 | 1 | /* eslint-disable @typescript-eslint/no-unused-vars*/
|
2 | 2 |
|
3 | 3 | import { ec } from 'elliptic';
|
| 4 | +import { |
| 5 | + BillClient, |
| 6 | + BitPayClient, |
| 7 | + CurrencyClient, |
| 8 | + InvoiceClient, |
| 9 | + LedgerClient, |
| 10 | + PayoutClient, |
| 11 | + PayoutGroupClient, |
| 12 | + PayoutRecipientClient, |
| 13 | + RateClient, |
| 14 | + RefundClient, |
| 15 | + SettlementClient, |
| 16 | + WalletClient |
| 17 | +} from './Client/index'; |
4 | 18 | import { Env, Facade, KeyUtils } from './index';
|
5 | 19 | import {
|
6 | 20 | BillInterface,
|
7 | 21 | InvoiceInterface,
|
8 | 22 | LedgerEntryInterface,
|
9 | 23 | LedgerInterface,
|
10 |
| - PayoutInterface, |
11 | 24 | PayoutGroupInterface,
|
| 25 | + PayoutInterface, |
12 | 26 | PayoutRecipientInterface,
|
13 | 27 | PayoutRecipients,
|
14 | 28 | RateInterface,
|
15 | 29 | Rates
|
16 | 30 | } from './Model';
|
17 |
| -import { |
18 |
| - BitPayClient, |
19 |
| - RateClient, |
20 |
| - CurrencyClient, |
21 |
| - InvoiceClient, |
22 |
| - RefundClient, |
23 |
| - PayoutClient, |
24 |
| - PayoutGroupClient, |
25 |
| - PayoutRecipientClient, |
26 |
| - LedgerClient, |
27 |
| - BillClient, |
28 |
| - WalletClient, |
29 |
| - SettlementClient |
30 |
| -} from './Client/index'; |
31 | 31 |
|
32 |
| -import { TokenContainer } from './TokenContainer'; |
| 32 | +import * as fs from 'fs'; |
33 | 33 | import { Environment } from './Environment';
|
34 |
| -import { GuidGenerator } from './util/GuidGenerator'; |
| 34 | +import { BitPayExceptionProvider } from './Exceptions/BitPayExceptionProvider'; |
| 35 | +import { CurrencyInterface } from './Model/Currency/Currency'; |
35 | 36 | import { InvoiceEventTokenInterface } from './Model/Invoice/InvoiceEventToken';
|
36 | 37 | import { RefundInterface } from './Model/Invoice/Refund';
|
37 |
| -import { ParamsRemover } from './util/ParamsRemover'; |
38 |
| -import { WalletInterface } from './Model/Wallet/Wallet'; |
39 | 38 | import { SettlementInterface } from './Model/Settlement/Settlement';
|
| 39 | +import { WalletInterface } from './Model/Wallet/Wallet'; |
40 | 40 | import { PosToken } from './PosToken';
|
41 | 41 | import { PrivateKey } from './PrivateKey';
|
42 |
| -import { CurrencyInterface } from './Model/Currency/Currency'; |
43 |
| -import * as fs from 'fs'; |
44 |
| -import { BitPayExceptionProvider } from './Exceptions/BitPayExceptionProvider'; |
| 42 | +import { TokenContainer } from './TokenContainer'; |
| 43 | +import { GuidGenerator } from './util/GuidGenerator'; |
| 44 | +import { ParamsRemover } from './util/ParamsRemover'; |
45 | 45 |
|
46 | 46 | export class Client {
|
47 | 47 | private bitPayClient: BitPayClient;
|
@@ -311,10 +311,12 @@ export class Client {
|
311 | 311 | * The intent of this call is to address issues when BitPay sends a webhook but the client doesn't receive it,
|
312 | 312 | * so the client can request that BitPay resend it.
|
313 | 313 | * @param invoiceId The id of the invoice for which you want the last webhook to be resent.
|
| 314 | + * @param invoiceToken The resource token for the invoiceId. |
| 315 | + * This token can be retrieved from the Bitpay's invoice object. |
314 | 316 | * @return Boolean status of request
|
315 | 317 | */
|
316 |
| - public async requestInvoiceWebhookToBeResent(invoiceId: string): Promise<boolean> { |
317 |
| - return this.createInvoiceClient().requestInvoiceWebhookToBeResent(invoiceId); |
| 318 | + public async requestInvoiceWebhookToBeResent(invoiceId: string, invoiceToken: string): Promise<boolean> { |
| 319 | + return this.createInvoiceClient().requestInvoiceWebhookToBeResent(invoiceId, invoiceToken); |
318 | 320 | }
|
319 | 321 |
|
320 | 322 | /**
|
@@ -389,10 +391,12 @@ export class Client {
|
389 | 391 | * Send a refund notification.
|
390 | 392 | *
|
391 | 393 | * @param refundId A BitPay refund ID.
|
| 394 | + * @param refundToken The resource token for the refundId. |
| 395 | + * This token can be retrieved from the Bitpay's refund object. |
392 | 396 | * @return An updated Refund Object
|
393 | 397 | */
|
394 |
| - public async sendRefundNotification(refundId: string): Promise<boolean> { |
395 |
| - return this.createRefundClient().sendRefundNotification(refundId); |
| 398 | + public async sendRefundNotification(refundId: string, refundToken: string): Promise<boolean> { |
| 399 | + return this.createRefundClient().sendRefundNotification(refundId, refundToken); |
396 | 400 | }
|
397 | 401 |
|
398 | 402 | /**
|
|
0 commit comments