Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dunning): Drop lago_invoice_ids from PSPs metadata payloads #2533

Merged
merged 2 commits into from
Sep 4, 2024
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: 0 additions & 1 deletion app/services/payment_providers/adyen_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def update_payment_status(event, payment_type)
metadata = {
payment_type:,
lago_invoice_id: event.dig('additionalData', 'metadata.lago_invoice_id'),
lago_invoice_ids: event.dig('additionalData', 'metadata.lago_invoice_ids'),
lago_payment_request_id: event.dig('additionalData', 'metadata.lago_payment_request_id'),
lago_payable_type: event.dig('additionalData', 'metadata.lago_payable_type')
}
Expand Down
1 change: 0 additions & 1 deletion app/services/payment_requests/payments/adyen_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def payment_url_params
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payable.id,
lago_invoice_ids: payable.invoice_ids,
payment_type: "one-time"
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/services/payment_requests/payments/gocardless_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ def create_gocardless_payment
retry_if_possible: false,
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payable.id,
lago_invoice_ids: payable.invoice_ids
lago_payment_request_id: payable.id
},
links: {
mandate: mandate_id
Expand Down
4 changes: 1 addition & 3 deletions app/services/payment_requests/payments/stripe_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ def stripe_payment_payload
description:,
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payable.id,
lago_invoice_ids: payable.invoice_ids
lago_payment_request_id: payable.id
}
}
end
Expand Down Expand Up @@ -271,7 +270,6 @@ def payment_url_payload
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payable.id,
lago_invoice_ids: payable.invoice_ids,
payment_type: "one-time"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"threeds2.cardEnrolled": "false",
"recurringProcessingModel": "CardOnFile",
"metadata.lago_payment_request_id": "ec82efeb-88bb-44f8-ba30-0d55b3fd583a",
"metadata.lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"metadata.lago_payable_type": "InvalidPayableTypeName"
},
"amount": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"threeds2.cardEnrolled": "false",
"recurringProcessingModel": "CardOnFile",
"metadata.lago_payment_request_id": "ec82efeb-88bb-44f8-ba30-0d55b3fd583a",
"metadata.lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"metadata.lago_payable_type": "PaymentRequest"
},
"amount": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"livemode": false,
"metadata": {
"lago_payment_request_id": "a587e552-36bc-4334-81f2-abcbf034ad3f",
"lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"lago_payable_type": "InvalidPayableTypeName"
},
"on_behalf_of": null,
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/stripe/charge_event_payment_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"livemode": false,
"metadata": {
"lago_payment_request_id": "a587e552-36bc-4334-81f2-abcbf034ad3f",
"lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"lago_payable_type": "PaymentRequest"
},
"on_behalf_of": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"livemode": false,
"metadata": {
"lago_payment_request_id": "a587e552-36bc-4334-81f2-abcbf034ad3f",
"lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"lago_payable_type": "InvalidPayableTypeName"
},
"next_action": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"livemode": false,
"metadata": {
"lago_payment_request_id": "a587e552-36bc-4334-81f2-abcbf034ad3f",
"lago_invoice_ids": ["invoice_id_1", "invoice_id_2"],
"lago_payable_type": "PaymentRequest"
},
"next_action": null,
Expand Down
2 changes: 0 additions & 2 deletions spec/services/payment_providers/stripe_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@
provider_payment_id: "pi_1JKS2Y2VYugoKSBzNHPFBNj9",
status: "succeeded",
metadata: {
lago_invoice_ids: %w[invoice_id_1 invoice_id_2],
lago_payment_request_id: "a587e552-36bc-4334-81f2-abcbf034ad3f",
lago_payable_type: "PaymentRequest"
}
Expand Down Expand Up @@ -338,7 +337,6 @@
provider_payment_id: 'pi_123456',
status: "succeeded",
metadata: {
lago_invoice_ids: %w[invoice_id_1 invoice_id_2],
lago_payment_request_id: "a587e552-36bc-4334-81f2-abcbf034ad3f",
lago_payable_type: "PaymentRequest"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@
merchantAccount: adyen_payment_provider.merchant_account,
metadata: {
lago_customer_id: customer.id,
lago_invoice_ids: [invoice_1.id, invoice_2.id],
lago_payment_request_id: payment_request.id,
payment_type: "one-time"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
links: {mandate: "mandate_id"},
metadata: {
lago_customer_id: customer.id,
lago_invoice_ids: [invoice_1.id, invoice_2.id],
lago_payment_request_id: payment_request.id
},
retry_if_possible: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
description: "#{organization.name} - Overdue invoices",
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payment_request.id,
lago_invoice_ids: payment_request.invoice_ids
lago_payment_request_id: payment_request.id
}
},
hash_including(
Expand Down Expand Up @@ -403,7 +402,6 @@
metadata: {
lago_customer_id: customer.id,
lago_payment_request_id: payment_request.id,
lago_invoice_ids: payment_request.invoice_ids,
payment_type: "one-time"
}
}
Expand Down