Permalink
Browse files

Merge pull request #53 from bundacia/master

adding support for AdaptiveAccounts/GetVerifiedStatus API call
  • Loading branch information...
2 parents c6d54c3 + 0de26b4 commit e99db30b1b4778cd83c0dce91e618b9fffa079f1 @tc committed Apr 27, 2012
@@ -69,6 +69,10 @@ def execute_payment(data)
wrap_post(data, "/AdaptivePayments/ExecutePayment")
end
+ def get_verified_status(data)
+ wrap_post(data, "/AdaptiveAccounts/GetVerifiedStatus")
+ end
+
def wrap_post(data, path)
raise NoDataError unless data
@@ -0,0 +1,7 @@
+{
+"requestEnvelope":{"errorLanguage":"en_US"},
+"emailAddress": "foo@example.com",
+"firstName": "foo",
+"lastName": "bar",
+"matchCriteria": "NONE"
+}
@@ -0,0 +1,24 @@
+require 'test_helper'
+
+class GetVerifiedStatusTest < Test::Unit::TestCase
+ def setup
+ @get_verified_status_request = PaypalAdaptive::Request.new("test")
+ end
+
+ def test_get_verified_status
+ puts "-------"
+ puts "get_verified_status"
+
+ data_filepath = File.join(File.dirname(__FILE__),"..", "data","verified_get_verified_status_request.json")
+
+ data = read_json_file(data_filepath)
+ pp_response = @get_verified_status_request.get_verified_status(data)
+
+ puts "account status: #{pp_response['accountStatus']}"
+ assert_equal true, pp_response.success?
+ end
+
+ def read_json_file(filepath)
+ File.open(filepath, "rb"){|f| JSON.parse(f.read)}
+ end
+end

0 comments on commit e99db30

Please sign in to comment.