|
| 1 | +import * as fs from 'fs'; |
| 2 | +import * as path from 'path'; |
1 | 3 | import { Client } from '../src'; |
2 | | -import { Buyer } from '../src/Model/Invoice/Buyer'; |
| 4 | +import * as BitPaySDK from '../src/index'; |
3 | 5 | import { |
4 | 6 | Bill, |
5 | | - PayoutRecipient, |
6 | | - Payout, |
| 7 | + BillInterface, |
7 | 8 | Invoice, |
8 | 9 | InvoiceInterface, |
9 | | - PayoutRecipientInterface, |
10 | | - PayoutInterface, |
11 | | - LedgerInterface, |
12 | 10 | LedgerEntryInterface, |
13 | | - BillInterface, |
14 | | - PayoutRecipients, |
15 | | - PayoutGroupInterface |
| 11 | + LedgerInterface, |
| 12 | + Payout, |
| 13 | + PayoutGroupInterface, |
| 14 | + PayoutInterface, |
| 15 | + PayoutRecipient, |
| 16 | + PayoutRecipientInterface, |
| 17 | + PayoutRecipients |
16 | 18 | } from '../src/Model'; |
17 | | -import * as fs from 'fs'; |
18 | | -import * as path from 'path'; |
19 | | -import { InvoiceEventTokenInterface } from '../src/Model/Invoice/InvoiceEventToken'; |
20 | | -import { Refund, RefundInterface } from '../src/Model/Invoice/Refund'; |
| 19 | +import { billInterfaceSchema } from '../src/Model/Bill/Bill.zod'; |
21 | 20 | import { Item } from '../src/Model/Bill/Item'; |
22 | | -import { WalletInterface } from '../src/Model/Wallet/Wallet'; |
23 | 21 | import { CurrencyInterface } from '../src/Model/Currency/Currency'; |
24 | | -import * as BitPaySDK from '../src/index'; |
25 | | -import { rateInterfaceSchema } from '../src/Model/Rates/Rate.zod'; |
26 | 22 | import { currencyInterfaceSchema } from '../src/Model/Currency/Currency.zod'; |
| 23 | +import { Buyer } from '../src/Model/Invoice/Buyer'; |
27 | 24 | import { invoiceSchema } from '../src/Model/Invoice/Invoice.zod'; |
| 25 | +import { InvoiceEventTokenInterface } from '../src/Model/Invoice/InvoiceEventToken'; |
28 | 26 | import { invoiceEventTokenInterfaceSchema } from '../src/Model/Invoice/InvoiceEventToken.zod'; |
| 27 | +import { Refund, RefundInterface } from '../src/Model/Invoice/Refund'; |
29 | 28 | import { refundInterfaceSchema } from '../src/Model/Invoice/Refund.zod'; |
30 | | -import { payoutRecipientInterfaceSchema } from '../src/Model/Payout/PayoutRecipient.zod'; |
31 | | -import { payoutInterfaceSchema } from '../src/Model/Payout/Payout.zod'; |
32 | | -import { payoutGroupInterfaceSchema } from '../src/Model/Payout/PayoutGroup.zod'; |
33 | 29 | import { ledgerInterfaceSchema } from '../src/Model/Ledger/Ledger.zod'; |
34 | 30 | import { ledgerEntryInterfaceSchema } from '../src/Model/Ledger/LedgerEntry.zod'; |
35 | | -import { billInterfaceSchema } from '../src/Model/Bill/Bill.zod'; |
| 31 | +import { payoutInterfaceSchema } from '../src/Model/Payout/Payout.zod'; |
| 32 | +import { payoutGroupInterfaceSchema } from '../src/Model/Payout/PayoutGroup.zod'; |
| 33 | +import { payoutRecipientInterfaceSchema } from '../src/Model/Payout/PayoutRecipient.zod'; |
| 34 | +import { rateInterfaceSchema } from '../src/Model/Rates/Rate.zod'; |
| 35 | +import { WalletInterface } from '../src/Model/Wallet/Wallet'; |
36 | 36 | import { walletInterfaceSchema } from '../src/Model/Wallet/Wallet.zod'; |
37 | 37 | const Currencies = BitPaySDK.Currency; |
38 | 38 | const PayoutStatus = BitPaySDK.PayoutStatus; |
@@ -228,7 +228,7 @@ describe('BitPaySDK.Client', () => { |
228 | 228 | * - GetRefund(string refundId) |
229 | 229 | * - GetRefundByGuid(string guid) |
230 | 230 | * - GetRefunds(string invoiceId) |
231 | | - * - SendRefundNotification(string refundId) |
| 231 | + * - SendRefundNotification(string refundId, string refundToken) |
232 | 232 | * - CancelRefund(string refundId) |
233 | 233 | * - CancelRefundByGuid(string guid) |
234 | 234 | * <p> |
@@ -279,7 +279,9 @@ describe('BitPaySDK.Client', () => { |
279 | 279 | }); |
280 | 280 |
|
281 | 281 | it('should send refund notification', async () => { |
282 | | - const result: boolean = await client.sendRefundNotification(refundId); |
| 282 | + const retrieveRefund: RefundInterface = await client.getRefund(refundId); |
| 283 | + |
| 284 | + const result: boolean = await client.sendRefundNotification(refundId, retrieveRefund.token); |
283 | 285 | expect(result).toBe(true); |
284 | 286 | }); |
285 | 287 |
|
|
0 commit comments