STRIPE NameError: undefined local variable or method `request' for main:Object
STRIPE NameError: undefined local variable or method `request' for main:Object
我正在尝试更新连接的帐户,以便它可以接受服务条款并能够创建付款。但是,当我尝试 运行 控制台中的代码以便它更新时,它不会更新,并且会弹出有关 ip 地址的错误。我正在按照 stripe 的文档更新帐户。
我试过不在 tos_acceptance 中包含 ip,但 ip 是必需的!
我试过 'ip' 并在 request.remote_ip
周围加上引号
"acct_id_12345", {
tos_acceptance: {
date: Time.now.to_i,
ip: request.remote_ip,
},
},
)
出现的错误是:
NameError: undefined local variable or method `request' for main:Object
你是 运行 某处 request
方法不存在的代码,例如。在控制器之外。
我只需要命名请求变量这是最终产品:
account = Stripe::Account.create({
country: "US",
type: "custom",
requested_capabilities: ["transfers", "card_payments"],
email: current_user.email,
business_type: "company",
company: {
name: business.name,
address: {
city: business.city,
country: 'US',
line1: business.address,
postal_code: business.zip_code,
state: business.state,
},
phone: '3128880912',
tax_id: '000000000',
},
external_account: {
country: "US",
object: "bank_account",
account_number: params[:account_number],
routing_number: params[:routing_number],
},
settings: {
payouts: {
schedule: {
interval: 'monthly',
monthly_anchor: 1,
},
},
},
business_profile: {
url: business.website,
mcc: 5734,
},
tos_acceptance: {
date: Time.now.to_i,
ip: '181.48.147.209',
},
})
我正在尝试更新连接的帐户,以便它可以接受服务条款并能够创建付款。但是,当我尝试 运行 控制台中的代码以便它更新时,它不会更新,并且会弹出有关 ip 地址的错误。我正在按照 stripe 的文档更新帐户。
我试过不在 tos_acceptance 中包含 ip,但 ip 是必需的! 我试过 'ip' 并在 request.remote_ip
周围加上引号"acct_id_12345", {
tos_acceptance: {
date: Time.now.to_i,
ip: request.remote_ip,
},
},
)
出现的错误是:
NameError: undefined local variable or method `request' for main:Object
你是 运行 某处 request
方法不存在的代码,例如。在控制器之外。
我只需要命名请求变量这是最终产品:
account = Stripe::Account.create({
country: "US",
type: "custom",
requested_capabilities: ["transfers", "card_payments"],
email: current_user.email,
business_type: "company",
company: {
name: business.name,
address: {
city: business.city,
country: 'US',
line1: business.address,
postal_code: business.zip_code,
state: business.state,
},
phone: '3128880912',
tax_id: '000000000',
},
external_account: {
country: "US",
object: "bank_account",
account_number: params[:account_number],
routing_number: params[:routing_number],
},
settings: {
payouts: {
schedule: {
interval: 'monthly',
monthly_anchor: 1,
},
},
},
business_profile: {
url: business.website,
mcc: 5734,
},
tos_acceptance: {
date: Time.now.to_i,
ip: '181.48.147.209',
},
})