paypal-sdk-merchant 1.96.2 → 1.98.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/lib/paypal-sdk-merchant.rb +0 -0
- data/lib/paypal-sdk/merchant/data_types.rb +11 -2
- data/lib/paypal-sdk/merchant/services.rb +1 -1
- data/lib/paypal-sdk/merchant/version.rb +1 -1
- data/spec/config/cert_key.pem +0 -0
- data/spec/config/paypal.yml +24 -25
- data/spec/merchant_samples_spec.rb +108 -0
- data/spec/merchant_spec.rb +29 -29
- data/spec/spec_helper.rb +6 -6
- metadata +6 -6
- data/spec/transaction_search_spec.rb +0 -15
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ gemspec
|
|
4
4
|
|
5
5
|
gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
|
6
6
|
|
7
|
-
if
|
7
|
+
if File.exist? File.expand_path('../samples/merchant_samples.gemspec', __FILE__)
|
8
8
|
gem 'merchant_samples', :path => 'samples', :require => false
|
9
9
|
group :test do
|
10
10
|
gem 'rspec-rails', :require => false
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/lib/paypal-sdk-merchant.rb
CHANGED
File without changes
|
@@ -182,6 +182,13 @@ module PayPal::SDK
|
|
182
182
|
|
183
183
|
|
184
184
|
|
185
|
+
# Normalization Status of the Address
|
186
|
+
class AddressNormalizationStatusCodeType < EnumType
|
187
|
+
self.options = { 'NONE' => 'None', 'NORMALIZED' => 'Normalized', 'UNNORMALIZED' => 'Unnormalized' }
|
188
|
+
end
|
189
|
+
|
190
|
+
|
191
|
+
|
185
192
|
# PaymentDetailsCodeType This is the PayPal payment details type (used by DCC and Express Checkout)
|
186
193
|
class PaymentActionCodeType < EnumType
|
187
194
|
self.options = { 'NONE' => 'None', 'AUTHORIZATION' => 'Authorization', 'SALE' => 'Sale', 'ORDER' => 'Order' }
|
@@ -254,7 +261,7 @@ module PayPal::SDK
|
|
254
261
|
|
255
262
|
# PendingStatusCodeType The pending status for a PayPal Payment transaction which matches the output from IPN
|
256
263
|
class PendingStatusCodeType < EnumType
|
257
|
-
self.options = { 'NONE' => 'none', 'ECHECK' => 'echeck', 'INTL' => 'intl', 'VERIFY' => 'verify', 'ADDRESS' => 'address', 'UNILATERAL' => 'unilateral', 'OTHER' => 'other', 'UPGRADE' => 'upgrade', 'MULTICURRENCY' => 'multi-currency', 'AUTHORIZATION' => 'authorization', 'ORDER' => 'order', 'PAYMENTREVIEW' => 'payment-review' }
|
264
|
+
self.options = { 'NONE' => 'none', 'ECHECK' => 'echeck', 'INTL' => 'intl', 'VERIFY' => 'verify', 'ADDRESS' => 'address', 'UNILATERAL' => 'unilateral', 'OTHER' => 'other', 'UPGRADE' => 'upgrade', 'MULTICURRENCY' => 'multi-currency', 'AUTHORIZATION' => 'authorization', 'ORDER' => 'order', 'PAYMENTREVIEW' => 'payment-review', 'REGULATORYREVIEW' => 'regulatory-review' }
|
258
265
|
end
|
259
266
|
|
260
267
|
|
@@ -689,6 +696,8 @@ module PayPal::SDK
|
|
689
696
|
object_of :InternationalStreet, String, :namespace => :ebl
|
690
697
|
# Status of the address on file with PayPal. IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile.
|
691
698
|
object_of :AddressStatus, AddressStatusCodeType, :namespace => :ebl
|
699
|
+
# Returns Normalization Status of the Address. Possible values are Normalized, Unnormalized, and None.
|
700
|
+
object_of :AddressNormalizationStatus, AddressNormalizationStatusCodeType, :namespace => :ebl
|
692
701
|
end
|
693
702
|
end
|
694
703
|
|
@@ -1710,7 +1719,7 @@ module PayPal::SDK
|
|
1710
1719
|
object_of :ExchangeRate, String, :namespace => :ebl
|
1711
1720
|
# The status of the payment: None: No status Created: A giropay payment has been initiated. Canceled-Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you. Completed: The payment has been completed, and the funds have been added successfully to your account balance. Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the PendingReason element. Expired: This authorization has expired and cannot be captured. Failed: The payment has failed. This happens only if the payment was made from your customer's bank account. In-Progress: The transaction is in process of authorization and capture. Partially-Refunded: The transaction has been partially refunded. Pending: The payment is pending. See "PendingReason" for more information. Refunded: You refunded the payment. Reversed: A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element. Processed: A payment has been accepted. Voided: This authorization has been voided. Completed-Funds-Held: The payment has been completed, and the funds have been added successfully to your pending balance. See the "HoldDecision" field for more information.
|
1712
1721
|
object_of :PaymentStatus, PaymentStatusCodeType, :namespace => :ebl
|
1713
|
-
# The reason the payment is pending: none: No pending reason address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile. authorization: You set PaymentAction to Authorization on SetExpressCheckoutRequest and have not yet captured funds. echeck: The payment is pending because it was made by an eCheck that has not yet cleared. intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview. multi-currency: You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment. unilateral: The payment is pending because it was made to an email address that is not yet registered or confirmed. upgrade: The payment is pending because it was made via credit card and you must upgrade your account to Business or Premier status in order to receive the funds. upgrade can also mean that you have reached the monthly limit for transactions on your account. verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment. other: The payment is pending for a reason other than those listed above. For more information, contact PayPal Customer Service.
|
1722
|
+
# The reason the payment is pending: none: No pending reason address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile. authorization: You set PaymentAction to Authorization on SetExpressCheckoutRequest and have not yet captured funds. echeck: The payment is pending because it was made by an eCheck that has not yet cleared. intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview. multi-currency: You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment. unilateral: The payment is pending because it was made to an email address that is not yet registered or confirmed. upgrade: The payment is pending because it was made via credit card and you must upgrade your account to Business or Premier status in order to receive the funds. upgrade can also mean that you have reached the monthly limit for transactions on your account. verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment. regulatory-review: This payment is pending while we make sure it meets regulatory requirements. We'll contact you again in 24-72 hours with the outcome of our review. other: The payment is pending for a reason other than those listed above. For more information, contact PayPal Customer Service.
|
1714
1723
|
object_of :PendingReason, PendingStatusCodeType, :namespace => :ebl
|
1715
1724
|
# The reason for a reversal if TransactionType is reversal: none: No reason code chargeback: A reversal has occurred on this transaction due to a chargeback by your customer. guarantee: A reversal has occurred on this transaction due to your customer triggering a money-back guarantee. buyer-complaint: A reversal has occurred on this transaction due to a complaint about the transaction from your customer. refund: A reversal has occurred on this transaction because you have given the customer a refund. other: A reversal has occurred on this transaction due to a reason not listed above.
|
1716
1725
|
object_of :ReasonCode, ReversalReasonCodeType, :namespace => :ebl
|
data/spec/config/cert_key.pem
CHANGED
File without changes
|
data/spec/config/paypal.yml
CHANGED
@@ -1,25 +1,24 @@
|
|
1
|
-
test: &default
|
2
|
-
username: jb-us-seller_api1.paypal.com
|
3
|
-
password: WX4WTU3S8MY44S7F
|
4
|
-
signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
5
|
-
app_id: APP-80W284485P519543T
|
6
|
-
http_timeout: 30
|
7
|
-
mode: sandbox
|
8
|
-
redirect_url: "https://www.sandbox.paypal.com/webscr&cmd="
|
9
|
-
dev_central_url: "https://developer.paypal.com"
|
10
|
-
development:
|
11
|
-
<<: *default
|
12
|
-
|
13
|
-
with_certificate:
|
14
|
-
<<: *default
|
15
|
-
username: platfo_1255170694_biz_api1.gmail.com
|
16
|
-
password: 2DPPKUPKB7DQLXNR
|
17
|
-
signature:
|
18
|
-
cert_path: "spec/config/cert_key.pem"
|
19
|
-
app_id: APP-80W284485P519543T
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
token_secret: MnZ-iPdDqGLEfQIuTIfUN4uK9lU
|
1
|
+
test: &default
|
2
|
+
username: jb-us-seller_api1.paypal.com
|
3
|
+
password: WX4WTU3S8MY44S7F
|
4
|
+
signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
5
|
+
app_id: APP-80W284485P519543T
|
6
|
+
http_timeout: 30
|
7
|
+
mode: sandbox
|
8
|
+
redirect_url: "https://www.sandbox.paypal.com/webscr&cmd="
|
9
|
+
dev_central_url: "https://developer.paypal.com"
|
10
|
+
development:
|
11
|
+
<<: *default
|
12
|
+
|
13
|
+
with_certificate:
|
14
|
+
<<: *default
|
15
|
+
username: platfo_1255170694_biz_api1.gmail.com
|
16
|
+
password: 2DPPKUPKB7DQLXNR
|
17
|
+
signature:
|
18
|
+
cert_path: "spec/config/cert_key.pem"
|
19
|
+
app_id: APP-80W284485P519543T
|
20
|
+
|
21
|
+
with_oauth_token:
|
22
|
+
<<: *default
|
23
|
+
token: H2kLxjm9lCxQdnOYxkH29I53TpZyIXez4GtHhAVGpiU3DiVTz5eNPQ
|
24
|
+
token_secret: MnZ-iPdDqGLEfQIuTIfUN4uK9lU
|
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Merchant" do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@api = PayPal::SDK::Merchant::API.new
|
7
|
+
@api_with_cert = PayPal::SDK::Merchant::API.new(:with_certificate)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "Examples" do
|
11
|
+
it "transaction search" do
|
12
|
+
# Build request object
|
13
|
+
@transaction_search = @api.build_transaction_search({
|
14
|
+
:StartDate => "2012-11-01T00:00:00+00:00",
|
15
|
+
:EndDate => "2012-11-01T01:00:00+00:00" })
|
16
|
+
|
17
|
+
# Make API call & get response
|
18
|
+
@transaction_search_response = @api.transaction_search(@transaction_search)
|
19
|
+
@transaction_search_response.Ack.should eql "Success"
|
20
|
+
|
21
|
+
@transaction_search_response = @api_with_cert.transaction_search(@transaction_search)
|
22
|
+
@transaction_search_response.Ack.should eql "Success"
|
23
|
+
end
|
24
|
+
|
25
|
+
it "get balance" do
|
26
|
+
# Build request object
|
27
|
+
@get_balance = @api.build_get_balance({
|
28
|
+
:ReturnAllCurrencies => "0" })
|
29
|
+
|
30
|
+
# Make API call & get response
|
31
|
+
@get_balance_response = @api.get_balance(@get_balance)
|
32
|
+
|
33
|
+
@get_balance_response.Ack.should eql "Success"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "get pal detail" do
|
37
|
+
# Build request object
|
38
|
+
@get_pal_details = @api.build_get_pal_details({})
|
39
|
+
|
40
|
+
# Make API call & get response
|
41
|
+
@get_pal_details_response = @api.get_pal_details(@get_pal_details)
|
42
|
+
|
43
|
+
@get_pal_details_response.Ack.should eql "Success"
|
44
|
+
end
|
45
|
+
|
46
|
+
it "Set auth flow param" do
|
47
|
+
@set_auth_flow_param = @api.build_set_auth_flow_param({
|
48
|
+
:SetAuthFlowParamRequestDetails => {
|
49
|
+
:ReturnURL => "http://www.example.com/",
|
50
|
+
:CancelURL => "http://www.example.com/",
|
51
|
+
:LogoutURL => "http://www.example.com/" } })
|
52
|
+
|
53
|
+
# Make API call & get response
|
54
|
+
@set_auth_flow_param_response = @api.set_auth_flow_param(@set_auth_flow_param)
|
55
|
+
|
56
|
+
@set_auth_flow_param_response.Ack.should eql "Success"
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
it "Do direct payment" do
|
61
|
+
# Build request object
|
62
|
+
@do_direct_payment = @api.build_do_direct_payment({
|
63
|
+
:DoDirectPaymentRequestDetails => {
|
64
|
+
:PaymentAction => "Sale",
|
65
|
+
:PaymentDetails => {
|
66
|
+
:OrderTotal => {
|
67
|
+
:currencyID => "USD",
|
68
|
+
:value => "1" },
|
69
|
+
:NotifyURL => "https://paypal-sdk-samples.herokuapp.com/merchant/ipn_notify",
|
70
|
+
:ShipToAddress => {
|
71
|
+
:Name => "John Doe",
|
72
|
+
:Street1 => "1 Main St",
|
73
|
+
:CityName => "San Jose",
|
74
|
+
:StateOrProvince => "CA",
|
75
|
+
:Country => "US",
|
76
|
+
:PostalCode => "95131" } },
|
77
|
+
:CreditCard => {
|
78
|
+
:CreditCardType => "Visa",
|
79
|
+
:CreditCardNumber => "4904202183894535",
|
80
|
+
:ExpMonth => 12,
|
81
|
+
:ExpYear => 2022,
|
82
|
+
:CVV2 => "962" } } })
|
83
|
+
|
84
|
+
# Make API call & get response
|
85
|
+
@do_direct_payment_response = @api.do_direct_payment(@do_direct_payment)
|
86
|
+
@do_direct_payment_response.Ack.should eql "Success"
|
87
|
+
|
88
|
+
# Make API call & get response
|
89
|
+
@do_direct_payment_response = @api_with_cert.do_direct_payment(@do_direct_payment)
|
90
|
+
@do_direct_payment_response.Ack.should eql "Success"
|
91
|
+
end
|
92
|
+
|
93
|
+
it "Mass pay" do
|
94
|
+
# Build request object
|
95
|
+
@mass_pay = @api.build_mass_pay({
|
96
|
+
:ReceiverType => "EmailAddress",
|
97
|
+
:MassPayItem => [{
|
98
|
+
:ReceiverEmail => "enduser_biz@gmail.com",
|
99
|
+
:Amount => {
|
100
|
+
:currencyID => "USD",
|
101
|
+
:value => "3.00" } }] })
|
102
|
+
|
103
|
+
# Make API call & get response
|
104
|
+
@mass_pay_response = @api.mass_pay(@mass_pay)
|
105
|
+
@mass_pay_response.Ack.should eql "Success"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
data/spec/merchant_spec.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Merchant" do
|
4
|
-
|
5
|
-
before :all do
|
6
|
-
@client = PayPal::SDK::Merchant::API.new
|
7
|
-
end
|
8
|
-
|
9
|
-
describe "Services" do
|
10
|
-
Actions = PayPal::SDK::Merchant::Services.instance_methods.select{|s| s =~ /^[A-Z]/ and s !~ /^Build/ } -
|
11
|
-
[ :CompleteRecoup ]
|
12
|
-
Actions.each do |service_method|
|
13
|
-
it "make empty request to #{service_method}" do
|
14
|
-
response = @client.send(service_method, {})
|
15
|
-
response.ack.should_not be_nil
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "DataTypes" do
|
21
|
-
PayPal::SDK::Merchant::DataTypes.constants.each do |const_name|
|
22
|
-
it "create object for #{const_name}" do
|
23
|
-
klass = PayPal::SDK::Merchant::DataTypes.const_get(const_name)
|
24
|
-
klass.new.should be_a klass
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Merchant" do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@client = PayPal::SDK::Merchant::API.new
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "Services" do
|
10
|
+
Actions = PayPal::SDK::Merchant::Services.instance_methods.select{|s| s =~ /^[A-Z]/ and s !~ /^Build/ } -
|
11
|
+
[ :CompleteRecoup, "CompleteRecoup" ]
|
12
|
+
Actions.each do |service_method|
|
13
|
+
it "make empty request to #{service_method}" do
|
14
|
+
response = @client.send(service_method, {})
|
15
|
+
response.ack.should_not be_nil
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "DataTypes" do
|
21
|
+
PayPal::SDK::Merchant::DataTypes.constants.each do |const_name|
|
22
|
+
it "create object for #{const_name}" do
|
23
|
+
klass = PayPal::SDK::Merchant::DataTypes.const_get(const_name)
|
24
|
+
klass.new.should be_a klass
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
|
3
|
-
Bundler.require :default, :test
|
4
|
-
PayPal::SDK::Core::Config.load('spec/config/paypal.yml', 'test')
|
5
|
-
|
6
|
-
require 'paypal-sdk-merchant'
|
1
|
+
require 'bundler/setup'
|
2
|
+
|
3
|
+
Bundler.require :default, :test
|
4
|
+
PayPal::SDK::Core::Config.load('spec/config/paypal.yml', 'test')
|
5
|
+
|
6
|
+
require 'paypal-sdk-merchant'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-sdk-merchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.98.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paypal-sdk-core
|
@@ -36,7 +36,7 @@ executables: []
|
|
36
36
|
extensions: []
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
|
-
- spec/
|
39
|
+
- spec/merchant_samples_spec.rb
|
40
40
|
- spec/spec_helper.rb
|
41
41
|
- spec/config/paypal.yml
|
42
42
|
- spec/config/cert_key.pem
|
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
segments:
|
67
67
|
- 0
|
68
|
-
hash:
|
68
|
+
hash: -656332369
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
none: false
|
71
71
|
requirements:
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash:
|
77
|
+
hash: -656332369
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
80
|
rubygems_version: 1.8.24
|
@@ -82,7 +82,7 @@ signing_key:
|
|
82
82
|
specification_version: 3
|
83
83
|
summary: PayPal Merchant SDK
|
84
84
|
test_files:
|
85
|
-
- spec/
|
85
|
+
- spec/merchant_samples_spec.rb
|
86
86
|
- spec/spec_helper.rb
|
87
87
|
- spec/config/paypal.yml
|
88
88
|
- spec/config/cert_key.pem
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Merchant" do
|
4
|
-
|
5
|
-
before :all do
|
6
|
-
@client = PayPal::SDK::Merchant::API.new
|
7
|
-
end
|
8
|
-
|
9
|
-
describe "Services" do
|
10
|
-
it "search transaction by date" do
|
11
|
-
response = @client.transaction_search( :StartDate => "2012-11-01T00:00:00+00:00", :EndDate => "2012-11-01T12:00:00+0000" )
|
12
|
-
response.ack.should eql "Success"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|