Enable stripe connect in invoice settings#396
Conversation
Current Code Coverage Percent of this PR:84.55 %Files having coverage below 100%
|
|
@apoorv-mishra what is pending on this? Need this so we can accept client payments. Freshbooks costs us 600$ per month |
|
Stripe connect and checkout is already integrated. We should already be able to receive payments. This PR is particularly for invoice settings to enable different payment methods for the customers. If you check stripe dashboard, receivables through card payments are auto enabled for connected accounts. |
c7f4446 to
5da9900
Compare
akhilgkrishnan
left a comment
There was a problem hiding this comment.
Added some suggestions
|
|
||
| class InternalApi::V1::Payments::ProvidersController < ApplicationController | ||
| def create | ||
| authorize :create, policy_class: Payments::ProviderPolicy |
There was a problem hiding this comment.
why do we need to specify the action explicitly?
There was a problem hiding this comment.
Any alternate ways to make it work? Because it fails without specifying the action.
| import React from "react"; | ||
|
|
||
| const CustomToggle = ({ isChecked = false, setIsChecked, toggleCss, id }) => ( | ||
| const CustomToggle = ({ isChecked = false, setIsChecked, toggleCss, id, onToggle = () => {}}) => ( // eslint-disable-line |
There was a problem hiding this comment.
can you add the type checking?
There was a problem hiding this comment.
Candidate for another PR. It's used in multiple places and may break existing flows. Keeping it as it is in this PR.
app/javascript/src/components/Invoices/Generate/Invoice_settings.tsx
Outdated
Show resolved
Hide resolved
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||
| import React, { useState } from "react"; | ||
| import React, { useState, useEffect } from "react"; | ||
| import { setAuthHeaders, registerIntercepts } from "apis/axios"; |
There was a problem hiding this comment.
we can move this to RouteConfig.tsx so we dont have to set this on each component inside the invoice
There was a problem hiding this comment.
It would be better if you could suggest how as well in a way that it doesn't break existing functionality.
There was a problem hiding this comment.
The x-csrf-token is being set even after removing call to setAuthHeaders. Hence removing it altogether.
6bcd1b3 to
3b24196
Compare
3b24196 to
e410a19
Compare
* Enable stripe connect in invoice settings * Remove option for ach bank transfer * Add model PaymentsProvider and corresponding specs * Add unique index on (name, company_id) * Fix typo and associated specs * Add routes * Implement controller actions * Add specs for GET /internal_api/v1/payments/providers * Add specs for POST /internal_api/v1/payments/providers * Add specs for PATCH /internal_api/v1/payments/providers/:id * Fix db/schema.rb * Integrate provider settings in FE * Fix specs * Fix spec as per pr-#431 * Save default stripe settings after connected account is successfully created * Fix saving duplicate payment methods and prevent sending id in update call * Save default stripe settings if not saved after fetching providers in invoice settings * Remove save button, not required anymore * Reorder controller actions * Remove unused code * Fix component name * Remove unused auto-gen files
Notion card
https://saeloun.notion.site/Setting-on-invoice-for-payment-Backend-8c6fc57d900f4110b4a971cc6364ed55
Summary
Preview
Type of change
Please delete options that are not relevant.
not work as expected)
How Has This Been Tested?
Checklist: