smulube-activemerchant 1.5.1.4 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +9 -0
- data/CONTRIBUTORS +5 -1
- data/gem-public_cert.pem +18 -18
- data/lib/active_merchant.rb +9 -9
- data/lib/active_merchant/billing/gateways/braintree.rb +11 -11
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +210 -0
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +17 -0
- data/lib/active_merchant/billing/gateways/payflow_nvp_uk.rb +10 -5
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +1 -1
- data/lib/active_merchant/common.rb +14 -0
- data/lib/active_merchant/{lib → common}/connection.rb +2 -5
- data/lib/active_merchant/{lib → common}/country.rb +1 -1
- data/lib/active_merchant/common/error.rb +26 -0
- data/lib/active_merchant/common/post_data.rb +24 -0
- data/lib/active_merchant/{lib → common}/posts_data.rb +0 -0
- data/lib/active_merchant/{lib → common}/requires_parameters.rb +0 -0
- data/lib/active_merchant/{lib → common}/utils.rb +0 -0
- data/lib/active_merchant/{lib → common}/validateable.rb +0 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant/version.rb.orig +7 -0
- data/lib/activemerchant.rb +1 -0
- data/lib/support/outbound_hosts.rb +25 -0
- metadata +175 -493
- metadata.gz.sig +0 -0
- data/.gitignore +0 -7
- data/Rakefile +0 -85
- data/generators/gateway/USAGE +0 -5
- data/generators/gateway/gateway_generator.rb +0 -61
- data/generators/gateway/templates/gateway.rb +0 -77
- data/generators/gateway/templates/gateway_test.rb +0 -49
- data/generators/gateway/templates/remote_gateway_test.rb +0 -57
- data/generators/integration/USAGE +0 -5
- data/generators/integration/integration_generator.rb +0 -68
- data/generators/integration/templates/helper.rb +0 -34
- data/generators/integration/templates/helper_test.rb +0 -54
- data/generators/integration/templates/integration.rb +0 -18
- data/generators/integration/templates/module_test.rb +0 -9
- data/generators/integration/templates/notification.rb +0 -100
- data/generators/integration/templates/notification_test.rb +0 -41
- data/init.rb +0 -3
- data/lib/active_merchant/lib/error.rb +0 -4
- data/lib/active_merchant/lib/post_data.rb +0 -22
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/test/fixtures.yml +0 -360
- data/test/remote/gateways/remote_authorize_net_cim_test.rb +0 -460
- data/test/remote/gateways/remote_authorize_net_test.rb +0 -145
- data/test/remote/gateways/remote_beanstream_interac_test.rb +0 -53
- data/test/remote/gateways/remote_beanstream_test.rb +0 -150
- data/test/remote/gateways/remote_braintree_test.rb +0 -147
- data/test/remote/gateways/remote_card_stream_test.rb +0 -148
- data/test/remote/gateways/remote_cyber_source_test.rb +0 -146
- data/test/remote/gateways/remote_data_cash_test.rb +0 -356
- data/test/remote/gateways/remote_efsnet_test.rb +0 -81
- data/test/remote/gateways/remote_elavon_test.rb +0 -66
- data/test/remote/gateways/remote_eway_test.rb +0 -74
- data/test/remote/gateways/remote_exact_test.rb +0 -60
- data/test/remote/gateways/remote_first_pay_test.rb +0 -87
- data/test/remote/gateways/remote_garanti_test.rb +0 -58
- data/test/remote/gateways/remote_instapay_test.rb +0 -61
- data/test/remote/gateways/remote_jetpay_test.rb +0 -103
- data/test/remote/gateways/remote_linkpoint_test.rb +0 -121
- data/test/remote/gateways/remote_merchant_e_solutions_test.rb +0 -173
- data/test/remote/gateways/remote_merchant_ware_test.rb +0 -113
- data/test/remote/gateways/remote_modern_payments_cim_test.rb +0 -58
- data/test/remote/gateways/remote_modern_payments_test.rb +0 -57
- data/test/remote/gateways/remote_moneris_test.rb +0 -82
- data/test/remote/gateways/remote_net_registry_test.rb +0 -85
- data/test/remote/gateways/remote_netbilling_test.rb +0 -70
- data/test/remote/gateways/remote_ogone_test.rb +0 -115
- data/test/remote/gateways/remote_pay_junction_test.rb +0 -143
- data/test/remote/gateways/remote_pay_secure_test.rb +0 -39
- data/test/remote/gateways/remote_payflow_express_test.rb +0 -50
- data/test/remote/gateways/remote_payflow_nvp_uk_test.rb +0 -57
- data/test/remote/gateways/remote_payflow_test.rb +0 -237
- data/test/remote/gateways/remote_payflow_uk_test.rb +0 -173
- data/test/remote/gateways/remote_payment_express_test.rb +0 -136
- data/test/remote/gateways/remote_paypal_express_test.rb +0 -49
- data/test/remote/gateways/remote_paypal_test.rb +0 -191
- data/test/remote/gateways/remote_plugnpay_test.rb +0 -72
- data/test/remote/gateways/remote_psigate_test.rb +0 -50
- data/test/remote/gateways/remote_psl_card_test.rb +0 -123
- data/test/remote/gateways/remote_quickpay_test.rb +0 -190
- data/test/remote/gateways/remote_realex_test.rb +0 -224
- data/test/remote/gateways/remote_sage_bankcard_test.rb +0 -109
- data/test/remote/gateways/remote_sage_pay_test.rb +0 -219
- data/test/remote/gateways/remote_sage_test.rb +0 -87
- data/test/remote/gateways/remote_sage_virtual_check_test.rb +0 -62
- data/test/remote/gateways/remote_sallie_mae_test.rb +0 -51
- data/test/remote/gateways/remote_secure_pay_au_test.rb +0 -40
- data/test/remote/gateways/remote_secure_pay_tech_test.rb +0 -37
- data/test/remote/gateways/remote_secure_pay_test.rb +0 -28
- data/test/remote/gateways/remote_skipjack_test.rb +0 -105
- data/test/remote/gateways/remote_trans_first_test.rb +0 -34
- data/test/remote/gateways/remote_transax_test.rb +0 -112
- data/test/remote/gateways/remote_trust_commerce_test.rb +0 -152
- data/test/remote/gateways/remote_usa_epay_test.rb +0 -46
- data/test/remote/gateways/remote_verifi_test.rb +0 -107
- data/test/remote/gateways/remote_viaklix_test.rb +0 -43
- data/test/remote/gateways/remote_wirecard_test.rb +0 -111
- data/test/remote/integrations/remote_gestpay_integration_test.rb +0 -37
- data/test/remote/integrations/remote_paypal_integration_test.rb +0 -26
- data/test/test_helper.rb +0 -184
- data/test/unit/avs_result_test.rb +0 -59
- data/test/unit/base_test.rb +0 -54
- data/test/unit/check_test.rb +0 -88
- data/test/unit/connection_test.rb +0 -137
- data/test/unit/country_code_test.rb +0 -33
- data/test/unit/country_test.rb +0 -64
- data/test/unit/credit_card_formatting_test.rb +0 -19
- data/test/unit/credit_card_methods_test.rb +0 -192
- data/test/unit/credit_card_test.rb +0 -318
- data/test/unit/cvv_result_test.rb +0 -33
- data/test/unit/expiry_date_test.rb +0 -32
- data/test/unit/gateways/authorize_net_cim_test.rb +0 -676
- data/test/unit/gateways/authorize_net_test.rb +0 -290
- data/test/unit/gateways/beanstream_interac_test.rb +0 -51
- data/test/unit/gateways/beanstream_test.rb +0 -144
- data/test/unit/gateways/bogus_test.rb +0 -58
- data/test/unit/gateways/braintree_test.rb +0 -118
- data/test/unit/gateways/card_stream_test.rb +0 -90
- data/test/unit/gateways/cyber_source_test.rb +0 -188
- data/test/unit/gateways/data_cash_test.rb +0 -133
- data/test/unit/gateways/efsnet_test.rb +0 -123
- data/test/unit/gateways/elavon_test.rb +0 -139
- data/test/unit/gateways/eway_test.rb +0 -118
- data/test/unit/gateways/exact_test.rb +0 -156
- data/test/unit/gateways/first_pay_test.rb +0 -125
- data/test/unit/gateways/garanti_test.rb +0 -86
- data/test/unit/gateways/gateway_test.rb +0 -48
- data/test/unit/gateways/instapay_test.rb +0 -102
- data/test/unit/gateways/jetpay_test.rb +0 -185
- data/test/unit/gateways/linkpoint_test.rb +0 -197
- data/test/unit/gateways/merchant_e_solutions_test.rb +0 -169
- data/test/unit/gateways/merchant_ware_test.rb +0 -188
- data/test/unit/gateways/modern_payments_cim_test.rb +0 -162
- data/test/unit/gateways/moneris_test.rb +0 -158
- data/test/unit/gateways/net_registry_test.rb +0 -416
- data/test/unit/gateways/netbilling_test.rb +0 -54
- data/test/unit/gateways/ogone_test.rb +0 -319
- data/test/unit/gateways/pay_junction_test.rb +0 -123
- data/test/unit/gateways/pay_secure_test.rb +0 -71
- data/test/unit/gateways/payflow_express_test.rb +0 -173
- data/test/unit/gateways/payflow_express_uk_test.rb +0 -86
- data/test/unit/gateways/payflow_nvp_uk_test.rb +0 -205
- data/test/unit/gateways/payflow_test.rb +0 -305
- data/test/unit/gateways/payflow_uk_test.rb +0 -30
- data/test/unit/gateways/payment_express_test.rb +0 -195
- data/test/unit/gateways/paypal_express_test.rb +0 -389
- data/test/unit/gateways/paypal_test.rb +0 -569
- data/test/unit/gateways/plugnpay_test.rb +0 -86
- data/test/unit/gateways/psigate_test.rb +0 -169
- data/test/unit/gateways/psl_card_test.rb +0 -64
- data/test/unit/gateways/quickpay_test.rb +0 -112
- data/test/unit/gateways/realex_test.rb +0 -151
- data/test/unit/gateways/sage_bankcard_test.rb +0 -196
- data/test/unit/gateways/sage_pay_test.rb +0 -139
- data/test/unit/gateways/sage_virtual_check_test.rb +0 -71
- data/test/unit/gateways/sallie_mae_test.rb +0 -53
- data/test/unit/gateways/secure_pay_au_test.rb +0 -207
- data/test/unit/gateways/secure_pay_tech_test.rb +0 -44
- data/test/unit/gateways/secure_pay_test.rb +0 -101
- data/test/unit/gateways/skip_jack_test.rb +0 -228
- data/test/unit/gateways/trans_first_test.rb +0 -112
- data/test/unit/gateways/trust_commerce_test.rb +0 -90
- data/test/unit/gateways/usa_epay_test.rb +0 -128
- data/test/unit/gateways/verifi_test.rb +0 -96
- data/test/unit/gateways/viaklix_test.rb +0 -78
- data/test/unit/gateways/wirecard_test.rb +0 -250
- data/test/unit/generators/test_gateway_generator.rb +0 -46
- data/test/unit/generators/test_generator_helper.rb +0 -20
- data/test/unit/generators/test_integration_generator.rb +0 -53
- data/test/unit/integrations/action_view_helper_test.rb +0 -50
- data/test/unit/integrations/bogus_module_test.rb +0 -20
- data/test/unit/integrations/chronopay_module_test.rb +0 -13
- data/test/unit/integrations/gestpay_module_test.rb +0 -14
- data/test/unit/integrations/helpers/bogus_helper_test.rb +0 -28
- data/test/unit/integrations/helpers/chronopay_helper_test.rb +0 -110
- data/test/unit/integrations/helpers/gestpay_helper_test.rb +0 -100
- data/test/unit/integrations/helpers/hi_trust_helper_test.rb +0 -16
- data/test/unit/integrations/helpers/nochex_helper_test.rb +0 -53
- data/test/unit/integrations/helpers/paypal_helper_test.rb +0 -171
- data/test/unit/integrations/helpers/quickpay_helper_test.rb +0 -40
- data/test/unit/integrations/helpers/two_checkout_helper_test.rb +0 -92
- data/test/unit/integrations/hi_trust_module_test.rb +0 -13
- data/test/unit/integrations/nochex_module_test.rb +0 -13
- data/test/unit/integrations/notifications/chronopay_notification_test.rb +0 -66
- data/test/unit/integrations/notifications/gestpay_notification_test.rb +0 -60
- data/test/unit/integrations/notifications/hi_trust_notification_test.rb +0 -59
- data/test/unit/integrations/notifications/nochex_notification_test.rb +0 -51
- data/test/unit/integrations/notifications/notification_test.rb +0 -54
- data/test/unit/integrations/notifications/paypal_notification_test.rb +0 -85
- data/test/unit/integrations/notifications/quickpay_notification_test.rb +0 -69
- data/test/unit/integrations/notifications/two_checkout_notification_test.rb +0 -55
- data/test/unit/integrations/paypal_module_test.rb +0 -28
- data/test/unit/integrations/quickpay_module_test.rb +0 -9
- data/test/unit/integrations/returns/chronopay_return_test.rb +0 -11
- data/test/unit/integrations/returns/gestpay_return_test.rb +0 -10
- data/test/unit/integrations/returns/hi_trust_return_test.rb +0 -24
- data/test/unit/integrations/returns/nochex_return_test.rb +0 -10
- data/test/unit/integrations/returns/paypal_return_test.rb +0 -10
- data/test/unit/integrations/returns/return_test.rb +0 -11
- data/test/unit/integrations/returns/two_checkout_return_test.rb +0 -24
- data/test/unit/integrations/two_checkout_module_test.rb +0 -13
- data/test/unit/post_data_test.rb +0 -55
- data/test/unit/posts_data_test.rb +0 -48
- data/test/unit/response_test.rb +0 -28
- data/test/unit/utils_test.rb +0 -7
- data/test/unit/validateable_test.rb +0 -60
@@ -1,389 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PaypalExpressTest < Test::Unit::TestCase
|
4
|
-
TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=1234567890'
|
5
|
-
LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_express-checkout&token=1234567890'
|
6
|
-
|
7
|
-
TEST_REDIRECT_URL_WITHOUT_REVIEW = "#{TEST_REDIRECT_URL}&useraction=commit"
|
8
|
-
LIVE_REDIRECT_URL_WITHOUT_REVIEW = "#{LIVE_REDIRECT_URL}&useraction=commit"
|
9
|
-
|
10
|
-
def setup
|
11
|
-
@gateway = PaypalExpressGateway.new(
|
12
|
-
:login => 'cody',
|
13
|
-
:password => 'test',
|
14
|
-
:pem => 'PEM'
|
15
|
-
)
|
16
|
-
|
17
|
-
@address = { :address1 => '1234 My Street',
|
18
|
-
:address2 => 'Apt 1',
|
19
|
-
:company => 'Widgets Inc',
|
20
|
-
:city => 'Ottawa',
|
21
|
-
:state => 'ON',
|
22
|
-
:zip => 'K1C2N6',
|
23
|
-
:country => 'Canada',
|
24
|
-
:phone => '(555)555-5555'
|
25
|
-
}
|
26
|
-
|
27
|
-
Base.gateway_mode = :test
|
28
|
-
end
|
29
|
-
|
30
|
-
def teardown
|
31
|
-
Base.gateway_mode = :test
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_live_redirect_url
|
35
|
-
Base.gateway_mode = :production
|
36
|
-
assert_equal LIVE_REDIRECT_URL, @gateway.redirect_url_for('1234567890')
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_live_redirect_url_without_review
|
40
|
-
Base.gateway_mode = :production
|
41
|
-
assert_equal LIVE_REDIRECT_URL_WITHOUT_REVIEW, @gateway.redirect_url_for('1234567890', :review => false)
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_force_sandbox_redirect_url
|
45
|
-
Base.gateway_mode = :production
|
46
|
-
|
47
|
-
gateway = PaypalExpressGateway.new(
|
48
|
-
:login => 'cody',
|
49
|
-
:password => 'test',
|
50
|
-
:pem => 'PEM',
|
51
|
-
:test => true
|
52
|
-
)
|
53
|
-
|
54
|
-
assert gateway.test?
|
55
|
-
assert_equal TEST_REDIRECT_URL, gateway.redirect_url_for('1234567890')
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_test_redirect_url
|
59
|
-
assert_equal :test, Base.gateway_mode
|
60
|
-
assert_equal TEST_REDIRECT_URL, @gateway.redirect_url_for('1234567890')
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_test_redirect_url_without_review
|
64
|
-
assert_equal :test, Base.gateway_mode
|
65
|
-
assert_equal TEST_REDIRECT_URL_WITHOUT_REVIEW, @gateway.redirect_url_for('1234567890', :review => false)
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_get_express_details
|
69
|
-
@gateway.expects(:ssl_post).returns(successful_details_response)
|
70
|
-
response = @gateway.details_for('EC-2OPN7UJGFWK9OYFV')
|
71
|
-
|
72
|
-
assert_instance_of PaypalExpressResponse, response
|
73
|
-
assert response.success?
|
74
|
-
assert response.test?
|
75
|
-
|
76
|
-
assert_equal 'EC-6WS104951Y388951L', response.token
|
77
|
-
assert_equal 'FWRVKNRRZ3WUC', response.payer_id
|
78
|
-
assert_equal 'buyer@jadedpallet.com', response.email
|
79
|
-
|
80
|
-
assert address = response.address
|
81
|
-
assert_equal 'Fred Brooks', address['name']
|
82
|
-
assert_nil address['company']
|
83
|
-
assert_equal '1234 Penny Lane', address['address1']
|
84
|
-
assert_nil address['address2']
|
85
|
-
assert_equal 'Jonsetown', address['city']
|
86
|
-
assert_equal 'NC', address['state']
|
87
|
-
assert_equal '23456', address['zip']
|
88
|
-
assert_equal 'US', address['country']
|
89
|
-
assert_nil address['phone']
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_authorization
|
93
|
-
@gateway.expects(:ssl_post).returns(successful_authorization_response)
|
94
|
-
response = @gateway.authorize(300, :token => 'EC-6WS104951Y388951L', :payer_id => 'FWRVKNRRZ3WUC')
|
95
|
-
assert response.success?
|
96
|
-
assert_not_nil response.authorization
|
97
|
-
assert response.test?
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_default_payflow_currency
|
101
|
-
assert_equal 'USD', PayflowExpressGateway.default_currency
|
102
|
-
end
|
103
|
-
|
104
|
-
def test_default_partner
|
105
|
-
assert_equal 'PayPal', PayflowExpressGateway.partner
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_uk_partner
|
109
|
-
assert_equal 'PayPalUk', PayflowExpressUkGateway.partner
|
110
|
-
end
|
111
|
-
|
112
|
-
def test_handle_non_zero_amount
|
113
|
-
xml = REXML::Document.new(@gateway.send(:build_setup_request, 'SetExpressCheckout', 50, {}))
|
114
|
-
|
115
|
-
assert_equal '0.50', REXML::XPath.first(xml, '//n2:OrderTotal').text
|
116
|
-
end
|
117
|
-
|
118
|
-
def test_handles_zero_amount
|
119
|
-
xml = REXML::Document.new(@gateway.send(:build_setup_request, 'SetExpressCheckout', 0, {}))
|
120
|
-
|
121
|
-
assert_equal '1.00', REXML::XPath.first(xml, '//n2:OrderTotal').text
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_handle_locale_code
|
125
|
-
xml = REXML::Document.new(@gateway.send(:build_setup_request, 'SetExpressCheckout', 0, { :locale => 'GB' }))
|
126
|
-
|
127
|
-
assert_equal 'GB', REXML::XPath.first(xml, '//n2:LocaleCode').text
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_supported_countries
|
131
|
-
assert_equal ['US'], PaypalExpressGateway.supported_countries
|
132
|
-
end
|
133
|
-
|
134
|
-
def test_button_source
|
135
|
-
PaypalExpressGateway.application_id = 'ActiveMerchant_EC'
|
136
|
-
|
137
|
-
xml = REXML::Document.new(@gateway.send(:build_sale_or_authorization_request, 'Test', 100, {}))
|
138
|
-
assert_equal 'ActiveMerchant_EC', REXML::XPath.first(xml, '//n2:ButtonSource').text
|
139
|
-
end
|
140
|
-
|
141
|
-
def test_error_code_for_single_error
|
142
|
-
@gateway.expects(:ssl_post).returns(response_with_error)
|
143
|
-
response = @gateway.setup_authorization(100,
|
144
|
-
:return_url => 'http://example.com',
|
145
|
-
:cancel_return_url => 'http://example.com'
|
146
|
-
)
|
147
|
-
assert_equal "10736", response.params['error_codes']
|
148
|
-
end
|
149
|
-
|
150
|
-
def test_ensure_only_unique_error_codes
|
151
|
-
@gateway.expects(:ssl_post).returns(response_with_duplicate_errors)
|
152
|
-
response = @gateway.setup_authorization(100,
|
153
|
-
:return_url => 'http://example.com',
|
154
|
-
:cancel_return_url => 'http://example.com'
|
155
|
-
)
|
156
|
-
|
157
|
-
assert_equal "10736" , response.params['error_codes']
|
158
|
-
end
|
159
|
-
|
160
|
-
def test_error_codes_for_multiple_errors
|
161
|
-
@gateway.expects(:ssl_post).returns(response_with_errors)
|
162
|
-
response = @gateway.setup_authorization(100,
|
163
|
-
:return_url => 'http://example.com',
|
164
|
-
:cancel_return_url => 'http://example.com'
|
165
|
-
)
|
166
|
-
|
167
|
-
assert_equal ["10736", "10002"] , response.params['error_codes'].split(',')
|
168
|
-
end
|
169
|
-
|
170
|
-
def test_allow_guest_checkout
|
171
|
-
xml = REXML::Document.new(@gateway.send(:build_setup_request, 'SetExpressCheckout', 10, {:allow_guest_checkout => true}))
|
172
|
-
|
173
|
-
assert_equal 'Sole', REXML::XPath.first(xml, '//n2:SolutionType').text
|
174
|
-
assert_equal 'Billing', REXML::XPath.first(xml, '//n2:LandingPage').text
|
175
|
-
end
|
176
|
-
|
177
|
-
private
|
178
|
-
def successful_details_response
|
179
|
-
<<-RESPONSE
|
180
|
-
<?xml version='1.0' encoding='UTF-8'?>
|
181
|
-
<SOAP-ENV:Envelope xmlns:cc='urn:ebay:apis:CoreComponentTypes' xmlns:sizeship='urn:ebay:api:PayPalAPI/sizeship.xsd' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:saml='urn:oasis:names:tc:SAML:1.0:assertion' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wsu='http://schemas.xmlsoap.org/ws/2002/07/utility' xmlns:ebl='urn:ebay:apis:eBLBaseComponents' xmlns:ds='http://www.w3.org/2000/09/xmldsig#' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:ns='urn:ebay:api:PayPalAPI' xmlns:market='urn:ebay:apis:Market' xmlns:ship='urn:ebay:apis:ship' xmlns:auction='urn:ebay:apis:Auction' xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
|
182
|
-
<SOAP-ENV:Header>
|
183
|
-
<Security xsi:type='wsse:SecurityType' xmlns='http://schemas.xmlsoap.org/ws/2002/12/secext'/>
|
184
|
-
<RequesterCredentials xsi:type='ebl:CustomSecurityHeaderType' xmlns='urn:ebay:api:PayPalAPI'>
|
185
|
-
<Credentials xsi:type='ebl:UserIdPasswordType' xmlns='urn:ebay:apis:eBLBaseComponents'>
|
186
|
-
<Username xsi:type='xs:string'/>
|
187
|
-
<Password xsi:type='xs:string'/>
|
188
|
-
<Subject xsi:type='xs:string'/>
|
189
|
-
</Credentials>
|
190
|
-
</RequesterCredentials>
|
191
|
-
</SOAP-ENV:Header>
|
192
|
-
<SOAP-ENV:Body id='_0'>
|
193
|
-
<GetExpressCheckoutDetailsResponse xmlns='urn:ebay:api:PayPalAPI'>
|
194
|
-
<Timestamp xmlns='urn:ebay:apis:eBLBaseComponents'>2007-02-12T23:59:43Z</Timestamp>
|
195
|
-
<Ack xmlns='urn:ebay:apis:eBLBaseComponents'>Success</Ack>
|
196
|
-
<CorrelationID xmlns='urn:ebay:apis:eBLBaseComponents'>c73044f11da65</CorrelationID>
|
197
|
-
<Version xmlns='urn:ebay:apis:eBLBaseComponents'>2.000000</Version>
|
198
|
-
<Build xmlns='urn:ebay:apis:eBLBaseComponents'>1.0006</Build>
|
199
|
-
<GetExpressCheckoutDetailsResponseDetails xsi:type='ebl:GetExpressCheckoutDetailsResponseDetailsType' xmlns='urn:ebay:apis:eBLBaseComponents'>
|
200
|
-
<Token xsi:type='ebl:ExpressCheckoutTokenType'>EC-6WS104951Y388951L</Token>
|
201
|
-
<PayerInfo xsi:type='ebl:PayerInfoType'>
|
202
|
-
<Payer xsi:type='ebl:EmailAddressType'>buyer@jadedpallet.com</Payer>
|
203
|
-
<PayerID xsi:type='ebl:UserIDType'>FWRVKNRRZ3WUC</PayerID>
|
204
|
-
<PayerStatus xsi:type='ebl:PayPalUserStatusCodeType'>verified</PayerStatus>
|
205
|
-
<PayerName xsi:type='ebl:PersonNameType'>
|
206
|
-
<Salutation xmlns='urn:ebay:apis:eBLBaseComponents'/>
|
207
|
-
<FirstName xmlns='urn:ebay:apis:eBLBaseComponents'>Fred</FirstName>
|
208
|
-
<MiddleName xmlns='urn:ebay:apis:eBLBaseComponents'/>
|
209
|
-
<LastName xmlns='urn:ebay:apis:eBLBaseComponents'>Brooks</LastName>
|
210
|
-
<Suffix xmlns='urn:ebay:apis:eBLBaseComponents'/>
|
211
|
-
</PayerName>
|
212
|
-
<PayerCountry xsi:type='ebl:CountryCodeType'>US</PayerCountry>
|
213
|
-
<PayerBusiness xsi:type='xs:string'/>
|
214
|
-
<Address xsi:type='ebl:AddressType'>
|
215
|
-
<Name xsi:type='xs:string'>Fred Brooks</Name>
|
216
|
-
<Street1 xsi:type='xs:string'>1234 Penny Lane</Street1>
|
217
|
-
<Street2 xsi:type='xs:string'/>
|
218
|
-
<CityName xsi:type='xs:string'>Jonsetown</CityName>
|
219
|
-
<StateOrProvince xsi:type='xs:string'>NC</StateOrProvince>
|
220
|
-
<Country xsi:type='ebl:CountryCodeType'>US</Country>
|
221
|
-
<CountryName>United States</CountryName>
|
222
|
-
<PostalCode xsi:type='xs:string'>23456</PostalCode>
|
223
|
-
<AddressOwner xsi:type='ebl:AddressOwnerCodeType'>PayPal</AddressOwner>
|
224
|
-
<AddressStatus xsi:type='ebl:AddressStatusCodeType'>Confirmed</AddressStatus>
|
225
|
-
</Address>
|
226
|
-
</PayerInfo>
|
227
|
-
<InvoiceID xsi:type='xs:string'>1230123</InvoiceID>
|
228
|
-
</GetExpressCheckoutDetailsResponseDetails>
|
229
|
-
</GetExpressCheckoutDetailsResponse>
|
230
|
-
</SOAP-ENV:Body>
|
231
|
-
</SOAP-ENV:Envelope>
|
232
|
-
RESPONSE
|
233
|
-
end
|
234
|
-
|
235
|
-
def successful_authorization_response
|
236
|
-
<<-RESPONSE
|
237
|
-
<?xml version='1.0' encoding='UTF-8'?>
|
238
|
-
<SOAP-ENV:Envelope xmlns:cc='urn:ebay:apis:CoreComponentTypes' xmlns:sizeship='urn:ebay:api:PayPalAPI/sizeship.xsd' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:saml='urn:oasis:names:tc:SAML:1.0:assertion' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wsu='http://schemas.xmlsoap.org/ws/2002/07/utility' xmlns:ebl='urn:ebay:apis:eBLBaseComponents' xmlns:ds='http://www.w3.org/2000/09/xmldsig#' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:ns='urn:ebay:api:PayPalAPI' xmlns:market='urn:ebay:apis:Market' xmlns:ship='urn:ebay:apis:ship' xmlns:auction='urn:ebay:apis:Auction' xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
|
239
|
-
<SOAP-ENV:Header>
|
240
|
-
<Security xsi:type='wsse:SecurityType' xmlns='http://schemas.xmlsoap.org/ws/2002/12/secext'/>
|
241
|
-
<RequesterCredentials xsi:type='ebl:CustomSecurityHeaderType' xmlns='urn:ebay:api:PayPalAPI'>
|
242
|
-
<Credentials xsi:type='ebl:UserIdPasswordType' xmlns='urn:ebay:apis:eBLBaseComponents'>
|
243
|
-
<Username xsi:type='xs:string'/>
|
244
|
-
<Password xsi:type='xs:string'/>
|
245
|
-
<Subject xsi:type='xs:string'/>
|
246
|
-
</Credentials>
|
247
|
-
</RequesterCredentials>
|
248
|
-
</SOAP-ENV:Header>
|
249
|
-
<SOAP-ENV:Body id='_0'>
|
250
|
-
<DoExpressCheckoutPaymentResponse xmlns='urn:ebay:api:PayPalAPI'>
|
251
|
-
<Timestamp xmlns='urn:ebay:apis:eBLBaseComponents'>2007-02-13T00:18:50Z</Timestamp>
|
252
|
-
<Ack xmlns='urn:ebay:apis:eBLBaseComponents'>Success</Ack>
|
253
|
-
<CorrelationID xmlns='urn:ebay:apis:eBLBaseComponents'>62450a4266d04</CorrelationID>
|
254
|
-
<Version xmlns='urn:ebay:apis:eBLBaseComponents'>2.000000</Version>
|
255
|
-
<Build xmlns='urn:ebay:apis:eBLBaseComponents'>1.0006</Build>
|
256
|
-
<DoExpressCheckoutPaymentResponseDetails xsi:type='ebl:DoExpressCheckoutPaymentResponseDetailsType' xmlns='urn:ebay:apis:eBLBaseComponents'>
|
257
|
-
<Token xsi:type='ebl:ExpressCheckoutTokenType'>EC-6WS104951Y388951L</Token>
|
258
|
-
<PaymentInfo xsi:type='ebl:PaymentInfoType'>
|
259
|
-
<TransactionID>8B266858CH956410C</TransactionID>
|
260
|
-
<ParentTransactionID xsi:type='ebl:TransactionId'/>
|
261
|
-
<ReceiptID/>
|
262
|
-
<TransactionType xsi:type='ebl:PaymentTransactionCodeType'>express-checkout</TransactionType>
|
263
|
-
<PaymentType xsi:type='ebl:PaymentCodeType'>instant</PaymentType>
|
264
|
-
<PaymentDate xsi:type='xs:dateTime'>2007-02-13T00:18:48Z</PaymentDate>
|
265
|
-
<GrossAmount currencyID='USD' xsi:type='cc:BasicAmountType'>3.00</GrossAmount>
|
266
|
-
<TaxAmount currencyID='USD' xsi:type='cc:BasicAmountType'>0.00</TaxAmount>
|
267
|
-
<ExchangeRate xsi:type='xs:string'/>
|
268
|
-
<PaymentStatus xsi:type='ebl:PaymentStatusCodeType'>Pending</PaymentStatus>
|
269
|
-
<PendingReason xsi:type='ebl:PendingStatusCodeType'>authorization</PendingReason>
|
270
|
-
<ReasonCode xsi:type='ebl:ReversalReasonCodeType'>none</ReasonCode>
|
271
|
-
</PaymentInfo>
|
272
|
-
</DoExpressCheckoutPaymentResponseDetails>
|
273
|
-
</DoExpressCheckoutPaymentResponse>
|
274
|
-
</SOAP-ENV:Body>
|
275
|
-
</SOAP-ENV:Envelope>
|
276
|
-
RESPONSE
|
277
|
-
end
|
278
|
-
|
279
|
-
def response_with_error
|
280
|
-
<<-RESPONSE
|
281
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
282
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
283
|
-
<SOAP-ENV:Header>
|
284
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
285
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
286
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
287
|
-
<Username xsi:type="xs:string"/>
|
288
|
-
<Password xsi:type="xs:string"/>
|
289
|
-
<Subject xsi:type="xs:string"/>
|
290
|
-
</Credentials>
|
291
|
-
</RequesterCredentials>
|
292
|
-
</SOAP-ENV:Header>
|
293
|
-
<SOAP-ENV:Body id="_0">
|
294
|
-
<SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI">
|
295
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-04-02T17:38:02Z</Timestamp>
|
296
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
297
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">cdb720feada30</CorrelationID>
|
298
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
299
|
-
<ShortMessage xsi:type="xs:string">Shipping Address Invalid City State Postal Code</ShortMessage>
|
300
|
-
<LongMessage xsi:type="xs:string">A match of the Shipping Address City, State, and Postal Code failed.</LongMessage>
|
301
|
-
<ErrorCode xsi:type="xs:token">10736</ErrorCode>
|
302
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
303
|
-
</Errors>
|
304
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
305
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">543066</Build>
|
306
|
-
</SetExpressCheckoutResponse>
|
307
|
-
</SOAP-ENV:Body>
|
308
|
-
</SOAP-ENV:Envelope>
|
309
|
-
RESPONSE
|
310
|
-
end
|
311
|
-
|
312
|
-
def response_with_errors
|
313
|
-
<<-RESPONSE
|
314
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
315
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
316
|
-
<SOAP-ENV:Header>
|
317
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
318
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
319
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
320
|
-
<Username xsi:type="xs:string"/>
|
321
|
-
<Password xsi:type="xs:string"/>
|
322
|
-
<Subject xsi:type="xs:string"/>
|
323
|
-
</Credentials>
|
324
|
-
</RequesterCredentials>
|
325
|
-
</SOAP-ENV:Header>
|
326
|
-
<SOAP-ENV:Body id="_0">
|
327
|
-
<SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI">
|
328
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-04-02T17:38:02Z</Timestamp>
|
329
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
330
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">cdb720feada30</CorrelationID>
|
331
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
332
|
-
<ShortMessage xsi:type="xs:string">Shipping Address Invalid City State Postal Code</ShortMessage>
|
333
|
-
<LongMessage xsi:type="xs:string">A match of the Shipping Address City, State, and Postal Code failed.</LongMessage>
|
334
|
-
<ErrorCode xsi:type="xs:token">10736</ErrorCode>
|
335
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
336
|
-
</Errors>
|
337
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
338
|
-
<ShortMessage xsi:type="xs:string">Authentication/Authorization Failed</ShortMessage>
|
339
|
-
<LongMessage xsi:type="xs:string">You do not have permissions to make this API call</LongMessage>
|
340
|
-
<ErrorCode xsi:type="xs:token">10002</ErrorCode>
|
341
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
342
|
-
</Errors>
|
343
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
344
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">543066</Build>
|
345
|
-
</SetExpressCheckoutResponse>
|
346
|
-
</SOAP-ENV:Body>
|
347
|
-
</SOAP-ENV:Envelope>
|
348
|
-
RESPONSE
|
349
|
-
end
|
350
|
-
|
351
|
-
def response_with_duplicate_errors
|
352
|
-
<<-RESPONSE
|
353
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
354
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
355
|
-
<SOAP-ENV:Header>
|
356
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
357
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
358
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
359
|
-
<Username xsi:type="xs:string"/>
|
360
|
-
<Password xsi:type="xs:string"/>
|
361
|
-
<Subject xsi:type="xs:string"/>
|
362
|
-
</Credentials>
|
363
|
-
</RequesterCredentials>
|
364
|
-
</SOAP-ENV:Header>
|
365
|
-
<SOAP-ENV:Body id="_0">
|
366
|
-
<SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI">
|
367
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-04-02T17:38:02Z</Timestamp>
|
368
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
369
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">cdb720feada30</CorrelationID>
|
370
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
371
|
-
<ShortMessage xsi:type="xs:string">Shipping Address Invalid City State Postal Code</ShortMessage>
|
372
|
-
<LongMessage xsi:type="xs:string">A match of the Shipping Address City, State, and Postal Code failed.</LongMessage>
|
373
|
-
<ErrorCode xsi:type="xs:token">10736</ErrorCode>
|
374
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
375
|
-
</Errors>
|
376
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
377
|
-
<ShortMessage xsi:type="xs:string">Shipping Address Invalid City State Postal Code</ShortMessage>
|
378
|
-
<LongMessage xsi:type="xs:string">A match of the Shipping Address City, State, and Postal Code failed.</LongMessage>
|
379
|
-
<ErrorCode xsi:type="xs:token">10736</ErrorCode>
|
380
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
381
|
-
</Errors>
|
382
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
383
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">543066</Build>
|
384
|
-
</SetExpressCheckoutResponse>
|
385
|
-
</SOAP-ENV:Body>
|
386
|
-
</SOAP-ENV:Envelope>
|
387
|
-
RESPONSE
|
388
|
-
end
|
389
|
-
end
|
@@ -1,569 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PaypalTest < Test::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
Base.mode = :test
|
6
|
-
PaypalGateway.pem_file = nil
|
7
|
-
|
8
|
-
@amount = 100
|
9
|
-
@gateway = PaypalGateway.new(
|
10
|
-
:login => 'cody',
|
11
|
-
:password => 'test',
|
12
|
-
:pem => 'PEM'
|
13
|
-
)
|
14
|
-
|
15
|
-
@credit_card = credit_card('4242424242424242')
|
16
|
-
@options = { :billing_address => address, :ip => '127.0.0.1' }
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_no_ip_address
|
20
|
-
assert_raise(ArgumentError){ @gateway.purchase(@amount, @credit_card, :billing_address => address)}
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_successful_purchase
|
24
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
25
|
-
|
26
|
-
assert response = @gateway.purchase(@amount, @credit_card, @options)
|
27
|
-
assert_instance_of Response, response
|
28
|
-
assert_success response
|
29
|
-
assert_equal '62U664727W5914806', response.authorization
|
30
|
-
assert response.test?
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_successful_reference_purchase
|
34
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
35
|
-
assert response = @gateway.purchase(@amount, @credit_card, @options)
|
36
|
-
assert_instance_of Response, response
|
37
|
-
assert_success response
|
38
|
-
assert_equal '62U664727W5914806', response.authorization
|
39
|
-
|
40
|
-
ref_id = response.authorization
|
41
|
-
|
42
|
-
gateway2 = PaypalGateway.new(:login => 'cody', :password => 'test', :pem => 'PEM')
|
43
|
-
gateway2.expects(:ssl_post).returns(successful_reference_purchase_response)
|
44
|
-
assert response = gateway2.purchase(@amount, ref_id, @options)
|
45
|
-
assert_instance_of Response, response
|
46
|
-
assert_success response
|
47
|
-
assert_equal '62U664727W5915049', response.authorization
|
48
|
-
assert response.test?
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_failed_purchase
|
52
|
-
@gateway.expects(:ssl_post).returns(failed_purchase_response)
|
53
|
-
|
54
|
-
assert response = @gateway.purchase(@amount, @credit_card, @options)
|
55
|
-
assert_instance_of Response, response
|
56
|
-
assert_failure response
|
57
|
-
assert response.test?
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_reauthorization
|
61
|
-
@gateway.expects(:ssl_post).returns(successful_reauthorization_response)
|
62
|
-
response = @gateway.reauthorize(@amount, '32J876265E528623B')
|
63
|
-
assert response.success?
|
64
|
-
assert_equal('1TX27389GX108740X', response.authorization)
|
65
|
-
assert response.test?
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_reauthorization_with_warning
|
69
|
-
@gateway.expects(:ssl_post).returns(successful_with_warning_reauthorization_response)
|
70
|
-
response = @gateway.reauthorize(@amount, '32J876265E528623B')
|
71
|
-
assert response.success?
|
72
|
-
assert_equal('1TX27389GX108740X', response.authorization)
|
73
|
-
assert response.test?
|
74
|
-
end
|
75
|
-
|
76
|
-
def test_amount_style
|
77
|
-
assert_equal '10.34', @gateway.send(:amount, 1034)
|
78
|
-
|
79
|
-
assert_raise(ArgumentError) do
|
80
|
-
@gateway.send(:amount, '10.34')
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_paypal_timeout_error
|
85
|
-
@gateway.stubs(:ssl_post).returns(paypal_timeout_error_response)
|
86
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
87
|
-
assert_equal "SOAP-ENV:Server", response.params['faultcode']
|
88
|
-
assert_equal "Internal error", response.params['faultstring']
|
89
|
-
assert_equal "Timeout processing request", response.params['detail']
|
90
|
-
assert_equal "SOAP-ENV:Server: Internal error - Timeout processing request", response.message
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_pem_file_accessor
|
94
|
-
PaypalGateway.pem_file = '123456'
|
95
|
-
gateway = PaypalGateway.new(:login => 'test', :password => 'test')
|
96
|
-
assert_equal '123456', gateway.options[:pem]
|
97
|
-
end
|
98
|
-
|
99
|
-
def test_passed_in_pem_overrides_class_accessor
|
100
|
-
PaypalGateway.pem_file = '123456'
|
101
|
-
gateway = PaypalGateway.new(:login => 'test', :password => 'test', :pem => 'Clobber')
|
102
|
-
assert_equal 'Clobber', gateway.options[:pem]
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_ensure_options_are_transferred_to_express_instance
|
106
|
-
PaypalGateway.pem_file = '123456'
|
107
|
-
gateway = PaypalGateway.new(:login => 'test', :password => 'password')
|
108
|
-
express = gateway.express
|
109
|
-
assert_instance_of PaypalExpressGateway, express
|
110
|
-
assert_equal 'test', express.options[:login]
|
111
|
-
assert_equal 'password', express.options[:password]
|
112
|
-
assert_equal '123456', express.options[:pem]
|
113
|
-
end
|
114
|
-
|
115
|
-
def test_supported_countries
|
116
|
-
assert_equal ['US'], PaypalGateway.supported_countries
|
117
|
-
end
|
118
|
-
|
119
|
-
def test_supported_card_types
|
120
|
-
assert_equal [:visa, :master, :american_express, :discover], PaypalGateway.supported_cardtypes
|
121
|
-
end
|
122
|
-
|
123
|
-
def test_button_source
|
124
|
-
PaypalGateway.application_id = 'ActiveMerchant_DC'
|
125
|
-
|
126
|
-
xml = REXML::Document.new(@gateway.send(:build_sale_or_authorization_request, 'Test', @amount, @credit_card, {}))
|
127
|
-
assert_equal 'ActiveMerchant_DC', REXML::XPath.first(xml, '//n2:ButtonSource').text
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_item_total_shipping_handling_and_tax_not_included_unless_all_are_present
|
131
|
-
xml = @gateway.send(:build_sale_or_authorization_request, 'Authorization', @amount, @credit_card,
|
132
|
-
:tax => @amount,
|
133
|
-
:shipping => @amount,
|
134
|
-
:handling => @amount
|
135
|
-
)
|
136
|
-
|
137
|
-
doc = REXML::Document.new(xml)
|
138
|
-
assert_nil REXML::XPath.first(doc, '//n2:PaymentDetails/n2:TaxTotal')
|
139
|
-
end
|
140
|
-
|
141
|
-
def test_item_total_shipping_handling_and_tax
|
142
|
-
xml = @gateway.send(:build_sale_or_authorization_request, 'Authorization', @amount, @credit_card,
|
143
|
-
:tax => @amount,
|
144
|
-
:shipping => @amount,
|
145
|
-
:handling => @amount,
|
146
|
-
:subtotal => 200
|
147
|
-
)
|
148
|
-
|
149
|
-
doc = REXML::Document.new(xml)
|
150
|
-
assert_equal '1.00', REXML::XPath.first(doc, '//n2:PaymentDetails/n2:TaxTotal').text
|
151
|
-
end
|
152
|
-
|
153
|
-
def test_should_use_test_certificate_endpoint
|
154
|
-
gateway = PaypalGateway.new(
|
155
|
-
:login => 'cody',
|
156
|
-
:password => 'test',
|
157
|
-
:pem => 'PEM'
|
158
|
-
)
|
159
|
-
assert_equal PaypalGateway::URLS[:test][:certificate], gateway.send(:endpoint_url)
|
160
|
-
end
|
161
|
-
|
162
|
-
def test_should_use_live_certificate_endpoint
|
163
|
-
gateway = PaypalGateway.new(
|
164
|
-
:login => 'cody',
|
165
|
-
:password => 'test',
|
166
|
-
:pem => 'PEM'
|
167
|
-
)
|
168
|
-
gateway.expects(:test?).returns(false)
|
169
|
-
|
170
|
-
assert_equal PaypalGateway::URLS[:live][:certificate], gateway.send(:endpoint_url)
|
171
|
-
end
|
172
|
-
|
173
|
-
def test_should_use_test_signature_endpoint
|
174
|
-
gateway = PaypalGateway.new(
|
175
|
-
:login => 'cody',
|
176
|
-
:password => 'test',
|
177
|
-
:signature => 'SIG'
|
178
|
-
)
|
179
|
-
|
180
|
-
assert_equal PaypalGateway::URLS[:test][:signature], gateway.send(:endpoint_url)
|
181
|
-
end
|
182
|
-
|
183
|
-
def test_should_use_live_signature_endpoint
|
184
|
-
gateway = PaypalGateway.new(
|
185
|
-
:login => 'cody',
|
186
|
-
:password => 'test',
|
187
|
-
:signature => 'SIG'
|
188
|
-
)
|
189
|
-
gateway.expects(:test?).returns(false)
|
190
|
-
|
191
|
-
assert_equal PaypalGateway::URLS[:live][:signature], gateway.send(:endpoint_url)
|
192
|
-
end
|
193
|
-
|
194
|
-
def test_should_raise_argument_when_credentials_not_present
|
195
|
-
assert_raises(ArgumentError) do
|
196
|
-
PaypalGateway.new(:login => 'cody', :password => 'test')
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
def test_avs_result
|
201
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
202
|
-
|
203
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
204
|
-
assert_equal 'X', response.avs_result['code']
|
205
|
-
end
|
206
|
-
|
207
|
-
def test_cvv_result
|
208
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
209
|
-
|
210
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
211
|
-
assert_equal 'M', response.cvv_result['code']
|
212
|
-
end
|
213
|
-
|
214
|
-
def test_fraud_review
|
215
|
-
@gateway.expects(:ssl_post).returns(fraud_review_response)
|
216
|
-
|
217
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
218
|
-
assert_success response
|
219
|
-
assert_equal "SuccessWithWarning", response.params["ack"]
|
220
|
-
assert_equal "Payment Pending your review in Fraud Management Filters", response.message
|
221
|
-
assert response.fraud_review?
|
222
|
-
end
|
223
|
-
|
224
|
-
def test_failed_capture_due_to_pending_fraud_review
|
225
|
-
@gateway.expects(:ssl_post).returns(failed_capture_due_to_pending_fraud_review)
|
226
|
-
|
227
|
-
response = @gateway.capture(@amount, 'authorization')
|
228
|
-
assert_failure response
|
229
|
-
assert_equal "Transaction must be accepted in Fraud Management Filters before capture.", response.message
|
230
|
-
end
|
231
|
-
|
232
|
-
# This occurs when sufficient 3rd party API permissions are not present to make the call for the user
|
233
|
-
def test_authentication_failed_response
|
234
|
-
@gateway.expects(:ssl_post).returns(authentication_failed_response)
|
235
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
236
|
-
assert_failure response
|
237
|
-
assert_equal "10002", response.params["error_codes"]
|
238
|
-
assert_equal "You do not have permissions to make this API call", response.message
|
239
|
-
end
|
240
|
-
|
241
|
-
private
|
242
|
-
def successful_purchase_response
|
243
|
-
<<-RESPONSE
|
244
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
245
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
246
|
-
<SOAP-ENV:Header>
|
247
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
248
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
249
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
250
|
-
<Username xsi:type="xs:string"/>
|
251
|
-
<Password xsi:type="xs:string"/>
|
252
|
-
<Subject xsi:type="xs:string"/>
|
253
|
-
</Credentials>
|
254
|
-
</RequesterCredentials>
|
255
|
-
</SOAP-ENV:Header>
|
256
|
-
<SOAP-ENV:Body id="_0">
|
257
|
-
<DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI">
|
258
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-01-06T23:41:25Z</Timestamp>
|
259
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
|
260
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">fee61882e6f47</CorrelationID>
|
261
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
262
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
|
263
|
-
<Amount xsi:type="cc:BasicAmountType" currencyID="USD">3.00</Amount>
|
264
|
-
<AVSCode xsi:type="xs:string">X</AVSCode>
|
265
|
-
<CVV2Code xsi:type="xs:string">M</CVV2Code>
|
266
|
-
<TransactionID>62U664727W5914806</TransactionID>
|
267
|
-
</DoDirectPaymentResponse>
|
268
|
-
</SOAP-ENV:Body>
|
269
|
-
</SOAP-ENV:Envelope>
|
270
|
-
RESPONSE
|
271
|
-
end
|
272
|
-
|
273
|
-
def successful_reference_purchase_response
|
274
|
-
<<-RESPONSE
|
275
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
276
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
277
|
-
<SOAP-ENV:Header>
|
278
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
279
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
280
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
281
|
-
<Username xsi:type="xs:string"/>
|
282
|
-
<Password xsi:type="xs:string"/>
|
283
|
-
<Subject xsi:type="xs:string"/>
|
284
|
-
</Credentials>
|
285
|
-
</RequesterCredentials>
|
286
|
-
</SOAP-ENV:Header>
|
287
|
-
<SOAP-ENV:Body id="_0">
|
288
|
-
<DoReferenceTransactionResponse xmlns="urn:ebay:api:PayPalAPI">
|
289
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-01-06T23:41:25Z</Timestamp>
|
290
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
|
291
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">fee61882e6f47</CorrelationID>
|
292
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
293
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
|
294
|
-
<Amount xsi:type="cc:BasicAmountType" currencyID="USD">3.00</Amount>
|
295
|
-
<AVSCode xsi:type="xs:string">X</AVSCode>
|
296
|
-
<CVV2Code xsi:type="xs:string">M</CVV2Code>
|
297
|
-
<TransactionID>62U664727W5915049</TransactionID>
|
298
|
-
</DoReferenceTransactionResponse>
|
299
|
-
</SOAP-ENV:Body>
|
300
|
-
</SOAP-ENV:Envelope>
|
301
|
-
RESPONSE
|
302
|
-
end
|
303
|
-
|
304
|
-
def failed_purchase_response
|
305
|
-
<<-RESPONSE
|
306
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
307
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
308
|
-
<SOAP-ENV:Header>
|
309
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
310
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
311
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
312
|
-
<Username xsi:type="xs:string"/>
|
313
|
-
<Password xsi:type="xs:string"/>
|
314
|
-
<Subject xsi:type="xs:string"/>
|
315
|
-
</Credentials>
|
316
|
-
</RequesterCredentials>
|
317
|
-
</SOAP-ENV:Header>
|
318
|
-
<SOAP-ENV:Body id="_0">
|
319
|
-
<DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI">
|
320
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-01-06T23:41:25Z</Timestamp>
|
321
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
322
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">fee61882e6f47</CorrelationID>
|
323
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
324
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
|
325
|
-
<Amount xsi:type="cc:BasicAmountType" currencyID="USD">3.00</Amount>
|
326
|
-
<AVSCode xsi:type="xs:string">X</AVSCode>
|
327
|
-
<CVV2Code xsi:type="xs:string">M</CVV2Code>
|
328
|
-
</DoDirectPaymentResponse>
|
329
|
-
</SOAP-ENV:Body>
|
330
|
-
</SOAP-ENV:Envelope>
|
331
|
-
RESPONSE
|
332
|
-
end
|
333
|
-
|
334
|
-
def paypal_timeout_error_response
|
335
|
-
<<-RESPONSE
|
336
|
-
<?xml version='1.0' encoding='UTF-8'?>
|
337
|
-
<SOAP-ENV:Envelope xmlns:cc='urn:ebay:apis:CoreComponentTypes' xmlns:sizeship='urn:ebay:api:PayPalAPI/sizeship.xsd' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:saml='urn:oasis:names:tc:SAML:1.0:assertion' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wsu='http://schemas.xmlsoap.org/ws/2002/07/utility' xmlns:ebl='urn:ebay:apis:eBLBaseComponents' xmlns:ds='http://www.w3.org/2000/09/xmldsig#' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:ns='urn:ebay:api:PayPalAPI' xmlns:market='urn:ebay:apis:Market' xmlns:ship='urn:ebay:apis:ship' xmlns:auction='urn:ebay:apis:Auction' xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
|
338
|
-
<SOAP-ENV:Header>
|
339
|
-
<Security xsi:type='wsse:SecurityType' xmlns='http://schemas.xmlsoap.org/ws/2002/12/secext'/>
|
340
|
-
<RequesterCredentials xsi:type='ebl:CustomSecurityHeaderType' xmlns='urn:ebay:api:PayPalAPI'>
|
341
|
-
<Credentials xsi:type='ebl:UserIdPasswordType' xmlns='urn:ebay:apis:eBLBaseComponents'>
|
342
|
-
<Username xsi:type='xs:string'/>
|
343
|
-
<Password xsi:type='xs:string'/>
|
344
|
-
<Subject xsi:type='xs:string'/>
|
345
|
-
</Credentials>
|
346
|
-
</RequesterCredentials>
|
347
|
-
</SOAP-ENV:Header>
|
348
|
-
<SOAP-ENV:Body id='_0'>
|
349
|
-
<SOAP-ENV:Fault>
|
350
|
-
<faultcode>SOAP-ENV:Server</faultcode>
|
351
|
-
<faultstring>Internal error</faultstring>
|
352
|
-
<detail>Timeout processing request</detail>
|
353
|
-
</SOAP-ENV:Fault>
|
354
|
-
</SOAP-ENV:Body>
|
355
|
-
</SOAP-ENV:Envelope>
|
356
|
-
RESPONSE
|
357
|
-
end
|
358
|
-
|
359
|
-
def successful_reauthorization_response
|
360
|
-
<<-RESPONSE
|
361
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
362
|
-
<SOAP-ENV:Envelope
|
363
|
-
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
364
|
-
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
|
365
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
366
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
367
|
-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
368
|
-
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
|
369
|
-
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
|
370
|
-
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
|
371
|
-
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
372
|
-
xmlns:market="urn:ebay:apis:Market"
|
373
|
-
xmlns:auction="urn:ebay:apis:Auction"
|
374
|
-
xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd"
|
375
|
-
xmlns:ship="urn:ebay:apis:ship"
|
376
|
-
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
|
377
|
-
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
|
378
|
-
xmlns:ns="urn:ebay:api:PayPalAPI">
|
379
|
-
<SOAP-ENV:Header>
|
380
|
-
<Security
|
381
|
-
xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext"
|
382
|
-
xsi:type="wsse:SecurityType">
|
383
|
-
</Security>
|
384
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"
|
385
|
-
xsi:type="ebl:CustomSecurityHeaderType">
|
386
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents"
|
387
|
-
xsi:type="ebl:UserIdPasswordType">
|
388
|
-
<Username xsi:type="xs:string"></Username>
|
389
|
-
<Password xsi:type="xs:string"></Password>
|
390
|
-
<Subject xsi:type="xs:string"></Subject>
|
391
|
-
</Credentials>
|
392
|
-
</RequesterCredentials>
|
393
|
-
</SOAP-ENV:Header>
|
394
|
-
<SOAP-ENV:Body id="_0">
|
395
|
-
<DoReauthorizationResponse xmlns="urn:ebay:api:PayPalAPI">
|
396
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2007-03-04T23:34:42Z</Timestamp>
|
397
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
|
398
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">e444ddb7b3ed9</CorrelationID>
|
399
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
400
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
|
401
|
-
<AuthorizationID xsi:type="ebl:AuthorizationId">1TX27389GX108740X</AuthorizationID>
|
402
|
-
</DoReauthorizationResponse>
|
403
|
-
</SOAP-ENV:Body>
|
404
|
-
</SOAP-ENV:Envelope>
|
405
|
-
RESPONSE
|
406
|
-
end
|
407
|
-
|
408
|
-
def successful_with_warning_reauthorization_response
|
409
|
-
<<-RESPONSE
|
410
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
411
|
-
<SOAP-ENV:Envelope
|
412
|
-
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
413
|
-
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
|
414
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
415
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
416
|
-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
417
|
-
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
|
418
|
-
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
|
419
|
-
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
|
420
|
-
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
421
|
-
xmlns:market="urn:ebay:apis:Market"
|
422
|
-
xmlns:auction="urn:ebay:apis:Auction"
|
423
|
-
xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd"
|
424
|
-
xmlns:ship="urn:ebay:apis:ship"
|
425
|
-
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
|
426
|
-
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
|
427
|
-
xmlns:ns="urn:ebay:api:PayPalAPI">
|
428
|
-
<SOAP-ENV:Header>
|
429
|
-
<Security
|
430
|
-
xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext"
|
431
|
-
xsi:type="wsse:SecurityType">
|
432
|
-
</Security>
|
433
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"
|
434
|
-
xsi:type="ebl:CustomSecurityHeaderType">
|
435
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents"
|
436
|
-
xsi:type="ebl:UserIdPasswordType">
|
437
|
-
<Username xsi:type="xs:string"></Username>
|
438
|
-
<Password xsi:type="xs:string"></Password>
|
439
|
-
<Subject xsi:type="xs:string"></Subject>
|
440
|
-
</Credentials>
|
441
|
-
</RequesterCredentials>
|
442
|
-
</SOAP-ENV:Header>
|
443
|
-
<SOAP-ENV:Body id="_0">
|
444
|
-
<DoReauthorizationResponse xmlns="urn:ebay:api:PayPalAPI">
|
445
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2007-03-04T23:34:42Z</Timestamp>
|
446
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">SuccessWithWarning</Ack>
|
447
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">e444ddb7b3ed9</CorrelationID>
|
448
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
|
449
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
|
450
|
-
<AuthorizationID xsi:type="ebl:AuthorizationId">1TX27389GX108740X</AuthorizationID>
|
451
|
-
</DoReauthorizationResponse>
|
452
|
-
</SOAP-ENV:Body>
|
453
|
-
</SOAP-ENV:Envelope>
|
454
|
-
RESPONSE
|
455
|
-
end
|
456
|
-
|
457
|
-
def fraud_review_response
|
458
|
-
<<-RESPONSE
|
459
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
460
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
461
|
-
<SOAP-ENV:Header>
|
462
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
463
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
464
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
465
|
-
<Username xsi:type="xs:string"/>
|
466
|
-
<Password xsi:type="xs:string"/>
|
467
|
-
<Signature xsi:type="xs:string">An5ns1Kso7MWUdW4ErQKJJJ4qi4-Azffuo82oMt-Cv9I8QTOs-lG5sAv</Signature>
|
468
|
-
<Subject xsi:type="xs:string"/>
|
469
|
-
</Credentials>
|
470
|
-
</RequesterCredentials>
|
471
|
-
</SOAP-ENV:Header>
|
472
|
-
<SOAP-ENV:Body id="_0">
|
473
|
-
<DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI">
|
474
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-07-04T19:27:39Z</Timestamp>
|
475
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">SuccessWithWarning</Ack>
|
476
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">205d8397e7ed</CorrelationID>
|
477
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
478
|
-
<ShortMessage xsi:type="xs:string">Payment Pending your review in Fraud Management Filters</ShortMessage>
|
479
|
-
<LongMessage xsi:type="xs:string">Payment Pending your review in Fraud Management Filters</LongMessage>
|
480
|
-
<ErrorCode xsi:type="xs:token">11610</ErrorCode>
|
481
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Warning</SeverityCode>
|
482
|
-
</Errors>
|
483
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">50.0</Version>
|
484
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">623197</Build>
|
485
|
-
<Amount xsi:type="cc:BasicAmountType" currencyID="USD">1500.00</Amount>
|
486
|
-
<AVSCode xsi:type="xs:string">X</AVSCode>
|
487
|
-
<CVV2Code xsi:type="xs:string">M</CVV2Code>
|
488
|
-
<TransactionID>5V117995ER6796022</TransactionID>
|
489
|
-
</DoDirectPaymentResponse>
|
490
|
-
</SOAP-ENV:Body>
|
491
|
-
</SOAP-ENV:Envelope>
|
492
|
-
RESPONSE
|
493
|
-
end
|
494
|
-
|
495
|
-
def failed_capture_due_to_pending_fraud_review
|
496
|
-
<<-RESPONSE
|
497
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
498
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
499
|
-
<SOAP-ENV:Header>
|
500
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
501
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
502
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
503
|
-
<Username xsi:type="xs:string"/>
|
504
|
-
<Password xsi:type="xs:string"/>
|
505
|
-
<Subject xsi:type="xs:string"/>
|
506
|
-
</Credentials>
|
507
|
-
</RequesterCredentials>
|
508
|
-
</SOAP-ENV:Header>
|
509
|
-
<SOAP-ENV:Body id="_0">
|
510
|
-
<DoCaptureResponse xmlns="urn:ebay:api:PayPalAPI">
|
511
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-07-04T21:45:35Z</Timestamp>
|
512
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
513
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">32a3855bd35b7</CorrelationID>
|
514
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
515
|
-
<ShortMessage xsi:type="xs:string">Transaction must be accepted in Fraud Management Filters before capture.</ShortMessage>
|
516
|
-
<LongMessage xsi:type="xs:string"/>
|
517
|
-
<ErrorCode xsi:type="xs:token">11612</ErrorCode>
|
518
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
519
|
-
</Errors>
|
520
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">52.000000</Version>
|
521
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">588340</Build>
|
522
|
-
<DoCaptureResponseDetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:DoCaptureResponseDetailsType">
|
523
|
-
<PaymentInfo xsi:type="ebl:PaymentInfoType">
|
524
|
-
<TransactionType xsi:type="ebl:PaymentTransactionCodeType">none</TransactionType>
|
525
|
-
<PaymentType xsi:type="ebl:PaymentCodeType">none</PaymentType>
|
526
|
-
<PaymentStatus xsi:type="ebl:PaymentStatusCodeType">None</PaymentStatus>
|
527
|
-
<PendingReason xsi:type="ebl:PendingStatusCodeType">none</PendingReason>
|
528
|
-
<ReasonCode xsi:type="ebl:ReversalReasonCodeType">none</ReasonCode>
|
529
|
-
</PaymentInfo>
|
530
|
-
</DoCaptureResponseDetails>
|
531
|
-
</DoCaptureResponse>
|
532
|
-
</SOAP-ENV:Body>
|
533
|
-
</SOAP-ENV:Envelope>
|
534
|
-
RESPONSE
|
535
|
-
end
|
536
|
-
|
537
|
-
def authentication_failed_response
|
538
|
-
<<-RESPONSE
|
539
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
540
|
-
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:market="urn:ebay:apis:Market" xmlns:auction="urn:ebay:apis:Auction" xmlns:sizeship="urn:ebay:api:PayPalAPI/sizeship.xsd" xmlns:ship="urn:ebay:apis:ship" xmlns:skype="urn:ebay:apis:skype" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
|
541
|
-
<SOAP-ENV:Header>
|
542
|
-
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
|
543
|
-
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
|
544
|
-
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
|
545
|
-
<Username xsi:type="xs:string"/>
|
546
|
-
<Password xsi:type="xs:string"/>
|
547
|
-
<Subject xsi:type="xs:string"/>
|
548
|
-
</Credentials>
|
549
|
-
</RequesterCredentials>
|
550
|
-
</SOAP-ENV:Header>
|
551
|
-
<SOAP-ENV:Body id="_0">
|
552
|
-
<DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI">
|
553
|
-
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2008-08-12T19:40:59Z</Timestamp>
|
554
|
-
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
|
555
|
-
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">b874109bfd11</CorrelationID>
|
556
|
-
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
|
557
|
-
<ShortMessage xsi:type="xs:string">Authentication/Authorization Failed</ShortMessage>
|
558
|
-
<LongMessage xsi:type="xs:string">You do not have permissions to make this API call</LongMessage>
|
559
|
-
<ErrorCode xsi:type="xs:token">10002</ErrorCode>
|
560
|
-
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
|
561
|
-
</Errors>
|
562
|
-
<Version xmlns="urn:ebay:apis:eBLBaseComponents">52.000000</Version>
|
563
|
-
<Build xmlns="urn:ebay:apis:eBLBaseComponents">628921</Build>
|
564
|
-
</DoDirectPaymentResponse>
|
565
|
-
</SOAP-ENV:Body>
|
566
|
-
</SOAP-ENV:Envelope>
|
567
|
-
RESPONSE
|
568
|
-
end
|
569
|
-
end
|