jjzjj

php - PayPal rest api,PHP SDK,计费,我收到错误 REQUIRED_SCOPE_MISSING

coder 2024-04-16 原文

我收到一个错误 REQUIRED_SCOPE_MISSING 执行 PayPal 的 sample/billing/CreatePlan.php 时 我自己的 clientId 和 secret 。使用效果很好 提供的 clientId 和密码。

复制方式:

下载 PayPal-PHP-SDK v0.14.2

去 sample /账单

运行
php 创建计划.php

此文件的第 9 行包括 bootstrap.php 程序。这是 其中定义了 clientId 和 secret。

如果我使用现有的 clientId 和 secret 它会工作正常。如果我用我的 自己的 clientId 和 secret 它会给 此处显示的错误消息。

[myprompt]$ php CreatePlan.php
Warning: This sample may require a server to handle return URL. Cannot execute in  command line. Defaulting URL to http://localhost/sample/billing

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(1) CREATED PLAN
-------------------------------------------------------------

-------------------------------------------------------------
    REQUEST:
{"name":"T-Shirt of the Month Club Plan","description":"Template       creation.","type":"fixed",
"payment_definitions":[{"name":"Regular Payments","type":"REGULAR","frequency":"Month",
"frequency_interval":"2","cycles":"12","amount":{"value":"100.00","currency":"USD"},
"charge_models":[{"type":"SHIPPING","amount":{"value":"10.00","currency":"USD"}}]}],
"merchant_preferences":{"return_url":"http://localhost/sample/billing /ExecuteAgreement.php?success=true",
"cancel_url":"http://localhost/sample/billing/ExecuteAgreement.php?success=false","auto_bill_amount":"yes","initial_fail_amount_action":    "CONTINUE","max_fail_attempts":"0","setup_fee":{"value":"1.00","currency":"USD"}}}

    RESPONSE:
ERROR:Got Http response code 403 when 
accessing https://api.sandbox.paypal.com/v1/payments/billing-plans/.    {"name":"REQUIRED_SCOPE_MISSING",
"message":"Access token does not have required scope",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api  /#REQUIRED_SCOPE_MISSING","debug_id":"261257fb27891"}
-------------------------------------------------------------

我自己的 clientId 和 secret 可以正常工作 付款样本。

最佳答案

要消除此错误,您需要确保您在 developer.paypal.com 上创建的 REST 应用程序在 "下勾选了 "订阅" APP CAPABILITIES” -->> “高级选项”

您可以引用下面的屏幕截图:

关于php - PayPal rest api,PHP SDK,计费,我收到错误 REQUIRED_SCOPE_MISSING,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27049971/

有关php - PayPal rest api,PHP SDK,计费,我收到错误 REQUIRED_SCOPE_MISSING的更多相关文章

  1. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  2. ruby - 难道Lua没有和Ruby的method_missing相媲美的东西吗? - 2

    我好像记得Lua有类似Ruby的method_missing的东西。还是我记错了? 最佳答案 表的metatable的__index和__newindex可以用于与Ruby的method_missing相同的效果。 关于ruby-难道Lua没有和Ruby的method_missing相媲美的东西吗?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/7732154/

  3. ruby-on-rails - Rails 3 I18 : translation missing: da. datetime.distance_in_words.about_x_hours - 2

    我看到这个错误:translationmissing:da.datetime.distance_in_words.about_x_hours我的语言环境文件:http://pastie.org/2944890我的看法:我已将其添加到我的application.rb中:config.i18n.load_path+=Dir[Rails.root.join('my','locales','*.{rb,yml}').to_s]config.i18n.default_locale=:da如果我删除I18配置,帮助程序会处理英语。更新:我在config/enviorments/devolpment

  4. ruby-on-rails - 我更新了 ruby​​ gems,现在到处都收到解析树错误和弃用警告! - 2

    简而言之错误:NOTE:Gem::SourceIndex#add_specisdeprecated,useSpecification.add_spec.Itwillberemovedonorafter2011-11-01.Gem::SourceIndex#add_speccalledfrom/opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91./opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:275:in`==':und

  5. ruby-on-rails - 如何在发布新的 Ruby 或 Rails 版本时收到通知? - 2

    有人知道在发布新版本的Ruby和Rails时收到电子邮件的方法吗?他们有邮件列表,RubyonRails有一个推特,但我不想听到那些随之而来的喧嚣,我只想知道什么时候发布新版本,尤其是那些有安全修复的版本。 最佳答案 从therailsblog获取提要.http://weblog.rubyonrails.org/feed/atom.xml 关于ruby-on-rails-如何在发布新的Ruby或Rails版本时收到通知?,我们在StackOverflow上找到一个类似的问题:

  6. ruby-on-rails - `const_missing' : uninitialized constant (NameError) - 2

    每次我尝试使用“script/runner-eproductionClassName.run”从我的Rails2.2应用程序的lib目录运行任何类时,我都会收到以下错误:/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/runner.rb:47:/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:89:in`const_missing':uninitializedconstantClassName(NameError)

  7. ruby-on-rails - 如何找出拦截 'method_missing' 的内容 - 2

    使用Ruby1.8.6/Rails2.3.2我注意到在我的任何ActiveRecord模型类上调用的任何方法都返回nil而不是NoMethodError。除了烦人之外,这还破坏了动态查找器(find_by_name、find_by_id等),因为即使存在记录,它们也总是返回nil。不从ActiveRecord::Base派生的标准类不受影响。有没有办法追踪在ActiveRecord::Base之前拦截method_missing的是什么?更新:切换到1.8.7后,我发现(感谢@MichaelKohl)will_paginate插件首先处理method_missing。但是will_pa

  8. ruby - 如何修复 RVM gem "[ missing bin/ruby ]" - 2

    执行rvmlist后,我得到以下输出:rvmrubiesgems[missingbin/ruby]=*ruby-2.0.0-p645[x86_64]ruby-2.1.6[x86_64]ruby-2.2.1[x86_64]gems[missingbin/ruby]是什么意思?gems是某种系统gemset吗?它不是我创建的,我不知道我是否可以或应该删除它。 最佳答案 在我跑完之后:rvmfix-permissions然后我能够卸载具有[缺少bin/ruby]的版本。 关于ruby-如何修复

  9. ruby - 如何使用 method_missing 动态声明方法? - 2

    我有一个ruby​​程序,我想接受用户创建的方法,并使用该名称创建一个新方法。我试过这个:defmethod_missing(meth,*args,&block)name=meth.to_sclass我收到以下错误:`define_method':interningemptystring(ArgumentError)in'method_missing'有什么想法吗?谢谢。编辑:我以不同的方式让它工作,但我仍然很好奇如何以这种方式做到这一点。这是我的代码:defmethod_missing(meth,*args,&block)Adder.class_evaldodefine_method

  10. ruby-on-rails - rails 生成 rspec :install config/environments/development. rb:1:in `<top (required)>': 未定义方法 `configure' - 2

    首先,这是我的版本:Greg-Nowickis-MacBook-Pro:sample_appGreg_Nowicki$ruby-vruby2.0.0p451(2014-02-24revision45167)[x86_64-darwin13.1.0]Greg-Nowickis-MacBook-Pro:sample_appGreg_Nowicki$rails-vRails4.0.4我正在学习HartlRails教程并安装rspec进行测试。我已将gem'rspec-rails'添加到我的gemfile中,当我运行railsgeneraterspec:install时,这就是我得到的:Gre

随机推荐