forked from iugu/iugu-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iugu#65 from EduBem/feature/desconto_pontualidade
Ajusta invoicemodel com early_payment_discounts
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,12 @@ public async Task Create_a_valid_invoice() | |
new CustomVariables { name = "TaxaPlataformaEdux", value = "1,00" } | ||
}; | ||
|
||
var earlyPaymentDiscounts = new List<EarlyPaymentDiscounts> | ||
{ | ||
new EarlyPaymentDiscounts { days = 10, percent = "8.2" }, | ||
new EarlyPaymentDiscounts { days = 5, percent = "5" } | ||
}; | ||
|
||
var invoiceDate = DateTime.Now.AddDays(2); | ||
|
||
var customer = new CustomerRequestMessage | ||
|
@@ -58,7 +64,7 @@ public async Task Create_a_valid_invoice() | |
|
||
var invoiceItems = new[] { new Item { description = "Mensalidade", price_cents = 65000, quantity = 1 } }; | ||
invoice = await apiInvoice.CreateAsync("[email protected]", invoiceDate, invoiceItems, null, null, null, 0, | ||
0, null, false, subscription.id, null, null, customVariables, _payer) | ||
0, null, false, subscription.id, null, null, customVariables, _payer, true, earlyPaymentDiscounts) | ||
.ConfigureAwait(false); | ||
}; | ||
|
||
|
@@ -110,7 +116,7 @@ public async Task Create_a_new_invoice_and_cancel_after() | |
|
||
var invoiceItems = new[] { new Item { description = "Mensalidade", price_cents = 65000, quantity = 1 } }; | ||
var current = await apiInvoice.CreateAsync("[email protected]", invoiceDate, invoiceItems, null, null, null, 0, 0, | ||
null, false, subscription.id, null, null, customVariables, _payer).ConfigureAwait(false); | ||
null, false, subscription.id, null, null, customVariables, _payer, false, null).ConfigureAwait(false); | ||
|
||
invoice = await apiInvoice.DuplicateAsync(current.id, new InvoiceDuplicateRequestMessage(newDate)).ConfigureAwait(false); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters