Sha256: d59b20aad772b395204dcd365cc02ec4d7bc7e02c8587186a9960efaca2fa3e8

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

#!/usr/bin/env ruby
# encoding: ASCII-8BIT
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

5 entries across 5 versions & 1 rubygems

Version Path
soap5r-2.0.3 sample/showcase/wsdl/PayPalSvc/client.rb
soap5r-2.0.2 sample/showcase/wsdl/PayPalSvc/client.rb
soap5r-2.0.1 sample/showcase/wsdl/PayPalSvc/client.rb
soap5r-2.0.0 sample/showcase/wsdl/PayPalSvc/client.rb
soap5r-2.0.0.20120130130121 sample/showcase/wsdl/PayPalSvc/client.rb