Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/lago/api/resources/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def whitelist_params(params)
result_hash = {
invoice_id: params[:invoice_id],
reason: params[:reason],
description: params[:description],
refund_status: params[:refund_status],
credit_amount_cents: params[:credit_amount_cents],
refund_amount_cents: params[:refund_amount_cents],
Expand Down
3 changes: 1 addition & 2 deletions lib/lago/api/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def preview(params)
end

def whitelist_params(params)
result = params.slice(:payment_status, :net_payment_term)
result = params.slice(:payment_status)

if params.key?(:metadata)
metadata = whitelist_metadata(params[:metadata])
Expand Down Expand Up @@ -124,7 +124,6 @@ def one_off_params(params)
result = {
external_customer_id: params[:external_customer_id],
currency: params[:currency],
net_payment_term: params[:net_payment_term],
skip_psp: params[:skip_psp],
billing_entity_code: params[:billing_entity_code],
purchase_order_number: params[:purchase_order_number]
Expand Down
1 change: 1 addition & 0 deletions spec/factories/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
factory :create_credit_note, class: OpenStruct do
invoice_id { '1a901a90-1a90-1a90-1a90-1a901a901a90' }
reason { 'duplicated_charge' }
description { 'Credit note description' }
items { build_list(:create_credit_note_item, 2).map(&:to_h) }
metadata { { 'foo' => 'bar', 'baz' => 'qux' } }
end
Expand Down
2 changes: 0 additions & 2 deletions spec/factories/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
factory :create_invoice, class: OpenStruct do
external_customer_id { '_ID_' }
currency { 'EUR' }
net_payment_term { 0 }
fees do
[
{
Expand All @@ -17,7 +16,6 @@

factory :update_invoice, class: OpenStruct do
payment_status { 'succeeded' }
net_payment_term { 0 }
metadata do
[
{
Expand Down
5 changes: 0 additions & 5 deletions spec/lago/api/resources/invoice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
{
external_customer_id: '_ID_',
currency: 'EUR',
net_payment_term: 0,
skip_psp: true,
fees: [
{
Expand All @@ -48,7 +47,6 @@

expect(invoice).to have_attributes(
lago_id: invoice_id,
net_payment_term: 0,
payment_due_date: '2022-06-02',
payment_status: 'succeeded',
payment_overdue: false,
Expand All @@ -75,7 +73,6 @@
{
external_customer_id: '_ID_',
currency: 'EUR',
net_payment_term: 0,
skip_psp: true,
fees: [
{
Expand Down Expand Up @@ -109,7 +106,6 @@
{
external_customer_id: '_ID_',
currency: 'EUR',
net_payment_term: 0,
skip_psp: true,
fees: [
{
Expand Down Expand Up @@ -166,7 +162,6 @@
{
external_customer_id: '_ID_',
currency: 'EUR',
net_payment_term: 0,
skip_psp: true,
billing_entity_code: 'eu_entity',
fees: [
Expand Down
Loading