Coder Social home page Coder Social logo

paypal_permissions's People

Contributors

paulca avatar tonkapark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

paypal_permissions's Issues

Error 520002 Internal Error on get_access_token method

This is my get access token:

def get_access_token
    dispute = Dispute.find(session[:id])
    request_token = session[:request_token]
    verifier = session[:request_token_verifier]
    paypal_response = ::PAYPAL_PERMISSIONS_GATEWAY.get_access_token request_token, verifier   
    p paypal_response.inspect
    if paypal_response[:ack] == 'Success'
      #dispute.order.payment.update_attributes({
        #:ppp_access_token => paypal_response[:token],
        #:ppp_access_token_verifier => paypal_response[:tokenSecret],
      #})
     puts "Right"
    else
      puts "Wrong"
    end
  end

I get in my log:

{:raw_response=>
\"responseEnvelope.timestamp=2012-09-23T06%3A47%3A54.432-07%3A00&responseEnvelope.a
ck=Failure&responseEnvelope.correlationId=afcab8b125dcc&responseEnvelope.build=2210301&error(0).errorId=520002&error(0).domain=PLATFORM&error(0).subdomain=Application&error
 (0).severity=Error&error(0).category=Application&error(0).message=Internal+Error\", :errors=>
[{:parameters=>[], :error_id=>\"520002\", :domain=>\"PLATFORM\", :subdomain=>\"Application\", 
:severity=>\"Error\", :category=>\"Application\", :message=>\"Internal Error\"}], :timestamp=>
\"2012-09-23T06:47:54.432-07:00\", :ack=>\"Failure\", :correlation_id=>\"afcab8b125dcc\"}"

I can see that on the seller paypal account has granted permissions correctly to my application.

why this error when I get back to my application, if the seller has granted permissions correctly

Edited

Ok the error was in my response_permissions_callback method.

I had:

def response_permissions_callback
  dispute = Dispute.find(session[:id])
  get_access_token
  session[:request_token_verifier] = params[:verification_code]
  redirect_to show_seller_user_dispute_url(current_user, dispute)
end

The correct way is:

def response_permissions_callback
  dispute = Dispute.find(session[:id])
  session[:request_token_verifier] = params[:verification_code]
  get_access_token
  redirect_to show_seller_user_dispute_url(current_user, dispute)
end

Thank you very much!

500 internal server error when I try get get_basic_personal_data on live mode

get_basic_personal_data is working fine on sandbox but on live mode when I try:

data = ::PAYPAL_PERMISSIONS_GATEWAY.get_basic_personal_data(access_token, verifier)

I get on my log this error:

Processing by UsersController#response_permissions_callback as HTML
Parameters: {"request_token"=>"AAAAAAGvyQk7DZKPze4L", "verification_code"=>"PGG4zCWrNtXaYksWWQqojw", "locale"=>"es", "id"=>"juan-dot-ardila-dot-serrano"}
Completed 500 Internal Server Error in 1219ms
ActiveMerchant::ResponseError (Failed with 302 Moved Temporarily):

Can someone explain why the sandbox is working properly and does not work in live mode?

thanks

move x_pp_authorization.rb to ActiveMerchant?

Hi there,

Good work on the PayPal Permissions gem.

I'm using the X-PP-AUTHORIZATION header in ActiveMerchant, i'm guessing a few other people are also.

Any chance of getting x_pp_authorization.rb from this project moved into ActiveMerchant? It's a useful + generic piece of code, I feel it should belong there instead given it's multi-library benefit.

Jason

Can't use get_basic_personal_data

First - thank you for this gem.
Sorry, that I'm writing here, but I'm messing a lot with this and need some help.
I want get_basic_personal_data for existing merchant, but I constantly get
undefined local variable or method `required_params' for #<#Class:0x5e48b78:0x5e4b668>
I tried to include modules, but failed.
Can you help me with this ?

API credentials are incorrect

When I try use the method get_basic_personal_data I get this error in log:

"{:raw_response=>
\"responseEnvelope.timestamp=2012-09-26T13%3A13%3A48.334-07%3A00&responseEnvelope.a
ck=Failure&responseEnvelope.correlationId=fff93a856c53d&responseEnvelope.build=2210301&err
or(0).errorId=520003&error(0).domain=PLATFORM&error(0).subdomain=Application&error
(0).severity=Error&error(0).category=Application&error(0).message=Authentication+failed.+API
+credentials+are+incorrect.\", :errors=>[{:parameters=>[], :error_id=>\"520003\", :domain=>
\"PLATFORM\", :subdomain=>\"Application\", :severity=>\"Error\", :category=>\"Application\", 
:message=>\"Authentication failed. API credentials are incorrect.\"}], :personal_data=>{}, 
:timestamp=>\"2012-09-26T13:13:48.334-07:00\", :ack=>\"Failure\", :correlation_id=>\"fff93a856c53d
\"}"

However the other methods is working fine and my Api credentials are correct on my env files.

These are my methods on my controller:

def request_permissions_callback
    callback_url = URI.encode(response_permissions_callback_user_url(current_user))
    permissions = 'REFUND, ACCESS_BASIC_PERSONAL_DATA'
    paypal_response = ::PAYPAL_PERMISSIONS_GATEWAY.request_permissions callback_url, 
    permissions
  if paypal_response[:ack] == 'Success'
   session[:id] = current_user.id
   request_token = paypal_response[:token]
   session[:request_token] = request_token
   url = ::PAYPAL_PERMISSIONS_GATEWAY.redirect_user_to_paypal_url(request_token)
   redirect_to url
else
   #render :text => paypal_response.inspect
   # handle error
   format.html { redirect_to requirements_to_sell_user_path(current_user), alert: t
 (".permissions_wrong") }
   end
 end

def response_permissions_callback
  session[:request_token_verifier] = params[:verification_code]
  get_access_token
  respond_to do |format|
    if get_access_token == true
      format.html { redirect_to requirements_to_sell_user_path(current_user), notice: t
(".refund_permissions_success") }
    elsif get_access_token == false
     format.html { redirect_to requirements_to_sell_user_path(current_user), alert: t
(".refund_permissions_wrong") }
   end 
  end
end

def get_access_token
    request_token = session[:request_token]
    verifier = session[:request_token_verifier]
    paypal_response = ::PAYPAL_PERMISSIONS_GATEWAY.get_access_token request_token, 
verifier
    if paypal_response[:ack] == 'Success'
      current_user.update_attributes({
        :ppp_access_token => paypal_response[:token],
        :ppp_access_token_verifier => paypal_response[:token_secret],
      })
      p get_basic_personal_data(current_user).inspect
      return true
    else
      return false
    end
end

def get_basic_personal_data(current_user)
    access_token = current_user.ppp_access_token
    verifier = current_user.ppp_access_token_verifier
    ::PAYPAL_PERMISSIONS_GATEWAY.get_basic_personal_data(access_token, verifier)
 end

Thank you very much!

does this actually work with PayPal?

Just found your code yesterday.
I didn't know how else to contact you except through an issue. I think you are doing the encoding of strings different than the SDK from PayPal and when I extract your code I seem to fail to get a valid authorization header to make my own call to GetBasicPersonalData with my own http call. I don't need your full gem since I am not using ActiveMerchant.

So my question, is this working to make authorized calls to get personal data? Would you have time to answer some questions?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.