我想将Mpesa集成到google表单中。用户使用该表格支付,让我们说一下登记费吧。
发布于 2017-12-05 14:34:45
发布于 2016-05-11 06:43:56
我认为,通过使用Apps脚本创建google表单,这是可能的。
窗体服务 此服务允许脚本创建、访问和修改Google窗体。
下面是使用Apps脚本创建google表单的示例代码。
// Create a new form, then add a checkbox question, a multiple choice question,
// a page break, then a date question and a grid of questions.
var form = FormApp.create('New Form');
var item = form.addCheckboxItem();
item.setTitle('What condiments would you like on your hot dog?');
item.setChoices([
item.createChoice('Ketchup'),
item.createChoice('Mustard'),
item.createChoice('Relish')
]);
form.addMultipleChoiceItem()
.setTitle('Do you prefer cats or dogs?')
.setChoiceValues(['Cats','Dogs'])
.showOtherOption(true);
form.addPageBreakItem()
.setTitle('Getting to know you');
form.addDateItem()
.setTitle('When were you born?');
form.addGridItem()
.setTitle('Rate your interests')
.setRows(['Cars', 'Computers', 'Celebrities'])
.setColumns(['Boring', 'So-so', 'Interesting']);
Logger.log('Published URL: ' + form.getPublishedUrl());
Logger.log('Editor URL: ' + form.getEditUrl());然后,您可以在应用程序脚本中集成第三方API。
外部API Google脚本可以与来自网络各地的API交互。本指南展示了如何在脚本中使用不同类型的API。 几十个Google都可以在Apps脚本中获得,无论是内置服务还是高级服务。如果您想使用无法作为Apps脚本服务使用的Google (或非Google) API,您可以通过URL获取服务连接到API的公共HTTP接口。 下面的示例向YouTube API发出请求,并返回与查询
skateboarding dog匹配的视频提要。
var url = 'https://gdata.youtube.com/feeds/api/videos?'
+ 'q=skateboarding+dog'
+ '&start-index=21'
+ '&max-results=10'
+ '&v=2';
var response = UrlFetchApp.fetch(url);
Logger.log(response);类似地,下面的示例将视频上载到YouTube。也使用UrlFetchApp.fetch()
var payload = 'XXXXX'; // Replace with raw video data.
var headers = {
'GData-Version': '2',
'Slug': 'dog-skateboarding.mpeg'
// Add any other required parameters for the YouTube API.
};
var url = 'https://uploads.gdata.youtube.com/feeds/api/users/default/uploads';
var options = {
'method': 'post',
'headers': headers,
'payload': payload
};
var response = UrlFetchApp.fetch(url, options);发布于 2016-11-05 03:45:49
请查查我对类似问题的回答:移动货币如Mpesa和AirtelMoney与Android的集成
探索是否有可能使用custome生成的Mpesa api开发一个android应用程序,以帮助您在线存储Mpesa消息,并优化这些信息,以便在Google窗体上使用。
https://stackoverflow.com/questions/37109955
复制相似问题