Sha256: 48ab6371b1632a38578c2f393ad0c854d16005234652ffc9212768363306db7d

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

#!/usr/bin/env ruby
require 'defaultDriver.rb'
require 'soap/header/simplehandler'

class RequesterCredentialsHandler < SOAP::Header::SimpleHandler
  HeaderName = XSD::QName.new('urn:ebay:api:PayPalAPI', 'RequesterCredentials')
  CredentialsName =
    XSD::QName.new('urn:ebay:apis:eBLBaseComponents', 'Credentials')
  UsernameName = XSD::QName.new(nil, 'Username')
  PasswordName = XSD::QName.new(nil, 'Password')
  SubjectName = XSD::QName.new(nil, 'Subject')

  def initialize(username, password, subject)
    super(HeaderName)
    @username, @password, @subject = username, password, subject
  end

  def on_simple_outbound
    {CredentialsName => {UsernameName => @username, PasswordName => @password,
      SubjectName => @subject}}
  end
end

endpoint_url = ARGV.shift
obj = PayPalAPIAAInterface.new(endpoint_url)
obj.headerhandler << RequesterCredentialsHandler.new('NaHi', 'pass', 'authorizing_account_emailaddress')
obj.wiredump_dev = STDOUT if $DEBUG

obj.test_loopback_response << File.read("response.xml")
payerInfo = obj.getExpressCheckoutDetails(nil).getExpressCheckoutDetailsResponseDetails.payerInfo
p payerInfo.payerName.firstName
p payerInfo.payerBusiness
exit

getTransactionDetailsRequest = nil
puts obj.getTransactionDetails(getTransactionDetailsRequest)

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
soap4r-spox-1.6.0 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-2.0.5 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-2.0.3 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-2.0.2 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-2.0.1 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-2.0.0 sample/showcase/wsdl/PayPalSvc/client.rb
soap4r-ruby1.9-1.0.0 sample/showcase/wsdl/PayPalSvc/client.rb