dqh1992 2013-04-11 21:30
浏览 65
已采纳

phonegap / cordova PayPal集成

I'm trying to integrate PayPal payments within my Phonegap app. I can't see a cross platform way to do it.

I can only see OS specific plugins which I can't use in Phonegap build. Is there a way of integrating it using the childbrowser? Also, I failed to find a plugin for Blackberry.

Note: I use Phonegap build, so I prefer a plugin-less solution.

  • 写回答

1条回答 默认 最新

  • doob0526 2013-04-15 08:42
    关注

    what you can do is the in app browser to connect to a php driven page online and there do your paypal stuff.

    http://docs.phonegap.com/en/2.3.0/cordova_inappbrowser_inappbrowser.md.html

    function onDeviceReady() {
         var ref = window.open('http://apache.org', '_blank', 'location=yes');
         ref.addEventListener('loadstart', function() { alert('start: ' + event.url); });
         ref.addEventListener('loadstop', function() { alert('stop: ' + event.url); });
         ref.addEventListener('exit', function() { alert(event.type); });
    }
    

    Remember to white list the url that you will be using within phonegap else you will not to be able to make a connection.

    On the php side write your own restfull api to handle the processing of the payments try to minimize the data sent to and from the api also try to use a secure connection if possible.

    paypal examples can be found here: https://www.x.com/developers/paypal/documentation-tools/paypal-code-samples

    its a solution but i do advise to use plugins for every platform, with those you can better guarantee safety, less bugs and less development time.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置