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

fix(cashfree): Fix webhook and payment flow #3106

Merged
merged 1 commit into from
Jan 27, 2025
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
4 changes: 2 additions & 2 deletions app/controllers/webhooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def cashfree
organization_id: params[:organization_id],
code: params[:code].presence,
body: request.body.read,
timestamp: request.headers['X-Cashfree-Timestamp'],
signature: request.headers['X-Cashfree-Signature']
timestamp: request.headers['X-Cashfree-Timestamp'] || request.headers['X-Webhook-Timestamp'],
signature: request.headers['X-Cashfree-Signature'] || request.headers['X-Webhook-Signature']
)

unless result.success?
Expand Down
3 changes: 2 additions & 1 deletion app/services/invoices/payments/cashfree_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def payment_url_params
link_notes: {
lago_customer_id: customer.id,
lago_invoice_id: invoice.id,
invoice_issuing_date: invoice.issuing_date.iso8601
invoice_issuing_date: invoice.issuing_date.iso8601,
payment_type: "one-time"
},
link_id: "#{SecureRandom.uuid}.#{invoice.payment_attempts}",
link_amount: invoice.total_amount_cents / 100.to_f,
Expand Down
Loading