MarkEdmondson1234 / stripeR

Interface between Stripe API and R
Other
8 stars 7 forks source link

could not find function "amount" #15

Open agronomofiorentini opened 1 year ago

agronomofiorentini commented 1 year ago

Dear developer, I am trying to use the stripeR package to allow user pay directly through the shiny app.

I am using the following code (example code that you provide) and i have setted in the .Renviron the following environment variables:

  1. secret_live
  2. public_live
library(shiny)
library(stripeR)

# UI function
ui <- fluidPage(

  titlePanel("StripeR Demo"),

  # A Stripe Form
  sidebarLayout(
    sidebarPanel(
      stripeRShinyUI("stripe1")
    ),

    mainPanel(

    )
  )
)

# Server function
server <-function(input, output, session){

  callModule(stripeRShiny,
             "stripe1",
             amount=2000,
             plan="example",
             formAmount=reactive("$20.00"),
             formText=reactive("Please pay $20.00"))

}

# Run the app
shinyApp(ui, server)

but when i am running the application and tryining to do the payment this is the error ouput in my console.

Listening on http://127.0.0.1:6603
Warning: Error in amount: could not find function "amount"
  1: runApp

Moreover, i am sure that the dashboard of my stripe account is set to live and not test. What can i do to solve this problem?

i will also report my r session information

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=Italian_Italy.utf8  LC_CTYPE=Italian_Italy.utf8   
[3] LC_MONETARY=Italian_Italy.utf8 LC_NUMERIC=C                  
[5] LC_TIME=Italian_Italy.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] stripeR_0.0.9002 shiny_1.7.4     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.10       rstudioapi_0.14   magrittr_2.0.3    xtable_1.8-4     
 [5] R6_2.5.1          rlang_1.1.1       fastmap_1.1.1     httr_1.4.6       
 [9] tools_4.2.0       cli_3.6.1         jquerylib_0.1.4   withr_2.5.0      
[13] htmltools_0.5.5   ellipsis_0.3.2    digest_0.6.31     fontawesome_0.5.1
[17] lifecycle_1.0.3   crayon_1.5.2      later_1.3.1       sass_0.4.6       
[21] promises_1.2.0.1  memoise_2.0.1     cachem_1.0.8      mime_0.12        
[25] compiler_4.2.0    bslib_0.4.2       jsonlite_1.8.4    httpuv_1.6.11