简体   繁体   English

Google 表单在提交时启动 Paypal

[英]Google Forms Launch Paypal on Submit

I want to use the URL method of launching a Paypal purchase flow described in this SO question.我想使用此 SO 问题中描述的启动 Paypal 购买流程的 URL 方法

Problem is, I can't seem to figure out how to launch a new website on the submission of a form.问题是,我似乎无法弄清楚如何在提交表单时启动新网站。 I've created a function and linked it to the onSubmit through the project triggers button but that's where I've stalled.我创建了一个函数并通过项目触发器按钮将它链接到 onSubmit ,但这就是我停滞不前的地方。 I can't seem to find any other information on it.我似乎找不到关于它的任何其他信息。 Am I going about this the wrong way or is there something else I should be looking at?我是在以错误的方式解决这个问题还是我应该看其他东西?

function launchPayPal() {
     //launch website here?
}

在此处输入图片说明

Google Forms do not allow you to redirect to another web page on form submissions. Google 表单不允许您在提交表单时重定向到另一个网页。 You can however add a PayPal link in the message that shows up on the screen when a form is submitted.但是,您可以在提交表单时显示在屏幕上的消息中添加 PayPal 链接。

You need a website, or a Google Apps Script Stand Alone App.您需要一个网站或一个 Google Apps 脚本独立应用程序。 Instead of triggering a Google Form to open from your spreadsheet, have a link to a Google Site, or a link to a Google Apps Script Stand Alone App.不要触发从电子表格中打开 Google 表单,而是提供指向 Google 站点的链接或指向 Google Apps 脚本独立应用程序的链接。 Or you could have a Dialog Box or Sidebar with HTML in it that opens up.或者,您可以打开一个带有 HTML 的对话框或侧边栏。 That way, the HTML Dialog Box or the Sidebar could open up Pay Pal.这样,HTML 对话框或侧边栏就可以打开 Pay Pal。 So, you need to create something with HTML rather than use a Google Form.因此,您需要使用 HTML 创建一些东西,而不是使用 Google 表单。 So, your options are:所以,你的选择是:

  • Google Site with HTML in it.包含 HTML 的 Google 网站。
  • Dialog Box with HTML带有 HTML 的对话框
  • Sidebar with HTML带有 HTML 的侧边栏
  • Apps Script HTML Service Stand Alone App应用程序脚本 HTML 服务独立应用程序

As Amit mentioned, Google Forms do not allow you to redirect on form submission.正如 Amit 所提到的,Google 表单不允许您重定向表单提交。 So, you can add the paypal url in the confirmation message and instruct users to click on it.因此,您可以在确认消息中添加 paypal url 并指示用户单击它。 However, this works only when the amount doesn't change based on the form response.但是,这仅在金额不会根据表单响应发生变化时才有效。

eg: If your paypal url is https://paypal.me/[your-paypal-id]/20 , 20 is the amount you want to collect.例如:如果您的贝宝网址是https://paypal.me/[your-paypal-id]/20 ,则 20 是您要收取的金额。 This 20 can't be dynamically changed in the confirmation message这20个不能在确认消息中动态更改

If you want to calculate this amount based on the answers in the form, then you can try these 3 options:如果您想根据表格中的答案计算此金额,则可以尝试以下 3 个选项:

  1. Send an email for payment from Google Sheets: You can collect responses in Google Sheets and use formula to calculate the amount to be paid.从 Google 表格发送付款电子邮件:您可以在 Google 表格中收集回复并使用公式计算要支付的金额。 Then you can send batch emails with paypal urls along with the correct amount to be paid using mail merge addons.然后,您可以使用邮件合并插件发送带有贝宝网址的批量电子邮件以及要支付的正确金额。

  2. Send an email for payment using Apps Script: You can trigger apps script on form submit and calculate the amount to be paid.使用 Apps 脚本发送付款电子邮件:您可以在表单提交时触发应用程序脚本并计算要支付的金额。 Then you can send email with paypal url almost instantaneously after submit.然后您可以在提交后几乎立即发送带有贝宝网址的电子邮件。

  3. Collect payments using Google Forms addons: You can use payment addons that collect payment directly in Google Forms.使用 Google 表单插件收款:您可以使用直接在 Google 表单中收款的付款插件。 They change the form runtime in such a way that respondents have to pay before submitting the form.他们以这样一种方式更改表单运行时,即受访者必须在提交表单之前付费。

You can read the pros and cons of these options here: https://neartail.com/order-form/google-forms-payment-options.html您可以在此处阅读这些选项的优缺点: https : //neartail.com/order-form/google-forms-payment-options.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM