我用我的應用程序Stripe grails plugin,我提示以下錯誤:使用Grails的條紋插件
Class:groovy.lang.MissingPropertyExceptionMessage:No such property: Stripe for class: com.myApp.app.SubscriptionRequestController
這裏是我的行動:
def charge(String stripeToken, Double amount) {
Stripe.apiKey = grailsApplication.config.grails.plugins.stripe.secretKey
def amountInCents = (amount * 100) as Integer
def chargeParams = [
'amount': amountInCents,
'currency': 'usd',
'card': stripeToken,
'description': '[email protected]'
]
def status
try {
Charge.create(chargeParams)
status = 'Your purchase was successful.'
} catch(CardException) {
status = 'There was an error processing your credit card.'
}
redirect(action: "confirmation", params: [msg: status])
return
}
我也得到下面的錯誤,因爲我安裝插件時,我刪除它我沒有看到它,它發生時試圖訪問或刷新任何視圖:
java.lang.RuntimeException: It looks like you are missing some calls to the r:layoutResources tag. After rendering your page the following have not been rendered: [head]
現在作爲上述我沒有得到這個錯誤了'java.lang.RuntimeException:它看起來像你缺少一些調用r:layoutResources標記。在渲染你的頁面之後,下面的代碼沒有被渲染:[head]'但是我仍然無法成功完成交易,我注意到'Charge'操作未定義,請參閱截圖http://postimg.org/image/ k16zioat3 /,我試圖導入'進口com.stripe.Stripe',但我得到'無法解決課com.stripe.Stripe' – Sherif
當然,讓我們通過打開另一個問題來解決它。讓我知道一旦你打開它並在那裏發佈你的屏幕截圖。 :) – Quchie
如果你接受這個答案,你能接受並關閉它嗎?謝謝 – Quchie