@@ -15,7 +15,7 @@ import (
1515
1616 "github.com/gin-gonic/gin"
1717 "github.com/joho/godotenv"
18- plaid "github.com/plaid/plaid-go/v27 /plaid"
18+ plaid "github.com/plaid/plaid-go/v31 /plaid"
1919)
2020
2121var (
@@ -812,7 +812,8 @@ func getCraBaseReportHandler(c *gin.Context) {
812812 return
813813 }
814814
815- pdfRequest := plaid .NewCraCheckReportPDFGetRequest (userToken )
815+ pdfRequest := plaid .NewCraCheckReportPDFGetRequest ()
816+ pdfRequest .SetUserToken (userToken )
816817 pdfResponse , _ , err := client .PlaidApi .CraCheckReportPdfGet (ctx ).CraCheckReportPDFGetRequest (* pdfRequest ).Execute ()
817818 if err != nil {
818819 renderError (c , err )
@@ -837,8 +838,9 @@ func getCraBaseReportHandler(c *gin.Context) {
837838
838839func getCraBaseReportWithRetries (ctx context.Context , userToken string ) (* plaid.CraCheckReportBaseReportGetResponse , error ) {
839840 return pollWithRetries (func () (* plaid.CraCheckReportBaseReportGetResponse , error ) {
840- request := plaid.CraCheckReportBaseReportGetRequest {UserToken : userToken }
841- response , _ , err := client .PlaidApi .CraCheckReportBaseReportGet (ctx ).CraCheckReportBaseReportGetRequest (request ).Execute ()
841+ request := plaid .NewCraCheckReportBaseReportGetRequest ()
842+ request .SetUserToken (userToken )
843+ response , _ , err := client .PlaidApi .CraCheckReportBaseReportGet (ctx ).CraCheckReportBaseReportGetRequest (* request ).Execute ()
842844 return & response , err
843845 }, 1000 , 20 )
844846}
@@ -854,7 +856,8 @@ func getCraIncomeInsightsHandler(c *gin.Context) {
854856 return
855857 }
856858
857- pdfRequest := plaid .NewCraCheckReportPDFGetRequest (userToken )
859+ pdfRequest := plaid .NewCraCheckReportPDFGetRequest ()
860+ pdfRequest .SetUserToken (userToken )
858861 pdfRequest .SetAddOns ([]plaid.CraPDFAddOns {plaid .CRAPDFADDONS_CRA_INCOME_INSIGHTS })
859862 pdfResponse , _ , err := client .PlaidApi .CraCheckReportPdfGet (ctx ).CraCheckReportPDFGetRequest (* pdfRequest ).Execute ()
860863 if err != nil {
@@ -880,8 +883,9 @@ func getCraIncomeInsightsHandler(c *gin.Context) {
880883
881884func getCraIncomeInsightsWithRetries (ctx context.Context , userToken string ) (* plaid.CraCheckReportIncomeInsightsGetResponse , error ) {
882885 return pollWithRetries (func () (* plaid.CraCheckReportIncomeInsightsGetResponse , error ) {
883- request := plaid.CraCheckReportIncomeInsightsGetRequest {UserToken : userToken }
884- response , _ , err := client .PlaidApi .CraCheckReportIncomeInsightsGet (ctx ).CraCheckReportIncomeInsightsGetRequest (request ).Execute ()
886+ request := plaid .NewCraCheckReportIncomeInsightsGetRequest ()
887+ request .SetUserToken (userToken )
888+ response , _ , err := client .PlaidApi .CraCheckReportIncomeInsightsGet (ctx ).CraCheckReportIncomeInsightsGetRequest (* request ).Execute ()
885889 return & response , err
886890 }, 1000 , 20 )
887891}
@@ -903,8 +907,9 @@ func getCraPartnerInsightsHandler(c *gin.Context) {
903907
904908func getCraPartnerInsightsWithRetries (ctx context.Context , userToken string ) (* plaid.CraCheckReportPartnerInsightsGetResponse , error ) {
905909 return pollWithRetries (func () (* plaid.CraCheckReportPartnerInsightsGetResponse , error ) {
906- request := plaid.CraCheckReportPartnerInsightsGetRequest {UserToken : userToken }
907- response , _ , err := client .PlaidApi .CraCheckReportPartnerInsightsGet (ctx ).CraCheckReportPartnerInsightsGetRequest (request ).Execute ()
910+ request := plaid .NewCraCheckReportPartnerInsightsGetRequest ()
911+ request .SetUserToken (userToken )
912+ response , _ , err := client .PlaidApi .CraCheckReportPartnerInsightsGet (ctx ).CraCheckReportPartnerInsightsGetRequest (* request ).Execute ()
908913 return & response , err
909914 }, 1000 , 20 )
910915}
0 commit comments