paypal-payment 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/Gemfile +18 -0
- data/Guardfile +24 -0
- data/README.rdoc +107 -0
- data/Rakefile +5 -0
- data/docs/AdaptivePayments.rdoc +84 -0
- data/docs/PP_NVPAPI_DeveloperGuide.pdf +0 -0
- data/docs/PP_WPP_IntegrationGuide.pdf +0 -0
- data/docs/adaptive_payments.md +55 -0
- data/docs/api.txt +67 -0
- data/docs/design.txt +38 -0
- data/docs/express_checkout.md +172 -0
- data/docs/requirements.txt +32 -0
- data/lib/paypal-payment.rb +10 -0
- data/lib/paypal/adaptive_payments.rb +31 -0
- data/lib/paypal/adaptive_payments/api.rb +51 -0
- data/lib/paypal/adaptive_payments/base.rb +11 -0
- data/lib/paypal/adaptive_payments/client_details.rb +14 -0
- data/lib/paypal/adaptive_payments/display_options.rb +10 -0
- data/lib/paypal/adaptive_payments/funding_constraint.rb +11 -0
- data/lib/paypal/adaptive_payments/funding_type_info.rb +8 -0
- data/lib/paypal/adaptive_payments/funding_type_list.rb +11 -0
- data/lib/paypal/adaptive_payments/initiating_entity.rb +11 -0
- data/lib/paypal/adaptive_payments/institution_customer.rb +13 -0
- data/lib/paypal/adaptive_payments/invoice_data.rb +13 -0
- data/lib/paypal/adaptive_payments/invoice_item.rb +11 -0
- data/lib/paypal/adaptive_payments/payment.rb +105 -0
- data/lib/paypal/adaptive_payments/payment_info.rb +18 -0
- data/lib/paypal/adaptive_payments/payment_info_list.rb +11 -0
- data/lib/paypal/adaptive_payments/payment_options.rb +39 -0
- data/lib/paypal/adaptive_payments/phone.rb +9 -0
- data/lib/paypal/adaptive_payments/preapproval.rb +52 -0
- data/lib/paypal/adaptive_payments/receiver.rb +17 -0
- data/lib/paypal/adaptive_payments/receiver_list.rb +49 -0
- data/lib/paypal/adaptive_payments/receiver_options.rb +19 -0
- data/lib/paypal/adaptive_payments/request.rb +51 -0
- data/lib/paypal/adaptive_payments/response.rb +38 -0
- data/lib/paypal/adaptive_payments/response/address.rb +13 -0
- data/lib/paypal/adaptive_payments/response/address_list.rb +11 -0
- data/lib/paypal/adaptive_payments/response/base_address.rb +13 -0
- data/lib/paypal/adaptive_payments/response/details.rb +19 -0
- data/lib/paypal/adaptive_payments/response/error_list.rb +15 -0
- data/lib/paypal/adaptive_payments/response/pay.rb +31 -0
- data/lib/paypal/adaptive_payments/response/pay_error.rb +16 -0
- data/lib/paypal/adaptive_payments/response/pay_error_list.rb +15 -0
- data/lib/paypal/adaptive_payments/response/pay_options.rb +7 -0
- data/lib/paypal/adaptive_payments/response/preapproval.rb +47 -0
- data/lib/paypal/adaptive_payments/response/refund.rb +16 -0
- data/lib/paypal/adaptive_payments/response/refund_info.rb +24 -0
- data/lib/paypal/adaptive_payments/response/refund_info_list.rb +11 -0
- data/lib/paypal/adaptive_payments/response/shipping_address.rb +11 -0
- data/lib/paypal/adaptive_payments/sender_identifier.rb +7 -0
- data/lib/paypal/adaptive_payments/sender_options.rb +8 -0
- data/lib/paypal/api.rb +94 -0
- data/lib/paypal/cacert.pem +3987 -0
- data/lib/paypal/common.rb +11 -0
- data/lib/paypal/common/base.rb +83 -0
- data/lib/paypal/common/error_data.rb +15 -0
- data/lib/paypal/common/request.rb +45 -0
- data/lib/paypal/common/request_envelope.rb +13 -0
- data/lib/paypal/common/response.rb +34 -0
- data/lib/paypal/common/response_envelope.rb +19 -0
- data/lib/paypal/express_checkout.rb +19 -0
- data/lib/paypal/express_checkout/account.rb +16 -0
- data/lib/paypal/express_checkout/api.rb +43 -0
- data/lib/paypal/express_checkout/base.rb +37 -0
- data/lib/paypal/express_checkout/billing.rb +7 -0
- data/lib/paypal/express_checkout/callback.rb +17 -0
- data/lib/paypal/express_checkout/checkout.rb +144 -0
- data/lib/paypal/express_checkout/fields.rb +449 -0
- data/lib/paypal/express_checkout/fmf.rb +7 -0
- data/lib/paypal/express_checkout/payment.rb +76 -0
- data/lib/paypal/express_checkout/payment_item.rb +7 -0
- data/lib/paypal/express_checkout/recurring.rb +131 -0
- data/lib/paypal/express_checkout/request.rb +212 -0
- data/lib/paypal/express_checkout/response.rb +52 -0
- data/lib/paypal/express_checkout/response/account.rb +30 -0
- data/lib/paypal/express_checkout/response/address.rb +29 -0
- data/lib/paypal/express_checkout/response/authorization.rb +25 -0
- data/lib/paypal/express_checkout/response/base.rb +125 -0
- data/lib/paypal/express_checkout/response/callback_request.rb +10 -0
- data/lib/paypal/express_checkout/response/callback_response.rb +8 -0
- data/lib/paypal/express_checkout/response/capture.rb +14 -0
- data/lib/paypal/express_checkout/response/checkout.rb +11 -0
- data/lib/paypal/express_checkout/response/details.rb +35 -0
- data/lib/paypal/express_checkout/response/manage_profile.rb +9 -0
- data/lib/paypal/express_checkout/response/notification.rb +85 -0
- data/lib/paypal/express_checkout/response/payment.rb +24 -0
- data/lib/paypal/express_checkout/response/profile.rb +58 -0
- data/lib/paypal/express_checkout/response/reference.rb +11 -0
- data/lib/paypal/express_checkout/response/refund.rb +13 -0
- data/lib/paypal/express_checkout/response/search.rb +33 -0
- data/lib/paypal/express_checkout/response/transaction_details.rb +11 -0
- data/lib/paypal/express_checkout/shipping_option.rb +7 -0
- data/lib/paypal/express_checkout/utils.rb +26 -0
- data/lib/paypal/express_checkout/version.rb +10 -0
- data/lib/paypal/invoice.rb +22 -0
- data/lib/paypal/invoice/api.rb +51 -0
- data/lib/paypal/invoice/base.rb +11 -0
- data/lib/paypal/invoice/base_address.rb +11 -0
- data/lib/paypal/invoice/business_info.rb +17 -0
- data/lib/paypal/invoice/date_range.rb +8 -0
- data/lib/paypal/invoice/invoice.rb +117 -0
- data/lib/paypal/invoice/invoice_details.rb +38 -0
- data/lib/paypal/invoice/invoice_item.rb +13 -0
- data/lib/paypal/invoice/invoice_item_list.rb +10 -0
- data/lib/paypal/invoice/invoice_summary.rb +22 -0
- data/lib/paypal/invoice/invoice_summary_list.rb +10 -0
- data/lib/paypal/invoice/other_payment_details.rb +13 -0
- data/lib/paypal/invoice/payment_details.rb +16 -0
- data/lib/paypal/invoice/paypal_payment_details.rb +11 -0
- data/lib/paypal/invoice/request.rb +43 -0
- data/lib/paypal/invoice/response.rb +27 -0
- data/lib/paypal/invoice/response/details.rb +23 -0
- data/lib/paypal/invoice/response/invoice.rb +10 -0
- data/lib/paypal/invoice/response/search.rb +15 -0
- data/lib/paypal/invoice/search.rb +19 -0
- data/lib/paypal/invoice/search_parameters.rb +20 -0
- data/lib/paypal/permissions.rb +12 -0
- data/lib/paypal/permissions/api.rb +60 -0
- data/lib/paypal/permissions/base.rb +11 -0
- data/lib/paypal/permissions/permission.rb +33 -0
- data/lib/paypal/permissions/personal_data.rb +17 -0
- data/lib/paypal/permissions/request.rb +52 -0
- data/lib/paypal/permissions/response.rb +24 -0
- data/lib/paypal/permissions/response/permission.rb +14 -0
- data/lib/paypal/permissions/response/personal_data.rb +8 -0
- data/lib/paypal/permissions/response/token.rb +10 -0
- data/lib/paypal/permissions/token.rb +13 -0
- data/lib/paypal/recurring.rb +110 -0
- data/lib/paypal/request.rb +82 -0
- data/lib/paypal/version.rb +8 -0
- data/paypal-payment.gemspec +30 -0
- data/spec/fixtures/adaptive_payments/payment/create/failure.yml +62 -0
- data/spec/fixtures/adaptive_payments/payment/create/success.yml +58 -0
- data/spec/fixtures/adaptive_payments/payment/details/success.yml +113 -0
- data/spec/fixtures/adaptive_payments/payment/pay/failure.yml +62 -0
- data/spec/fixtures/adaptive_payments/payment/pay/preapproval.yml +58 -0
- data/spec/fixtures/adaptive_payments/payment/pay/success.yml +58 -0
- data/spec/fixtures/adaptive_payments/payment/pay/with_pay_key.yml +58 -0
- data/spec/fixtures/adaptive_payments/payment/refund/failure.yml +62 -0
- data/spec/fixtures/adaptive_payments/payment/refund/success.yml +58 -0
- data/spec/fixtures/adaptive_payments/payment/shipping_addresses/success.yml +113 -0
- data/spec/fixtures/adaptive_payments/payment_options/get/success.yml +174 -0
- data/spec/fixtures/adaptive_payments/payment_options/set/success.yml +113 -0
- data/spec/fixtures/adaptive_payments/preapproval/create/success.yml +58 -0
- data/spec/fixtures/adaptive_payments/preapproval/details/success.yml +168 -0
- data/spec/fixtures/express_checkout/account/balance/success.yml +32 -0
- data/spec/fixtures/express_checkout/account/pal_details/success.yml +32 -0
- data/spec/fixtures/express_checkout/checkout/checkout/sales/success.yml +61 -0
- data/spec/fixtures/express_checkout/checkout/checkout/success.yml +32 -0
- data/spec/fixtures/express_checkout/checkout/details/failure.yml +32 -0
- data/spec/fixtures/express_checkout/checkout/details/success.yml +61 -0
- data/spec/fixtures/express_checkout/checkout/pay/sales/success.yml +61 -0
- data/spec/fixtures/express_checkout/checkout/pay/success.yml +61 -0
- data/spec/fixtures/express_checkout/payment/details/failure.yml +32 -0
- data/spec/fixtures/express_checkout/payment/details/success.yml +32 -0
- data/spec/fixtures/express_checkout/payment/refund/failure.yml +32 -0
- data/spec/fixtures/express_checkout/payment/refund/success.yml +32 -0
- data/spec/fixtures/express_checkout/payment/search/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/cancel/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/cancel/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/checkout/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/create_profile/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/create_profile/success.yml +61 -0
- data/spec/fixtures/express_checkout/recurring/profile/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/profile/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/reactivate/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/reactivate/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/suspend/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/suspend/success.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/update_profile/failure.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/update_profile/profile.yml +32 -0
- data/spec/fixtures/express_checkout/recurring/update_profile/success.yml +32 -0
- data/spec/fixtures/invoice/cancel/success.yml +174 -0
- data/spec/fixtures/invoice/create/failure.yml +62 -0
- data/spec/fixtures/invoice/create/success.yml +60 -0
- data/spec/fixtures/invoice/create_and_send/failure.yml +62 -0
- data/spec/fixtures/invoice/create_and_send/success.yml +60 -0
- data/spec/fixtures/invoice/details/success.yml +117 -0
- data/spec/fixtures/invoice/mark_as_paid/failure.yml +180 -0
- data/spec/fixtures/invoice/mark_as_paid/success.yml +174 -0
- data/spec/fixtures/invoice/mark_as_refunded/success.yml +174 -0
- data/spec/fixtures/invoice/mark_as_unpaid/success.yml +231 -0
- data/spec/fixtures/invoice/search/success.yml +174 -0
- data/spec/fixtures/invoice/send/success.yml +117 -0
- data/spec/fixtures/invoice/update/failure.yml +119 -0
- data/spec/fixtures/invoice/update/success.yml +117 -0
- data/spec/fixtures/ipn/express_checkout.json +35 -0
- data/spec/fixtures/ipn/recurring_payment.json +44 -0
- data/spec/fixtures/ipn/recurring_payment_profile_created.json +31 -0
- data/spec/fixtures/ipn/recurring_payment_profile_created_with_initial_amount.json +33 -0
- data/spec/fixtures/ipn/recurring_payment_skipped.json +30 -0
- data/spec/fixtures/ipn/recurring_payment_with_initial_amount.json +44 -0
- data/spec/fixtures/notification/failure.yml +50 -0
- data/spec/fixtures/notification/success.yml +50 -0
- data/spec/paypal/adaptive_payments/api_spec.rb +20 -0
- data/spec/paypal/adaptive_payments/payment/base_spec.rb +28 -0
- data/spec/paypal/adaptive_payments/payment/create_spec.rb +63 -0
- data/spec/paypal/adaptive_payments/payment/details_spec.rb +34 -0
- data/spec/paypal/adaptive_payments/payment/pay_spec.rb +97 -0
- data/spec/paypal/adaptive_payments/payment/refund_spec.rb +49 -0
- data/spec/paypal/adaptive_payments/payment/shipping_addresses_spec.rb +30 -0
- data/spec/paypal/adaptive_payments/payment_options/get_spec.rb +33 -0
- data/spec/paypal/adaptive_payments/payment_options/set_spec.rb +66 -0
- data/spec/paypal/adaptive_payments/preapproval/cancel_spec.rb +34 -0
- data/spec/paypal/adaptive_payments/preapproval/create_spec.rb +39 -0
- data/spec/paypal/adaptive_payments/preapproval/details_spec.rb +34 -0
- data/spec/paypal/adaptive_payments/request_spec.rb +48 -0
- data/spec/paypal/api_spec.rb +78 -0
- data/spec/paypal/common/base_spec.rb +157 -0
- data/spec/paypal/common/error_data_spec.rb +0 -0
- data/spec/paypal/common/request_envelope_spec.rb +6 -0
- data/spec/paypal/common/response_spec.rb +0 -0
- data/spec/paypal/express_checkout/account/balance_spec.rb +25 -0
- data/spec/paypal/express_checkout/account/pal_details_spec.rb +20 -0
- data/spec/paypal/express_checkout/checkout/checkout_spec.rb +73 -0
- data/spec/paypal/express_checkout/checkout/details_spec.rb +70 -0
- data/spec/paypal/express_checkout/checkout/pay_spec.rb +68 -0
- data/spec/paypal/express_checkout/fields_spec.rb +138 -0
- data/spec/paypal/express_checkout/payment/refund_spec.rb +34 -0
- data/spec/paypal/express_checkout/payment/search_spec.rb +24 -0
- data/spec/paypal/express_checkout/payment/transaction_details_spec.rb +30 -0
- data/spec/paypal/express_checkout/payment_spec.rb +13 -0
- data/spec/paypal/express_checkout/recurring/create_profile_spec.rb +50 -0
- data/spec/paypal/express_checkout/recurring/manage_profile_spec.rb +62 -0
- data/spec/paypal/express_checkout/recurring/profile_spec.rb +44 -0
- data/spec/paypal/express_checkout/recurring/update_profile_spec.rb +50 -0
- data/spec/paypal/express_checkout/request_spec.rb +221 -0
- data/spec/paypal/express_checkout/response/account_spec.rb +33 -0
- data/spec/paypal/express_checkout/response/base_spec.rb +253 -0
- data/spec/paypal/invoice/cancel_spec.rb +38 -0
- data/spec/paypal/invoice/create_and_send_spec.rb +58 -0
- data/spec/paypal/invoice/create_spec.rb +58 -0
- data/spec/paypal/invoice/details_spec.rb +39 -0
- data/spec/paypal/invoice/mark_as_paid_spec.rb +75 -0
- data/spec/paypal/invoice/mark_as_refunded_spec.rb +47 -0
- data/spec/paypal/invoice/mark_as_unpaid_spec.rb +43 -0
- data/spec/paypal/invoice/search_spec.rb +70 -0
- data/spec/paypal/invoice/send_spec.rb +48 -0
- data/spec/paypal/invoice/update_spec.rb +72 -0
- data/spec/paypal/request_spec.rb +45 -0
- data/spec/spec_helper.rb +35 -0
- metadata +546 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Invoice do
|
6
|
+
describe "#mark_as_paid" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/mark_as_paid/success"#, :record => :all
|
9
|
+
|
10
|
+
let(:invoice) {
|
11
|
+
PayPal::Invoice::Invoice.new(
|
12
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
13
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
14
|
+
:item_list => {
|
15
|
+
:item => [
|
16
|
+
{
|
17
|
+
:name => 'iPhone 5',
|
18
|
+
:quantity => 1,
|
19
|
+
:unit_price => 1000.0
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
:currency_code => 'USD',
|
24
|
+
:payment_terms => 'Net30'
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
before do
|
29
|
+
invoice.create_and_send
|
30
|
+
invoice.payment = OtherPaymentDetails.new({
|
31
|
+
:method => 'Cash',
|
32
|
+
:date => Date.today
|
33
|
+
})
|
34
|
+
end
|
35
|
+
|
36
|
+
subject { invoice.mark_as_paid }
|
37
|
+
|
38
|
+
its(:success?) { should be_true }
|
39
|
+
its(:valid?) { should be_true }
|
40
|
+
end
|
41
|
+
|
42
|
+
context "when failure" do
|
43
|
+
use_vcr_cassette "invoice/mark_as_paid/failure"#, :record => :all
|
44
|
+
|
45
|
+
let(:invoice) {
|
46
|
+
PayPal::Invoice::Invoice.new(
|
47
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
48
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
49
|
+
:item_list => {
|
50
|
+
:item => [
|
51
|
+
{
|
52
|
+
:name => 'iPhone 5',
|
53
|
+
:quantity => 1,
|
54
|
+
:unit_price => 1000.0
|
55
|
+
}
|
56
|
+
]
|
57
|
+
},
|
58
|
+
:currency_code => 'USD',
|
59
|
+
:payment_terms => 'Net30'
|
60
|
+
)
|
61
|
+
}
|
62
|
+
|
63
|
+
before do
|
64
|
+
invoice.create
|
65
|
+
invoice.payment = nil
|
66
|
+
end
|
67
|
+
|
68
|
+
subject { invoice.mark_as_paid }
|
69
|
+
|
70
|
+
its(:success?) { should be_false }
|
71
|
+
its(:valid?) { should be_false }
|
72
|
+
its(:errors) { should_not be_empty }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Invoice do
|
6
|
+
describe "#mark_as_refunded" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/mark_as_refunded/success"
|
9
|
+
|
10
|
+
let(:invoice) {
|
11
|
+
PayPal::Invoice::Invoice.new(
|
12
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
13
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
14
|
+
:item_list => {
|
15
|
+
:item => [
|
16
|
+
{
|
17
|
+
:name => 'iPhone 5',
|
18
|
+
:quantity => 1,
|
19
|
+
:unit_price => 1000.0
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
:currency_code => 'USD',
|
24
|
+
:payment_terms => 'Net30'
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
before do
|
29
|
+
invoice.create_and_send
|
30
|
+
invoice.payment = OtherPaymentDetails.new({
|
31
|
+
:method => 'Cash',
|
32
|
+
:date => Date.today
|
33
|
+
})
|
34
|
+
invoice.mark_as_paid
|
35
|
+
invoice.refund_detail = OtherPaymentDetails.new({
|
36
|
+
:note => 'Refunded',
|
37
|
+
:date => Date.today
|
38
|
+
})
|
39
|
+
end
|
40
|
+
|
41
|
+
subject { invoice.mark_as_refunded }
|
42
|
+
|
43
|
+
its(:success?) { should be_true }
|
44
|
+
its(:valid?) { should be_true }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Invoice do
|
6
|
+
describe "#mark_as_unpaid" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/mark_as_unpaid/success"#, :record => :all
|
9
|
+
|
10
|
+
let(:invoice) {
|
11
|
+
PayPal::Invoice::Invoice.new(
|
12
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
13
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
14
|
+
:item_list => {
|
15
|
+
:item => [
|
16
|
+
{
|
17
|
+
:name => 'iPhone 5',
|
18
|
+
:quantity => 1,
|
19
|
+
:unit_price => 1000.0
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
:currency_code => 'USD',
|
24
|
+
:payment_terms => 'Net30'
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
before do
|
29
|
+
invoice.create_and_send
|
30
|
+
invoice.payment = OtherPaymentDetails.new({
|
31
|
+
:method => 'Cash',
|
32
|
+
:date => Date.today
|
33
|
+
})
|
34
|
+
invoice.mark_as_paid
|
35
|
+
end
|
36
|
+
|
37
|
+
subject { invoice.mark_as_unpaid }
|
38
|
+
|
39
|
+
its(:success?) { should be_true }
|
40
|
+
its(:valid?) { should be_true }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Search do
|
6
|
+
describe "#search" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/search/success"#, :record => :all
|
9
|
+
|
10
|
+
before do
|
11
|
+
invoice_1.create
|
12
|
+
invoice_2.create
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:invoice_1) {
|
16
|
+
PayPal::Invoice::Invoice.new(
|
17
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
18
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
19
|
+
:item_list => {
|
20
|
+
:item => [
|
21
|
+
{
|
22
|
+
:name => 'iPhone 5',
|
23
|
+
:quantity => 1,
|
24
|
+
:unit_price => 1000.0
|
25
|
+
}
|
26
|
+
]
|
27
|
+
},
|
28
|
+
:currency_code => 'USD',
|
29
|
+
:payment_terms => 'Net30'
|
30
|
+
)
|
31
|
+
}
|
32
|
+
let(:invoice_2) {
|
33
|
+
PayPal::Invoice::Invoice.new(
|
34
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
35
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
36
|
+
:item_list => {
|
37
|
+
:item => [
|
38
|
+
{
|
39
|
+
:name => 'iPad mini',
|
40
|
+
:quantity => 2,
|
41
|
+
:unit_price => 300.0
|
42
|
+
}
|
43
|
+
]
|
44
|
+
},
|
45
|
+
:currency_code => 'AUD',
|
46
|
+
:payment_terms => 'Net10'
|
47
|
+
)
|
48
|
+
}
|
49
|
+
let(:search) {
|
50
|
+
PayPal::Invoice::Search.new(
|
51
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
52
|
+
:parameters => {
|
53
|
+
:currency_code => 'AUD'
|
54
|
+
},
|
55
|
+
:page => 1,
|
56
|
+
:page_size => 10
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
subject { search.search }
|
62
|
+
|
63
|
+
it "invoice_list should include the right invoice" do
|
64
|
+
subject.invoice_list.invoice.first.invoice_id.should eql(invoice_2.invoice_id)
|
65
|
+
end
|
66
|
+
its(:success?) { should be_true }
|
67
|
+
its(:valid?) { should be_true }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Invoice do
|
6
|
+
describe "#send_invoice" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/send/success"#, :record => :all
|
9
|
+
|
10
|
+
let(:invoice) {
|
11
|
+
PayPal::Invoice::Invoice.new(
|
12
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
13
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
14
|
+
:item_list => {
|
15
|
+
:item => [
|
16
|
+
{
|
17
|
+
:name => 'iPhone 5',
|
18
|
+
:quantity => 1,
|
19
|
+
:unit_price => 1000.0
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
:currency_code => 'USD',
|
24
|
+
:payment_terms => 'Net30'
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
before { invoice.create }
|
29
|
+
|
30
|
+
subject { invoice.send_invoice }
|
31
|
+
|
32
|
+
its(:success?) { should be_true }
|
33
|
+
its(:valid?) { should be_true }
|
34
|
+
end
|
35
|
+
|
36
|
+
# context "when failure" do
|
37
|
+
# use_vcr_cassette "invoice/send/failure"#, :record => :all
|
38
|
+
|
39
|
+
# subject { invoice.send }
|
40
|
+
|
41
|
+
# before { subject }
|
42
|
+
|
43
|
+
# its(:success?) { should be_false }
|
44
|
+
# its(:valid?) { should be_false }
|
45
|
+
# its(:errors) { should_not be_empty }
|
46
|
+
# end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include PayPal::Invoice
|
4
|
+
|
5
|
+
describe PayPal::Invoice::Invoice do
|
6
|
+
describe "#update" do
|
7
|
+
context "when successful" do
|
8
|
+
use_vcr_cassette "invoice/update/success"#, :record => :all
|
9
|
+
|
10
|
+
let(:invoice) {
|
11
|
+
PayPal::Invoice::Invoice.new(
|
12
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
13
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
14
|
+
:item_list => {
|
15
|
+
:item => [
|
16
|
+
{
|
17
|
+
:name => 'iPhone 5',
|
18
|
+
:quantity => 1,
|
19
|
+
:unit_price => 1000.0
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
:currency_code => 'USD',
|
24
|
+
:payment_terms => 'Net30'
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
before do
|
29
|
+
invoice.create
|
30
|
+
invoice.payment_terms = 'Net10'
|
31
|
+
end
|
32
|
+
|
33
|
+
subject { invoice.update }
|
34
|
+
|
35
|
+
its(:success?) { should be_true }
|
36
|
+
its(:valid?) { should be_true }
|
37
|
+
end
|
38
|
+
|
39
|
+
context "when failure" do
|
40
|
+
use_vcr_cassette "invoice/update/failure"#, :record => :all
|
41
|
+
|
42
|
+
let(:invoice) {
|
43
|
+
PayPal::Invoice::Invoice.new(
|
44
|
+
:merchant_email => 'chardy_1345003248_per@gmail.com',
|
45
|
+
:payer_email => 'chardy_1345003165_per@gmail.com',
|
46
|
+
:item_list => {
|
47
|
+
:item => [
|
48
|
+
{
|
49
|
+
:name => 'iPhone 5',
|
50
|
+
:quantity => 1,
|
51
|
+
:unit_price => 1000.0
|
52
|
+
}
|
53
|
+
]
|
54
|
+
},
|
55
|
+
:currency_code => 'USD',
|
56
|
+
:payment_terms => 'Net30'
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
before do
|
61
|
+
invoice.create
|
62
|
+
invoice.payment_terms = nil
|
63
|
+
end
|
64
|
+
|
65
|
+
subject { invoice.update }
|
66
|
+
|
67
|
+
its(:success?) { should be_false }
|
68
|
+
its(:valid?) { should be_false }
|
69
|
+
its(:errors) { should_not be_empty }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe PayPal::Request do
|
4
|
+
describe "#post" do
|
5
|
+
before :all do
|
6
|
+
VCR.eject_cassette
|
7
|
+
VCR.turn_off!
|
8
|
+
end
|
9
|
+
|
10
|
+
after :all do
|
11
|
+
VCR.turn_on!
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:uri) { "https://api-3t.sandbox.paypal.com/nvp" }
|
15
|
+
let(:username) { "test@api.com" }
|
16
|
+
let(:password) { "testpassword" }
|
17
|
+
|
18
|
+
before do
|
19
|
+
subject.uri = uri
|
20
|
+
end
|
21
|
+
|
22
|
+
it "verifies certificate" do
|
23
|
+
stub_request(:post, uri).to_return(:status => 200, :body => "", :headers => {})
|
24
|
+
Curl::Easy.any_instance.should_receive(:ssl_verify_host=).with(true)
|
25
|
+
Curl::Easy.any_instance.should_receive(:ssl_verify_peer=).with(true)
|
26
|
+
subject.post
|
27
|
+
end
|
28
|
+
|
29
|
+
it "sets cacert" do
|
30
|
+
stub_request(:post, uri).to_return(:status => 200, :body => "", :headers => {})
|
31
|
+
Curl::Easy.any_instance.should_receive(:cacert=).with(File.expand_path("../../../lib/paypal/cacert.pem", __FILE__))
|
32
|
+
subject.post
|
33
|
+
end
|
34
|
+
|
35
|
+
it "sets body" do
|
36
|
+
stub_request(:post, uri).with(:body => 'AMT=10.00')
|
37
|
+
subject.post({'AMT' => '10.00'})
|
38
|
+
end
|
39
|
+
|
40
|
+
it "sets headers" do
|
41
|
+
stub_request(:post, uri).with(:headers => {'X-PAYPAL-SECURITY-USERID' => username})
|
42
|
+
subject.post({}, {'X-PAYPAL-SECURITY-USERID' => username})
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "bundler"
|
2
|
+
Bundler.setup(:default, :development)
|
3
|
+
Bundler.require
|
4
|
+
|
5
|
+
require "paypal-payment"
|
6
|
+
require "vcr"
|
7
|
+
require "webmock/rspec"
|
8
|
+
|
9
|
+
VCR.configure do |config|
|
10
|
+
config.cassette_library_dir = File.dirname(__FILE__) + "/fixtures"
|
11
|
+
config.hook_into :webmock
|
12
|
+
config.default_cassette_options = { :serialize_with => :syck }
|
13
|
+
end
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
config.extend VCR::RSpec::Macros
|
17
|
+
|
18
|
+
config.before do
|
19
|
+
PayPal::Api.configure do |config|
|
20
|
+
config.sandbox = true
|
21
|
+
config.username = "chardy_api1.gmail.com"
|
22
|
+
config.password = "8DTSWBZC7GDR3T4X"
|
23
|
+
config.signature = "AG-8mOpuFhFyFOYHlaTUYn3Syf15AWJKRnfHMVsmCtC3DK51-ENEPqLS"
|
24
|
+
config.seller_id = "GCK9DAQBWTUHQ"
|
25
|
+
config.email = "chardy_1345003248_per@gmail.com"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class MockResponse
|
31
|
+
attr_accessor :body_str
|
32
|
+
def initialize(body)
|
33
|
+
self.body_str = body
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,546 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paypal-payment
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chardy Wang
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: curb
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: multi_json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: vcr
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: fakeweb
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: pry
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: awesome_print
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: activesupport
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
description: PayPal Client.
|
159
|
+
email:
|
160
|
+
- chardy@gmail.com
|
161
|
+
executables: []
|
162
|
+
extensions: []
|
163
|
+
extra_rdoc_files: []
|
164
|
+
files:
|
165
|
+
- .gitignore
|
166
|
+
- .rspec
|
167
|
+
- Gemfile
|
168
|
+
- Guardfile
|
169
|
+
- README.rdoc
|
170
|
+
- Rakefile
|
171
|
+
- docs/AdaptivePayments.rdoc
|
172
|
+
- docs/PP_NVPAPI_DeveloperGuide.pdf
|
173
|
+
- docs/PP_WPP_IntegrationGuide.pdf
|
174
|
+
- docs/adaptive_payments.md
|
175
|
+
- docs/api.txt
|
176
|
+
- docs/design.txt
|
177
|
+
- docs/express_checkout.md
|
178
|
+
- docs/requirements.txt
|
179
|
+
- lib/paypal-payment.rb
|
180
|
+
- lib/paypal/adaptive_payments.rb
|
181
|
+
- lib/paypal/adaptive_payments/api.rb
|
182
|
+
- lib/paypal/adaptive_payments/base.rb
|
183
|
+
- lib/paypal/adaptive_payments/client_details.rb
|
184
|
+
- lib/paypal/adaptive_payments/display_options.rb
|
185
|
+
- lib/paypal/adaptive_payments/funding_constraint.rb
|
186
|
+
- lib/paypal/adaptive_payments/funding_type_info.rb
|
187
|
+
- lib/paypal/adaptive_payments/funding_type_list.rb
|
188
|
+
- lib/paypal/adaptive_payments/initiating_entity.rb
|
189
|
+
- lib/paypal/adaptive_payments/institution_customer.rb
|
190
|
+
- lib/paypal/adaptive_payments/invoice_data.rb
|
191
|
+
- lib/paypal/adaptive_payments/invoice_item.rb
|
192
|
+
- lib/paypal/adaptive_payments/payment.rb
|
193
|
+
- lib/paypal/adaptive_payments/payment_info.rb
|
194
|
+
- lib/paypal/adaptive_payments/payment_info_list.rb
|
195
|
+
- lib/paypal/adaptive_payments/payment_options.rb
|
196
|
+
- lib/paypal/adaptive_payments/phone.rb
|
197
|
+
- lib/paypal/adaptive_payments/preapproval.rb
|
198
|
+
- lib/paypal/adaptive_payments/receiver.rb
|
199
|
+
- lib/paypal/adaptive_payments/receiver_list.rb
|
200
|
+
- lib/paypal/adaptive_payments/receiver_options.rb
|
201
|
+
- lib/paypal/adaptive_payments/request.rb
|
202
|
+
- lib/paypal/adaptive_payments/response.rb
|
203
|
+
- lib/paypal/adaptive_payments/response/address.rb
|
204
|
+
- lib/paypal/adaptive_payments/response/address_list.rb
|
205
|
+
- lib/paypal/adaptive_payments/response/base_address.rb
|
206
|
+
- lib/paypal/adaptive_payments/response/details.rb
|
207
|
+
- lib/paypal/adaptive_payments/response/error_list.rb
|
208
|
+
- lib/paypal/adaptive_payments/response/pay.rb
|
209
|
+
- lib/paypal/adaptive_payments/response/pay_error.rb
|
210
|
+
- lib/paypal/adaptive_payments/response/pay_error_list.rb
|
211
|
+
- lib/paypal/adaptive_payments/response/pay_options.rb
|
212
|
+
- lib/paypal/adaptive_payments/response/preapproval.rb
|
213
|
+
- lib/paypal/adaptive_payments/response/refund.rb
|
214
|
+
- lib/paypal/adaptive_payments/response/refund_info.rb
|
215
|
+
- lib/paypal/adaptive_payments/response/refund_info_list.rb
|
216
|
+
- lib/paypal/adaptive_payments/response/shipping_address.rb
|
217
|
+
- lib/paypal/adaptive_payments/sender_identifier.rb
|
218
|
+
- lib/paypal/adaptive_payments/sender_options.rb
|
219
|
+
- lib/paypal/api.rb
|
220
|
+
- lib/paypal/cacert.pem
|
221
|
+
- lib/paypal/common.rb
|
222
|
+
- lib/paypal/common/base.rb
|
223
|
+
- lib/paypal/common/error_data.rb
|
224
|
+
- lib/paypal/common/request.rb
|
225
|
+
- lib/paypal/common/request_envelope.rb
|
226
|
+
- lib/paypal/common/response.rb
|
227
|
+
- lib/paypal/common/response_envelope.rb
|
228
|
+
- lib/paypal/express_checkout.rb
|
229
|
+
- lib/paypal/express_checkout/account.rb
|
230
|
+
- lib/paypal/express_checkout/api.rb
|
231
|
+
- lib/paypal/express_checkout/base.rb
|
232
|
+
- lib/paypal/express_checkout/billing.rb
|
233
|
+
- lib/paypal/express_checkout/callback.rb
|
234
|
+
- lib/paypal/express_checkout/checkout.rb
|
235
|
+
- lib/paypal/express_checkout/fields.rb
|
236
|
+
- lib/paypal/express_checkout/fmf.rb
|
237
|
+
- lib/paypal/express_checkout/payment.rb
|
238
|
+
- lib/paypal/express_checkout/payment_item.rb
|
239
|
+
- lib/paypal/express_checkout/recurring.rb
|
240
|
+
- lib/paypal/express_checkout/request.rb
|
241
|
+
- lib/paypal/express_checkout/response.rb
|
242
|
+
- lib/paypal/express_checkout/response/account.rb
|
243
|
+
- lib/paypal/express_checkout/response/address.rb
|
244
|
+
- lib/paypal/express_checkout/response/authorization.rb
|
245
|
+
- lib/paypal/express_checkout/response/base.rb
|
246
|
+
- lib/paypal/express_checkout/response/callback_request.rb
|
247
|
+
- lib/paypal/express_checkout/response/callback_response.rb
|
248
|
+
- lib/paypal/express_checkout/response/capture.rb
|
249
|
+
- lib/paypal/express_checkout/response/checkout.rb
|
250
|
+
- lib/paypal/express_checkout/response/details.rb
|
251
|
+
- lib/paypal/express_checkout/response/manage_profile.rb
|
252
|
+
- lib/paypal/express_checkout/response/notification.rb
|
253
|
+
- lib/paypal/express_checkout/response/payment.rb
|
254
|
+
- lib/paypal/express_checkout/response/profile.rb
|
255
|
+
- lib/paypal/express_checkout/response/reference.rb
|
256
|
+
- lib/paypal/express_checkout/response/refund.rb
|
257
|
+
- lib/paypal/express_checkout/response/search.rb
|
258
|
+
- lib/paypal/express_checkout/response/transaction_details.rb
|
259
|
+
- lib/paypal/express_checkout/shipping_option.rb
|
260
|
+
- lib/paypal/express_checkout/utils.rb
|
261
|
+
- lib/paypal/express_checkout/version.rb
|
262
|
+
- lib/paypal/invoice.rb
|
263
|
+
- lib/paypal/invoice/api.rb
|
264
|
+
- lib/paypal/invoice/base.rb
|
265
|
+
- lib/paypal/invoice/base_address.rb
|
266
|
+
- lib/paypal/invoice/business_info.rb
|
267
|
+
- lib/paypal/invoice/date_range.rb
|
268
|
+
- lib/paypal/invoice/invoice.rb
|
269
|
+
- lib/paypal/invoice/invoice_details.rb
|
270
|
+
- lib/paypal/invoice/invoice_item.rb
|
271
|
+
- lib/paypal/invoice/invoice_item_list.rb
|
272
|
+
- lib/paypal/invoice/invoice_summary.rb
|
273
|
+
- lib/paypal/invoice/invoice_summary_list.rb
|
274
|
+
- lib/paypal/invoice/other_payment_details.rb
|
275
|
+
- lib/paypal/invoice/payment_details.rb
|
276
|
+
- lib/paypal/invoice/paypal_payment_details.rb
|
277
|
+
- lib/paypal/invoice/request.rb
|
278
|
+
- lib/paypal/invoice/response.rb
|
279
|
+
- lib/paypal/invoice/response/details.rb
|
280
|
+
- lib/paypal/invoice/response/invoice.rb
|
281
|
+
- lib/paypal/invoice/response/search.rb
|
282
|
+
- lib/paypal/invoice/search.rb
|
283
|
+
- lib/paypal/invoice/search_parameters.rb
|
284
|
+
- lib/paypal/permissions.rb
|
285
|
+
- lib/paypal/permissions/api.rb
|
286
|
+
- lib/paypal/permissions/base.rb
|
287
|
+
- lib/paypal/permissions/permission.rb
|
288
|
+
- lib/paypal/permissions/personal_data.rb
|
289
|
+
- lib/paypal/permissions/request.rb
|
290
|
+
- lib/paypal/permissions/response.rb
|
291
|
+
- lib/paypal/permissions/response/permission.rb
|
292
|
+
- lib/paypal/permissions/response/personal_data.rb
|
293
|
+
- lib/paypal/permissions/response/token.rb
|
294
|
+
- lib/paypal/permissions/token.rb
|
295
|
+
- lib/paypal/recurring.rb
|
296
|
+
- lib/paypal/request.rb
|
297
|
+
- lib/paypal/version.rb
|
298
|
+
- paypal-payment.gemspec
|
299
|
+
- spec/fixtures/adaptive_payments/payment/create/failure.yml
|
300
|
+
- spec/fixtures/adaptive_payments/payment/create/success.yml
|
301
|
+
- spec/fixtures/adaptive_payments/payment/details/success.yml
|
302
|
+
- spec/fixtures/adaptive_payments/payment/pay/failure.yml
|
303
|
+
- spec/fixtures/adaptive_payments/payment/pay/preapproval.yml
|
304
|
+
- spec/fixtures/adaptive_payments/payment/pay/success.yml
|
305
|
+
- spec/fixtures/adaptive_payments/payment/pay/with_pay_key.yml
|
306
|
+
- spec/fixtures/adaptive_payments/payment/refund/failure.yml
|
307
|
+
- spec/fixtures/adaptive_payments/payment/refund/success.yml
|
308
|
+
- spec/fixtures/adaptive_payments/payment/shipping_addresses/success.yml
|
309
|
+
- spec/fixtures/adaptive_payments/payment_options/get/success.yml
|
310
|
+
- spec/fixtures/adaptive_payments/payment_options/set/success.yml
|
311
|
+
- spec/fixtures/adaptive_payments/preapproval/create/success.yml
|
312
|
+
- spec/fixtures/adaptive_payments/preapproval/details/success.yml
|
313
|
+
- spec/fixtures/express_checkout/account/balance/success.yml
|
314
|
+
- spec/fixtures/express_checkout/account/pal_details/success.yml
|
315
|
+
- spec/fixtures/express_checkout/checkout/checkout/sales/success.yml
|
316
|
+
- spec/fixtures/express_checkout/checkout/checkout/success.yml
|
317
|
+
- spec/fixtures/express_checkout/checkout/details/failure.yml
|
318
|
+
- spec/fixtures/express_checkout/checkout/details/success.yml
|
319
|
+
- spec/fixtures/express_checkout/checkout/pay/sales/success.yml
|
320
|
+
- spec/fixtures/express_checkout/checkout/pay/success.yml
|
321
|
+
- spec/fixtures/express_checkout/payment/details/failure.yml
|
322
|
+
- spec/fixtures/express_checkout/payment/details/success.yml
|
323
|
+
- spec/fixtures/express_checkout/payment/refund/failure.yml
|
324
|
+
- spec/fixtures/express_checkout/payment/refund/success.yml
|
325
|
+
- spec/fixtures/express_checkout/payment/search/success.yml
|
326
|
+
- spec/fixtures/express_checkout/recurring/cancel/failure.yml
|
327
|
+
- spec/fixtures/express_checkout/recurring/cancel/success.yml
|
328
|
+
- spec/fixtures/express_checkout/recurring/checkout/success.yml
|
329
|
+
- spec/fixtures/express_checkout/recurring/create_profile/failure.yml
|
330
|
+
- spec/fixtures/express_checkout/recurring/create_profile/success.yml
|
331
|
+
- spec/fixtures/express_checkout/recurring/profile/failure.yml
|
332
|
+
- spec/fixtures/express_checkout/recurring/profile/success.yml
|
333
|
+
- spec/fixtures/express_checkout/recurring/reactivate/failure.yml
|
334
|
+
- spec/fixtures/express_checkout/recurring/reactivate/success.yml
|
335
|
+
- spec/fixtures/express_checkout/recurring/suspend/failure.yml
|
336
|
+
- spec/fixtures/express_checkout/recurring/suspend/success.yml
|
337
|
+
- spec/fixtures/express_checkout/recurring/update_profile/failure.yml
|
338
|
+
- spec/fixtures/express_checkout/recurring/update_profile/profile.yml
|
339
|
+
- spec/fixtures/express_checkout/recurring/update_profile/success.yml
|
340
|
+
- spec/fixtures/invoice/cancel/success.yml
|
341
|
+
- spec/fixtures/invoice/create/failure.yml
|
342
|
+
- spec/fixtures/invoice/create/success.yml
|
343
|
+
- spec/fixtures/invoice/create_and_send/failure.yml
|
344
|
+
- spec/fixtures/invoice/create_and_send/success.yml
|
345
|
+
- spec/fixtures/invoice/details/success.yml
|
346
|
+
- spec/fixtures/invoice/mark_as_paid/failure.yml
|
347
|
+
- spec/fixtures/invoice/mark_as_paid/success.yml
|
348
|
+
- spec/fixtures/invoice/mark_as_refunded/success.yml
|
349
|
+
- spec/fixtures/invoice/mark_as_unpaid/success.yml
|
350
|
+
- spec/fixtures/invoice/search/success.yml
|
351
|
+
- spec/fixtures/invoice/send/success.yml
|
352
|
+
- spec/fixtures/invoice/update/failure.yml
|
353
|
+
- spec/fixtures/invoice/update/success.yml
|
354
|
+
- spec/fixtures/ipn/express_checkout.json
|
355
|
+
- spec/fixtures/ipn/recurring_payment.json
|
356
|
+
- spec/fixtures/ipn/recurring_payment_profile_created.json
|
357
|
+
- spec/fixtures/ipn/recurring_payment_profile_created_with_initial_amount.json
|
358
|
+
- spec/fixtures/ipn/recurring_payment_skipped.json
|
359
|
+
- spec/fixtures/ipn/recurring_payment_with_initial_amount.json
|
360
|
+
- spec/fixtures/notification/failure.yml
|
361
|
+
- spec/fixtures/notification/success.yml
|
362
|
+
- spec/paypal/adaptive_payments/api_spec.rb
|
363
|
+
- spec/paypal/adaptive_payments/payment/base_spec.rb
|
364
|
+
- spec/paypal/adaptive_payments/payment/create_spec.rb
|
365
|
+
- spec/paypal/adaptive_payments/payment/details_spec.rb
|
366
|
+
- spec/paypal/adaptive_payments/payment/pay_spec.rb
|
367
|
+
- spec/paypal/adaptive_payments/payment/refund_spec.rb
|
368
|
+
- spec/paypal/adaptive_payments/payment/shipping_addresses_spec.rb
|
369
|
+
- spec/paypal/adaptive_payments/payment_options/get_spec.rb
|
370
|
+
- spec/paypal/adaptive_payments/payment_options/set_spec.rb
|
371
|
+
- spec/paypal/adaptive_payments/preapproval/cancel_spec.rb
|
372
|
+
- spec/paypal/adaptive_payments/preapproval/create_spec.rb
|
373
|
+
- spec/paypal/adaptive_payments/preapproval/details_spec.rb
|
374
|
+
- spec/paypal/adaptive_payments/request_spec.rb
|
375
|
+
- spec/paypal/api_spec.rb
|
376
|
+
- spec/paypal/common/base_spec.rb
|
377
|
+
- spec/paypal/common/error_data_spec.rb
|
378
|
+
- spec/paypal/common/request_envelope_spec.rb
|
379
|
+
- spec/paypal/common/response_spec.rb
|
380
|
+
- spec/paypal/express_checkout/account/balance_spec.rb
|
381
|
+
- spec/paypal/express_checkout/account/pal_details_spec.rb
|
382
|
+
- spec/paypal/express_checkout/checkout/checkout_spec.rb
|
383
|
+
- spec/paypal/express_checkout/checkout/details_spec.rb
|
384
|
+
- spec/paypal/express_checkout/checkout/pay_spec.rb
|
385
|
+
- spec/paypal/express_checkout/fields_spec.rb
|
386
|
+
- spec/paypal/express_checkout/payment/refund_spec.rb
|
387
|
+
- spec/paypal/express_checkout/payment/search_spec.rb
|
388
|
+
- spec/paypal/express_checkout/payment/transaction_details_spec.rb
|
389
|
+
- spec/paypal/express_checkout/payment_spec.rb
|
390
|
+
- spec/paypal/express_checkout/recurring/create_profile_spec.rb
|
391
|
+
- spec/paypal/express_checkout/recurring/manage_profile_spec.rb
|
392
|
+
- spec/paypal/express_checkout/recurring/profile_spec.rb
|
393
|
+
- spec/paypal/express_checkout/recurring/update_profile_spec.rb
|
394
|
+
- spec/paypal/express_checkout/request_spec.rb
|
395
|
+
- spec/paypal/express_checkout/response/account_spec.rb
|
396
|
+
- spec/paypal/express_checkout/response/base_spec.rb
|
397
|
+
- spec/paypal/invoice/cancel_spec.rb
|
398
|
+
- spec/paypal/invoice/create_and_send_spec.rb
|
399
|
+
- spec/paypal/invoice/create_spec.rb
|
400
|
+
- spec/paypal/invoice/details_spec.rb
|
401
|
+
- spec/paypal/invoice/mark_as_paid_spec.rb
|
402
|
+
- spec/paypal/invoice/mark_as_refunded_spec.rb
|
403
|
+
- spec/paypal/invoice/mark_as_unpaid_spec.rb
|
404
|
+
- spec/paypal/invoice/search_spec.rb
|
405
|
+
- spec/paypal/invoice/send_spec.rb
|
406
|
+
- spec/paypal/invoice/update_spec.rb
|
407
|
+
- spec/paypal/request_spec.rb
|
408
|
+
- spec/spec_helper.rb
|
409
|
+
homepage: http://rubygems.org/gems/paypal-payment
|
410
|
+
licenses: []
|
411
|
+
post_install_message:
|
412
|
+
rdoc_options: []
|
413
|
+
require_paths:
|
414
|
+
- lib
|
415
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
416
|
+
none: false
|
417
|
+
requirements:
|
418
|
+
- - ! '>='
|
419
|
+
- !ruby/object:Gem::Version
|
420
|
+
version: '0'
|
421
|
+
segments:
|
422
|
+
- 0
|
423
|
+
hash: 3024378596211179062
|
424
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
425
|
+
none: false
|
426
|
+
requirements:
|
427
|
+
- - ! '>='
|
428
|
+
- !ruby/object:Gem::Version
|
429
|
+
version: '0'
|
430
|
+
requirements: []
|
431
|
+
rubyforge_project:
|
432
|
+
rubygems_version: 1.8.23
|
433
|
+
signing_key:
|
434
|
+
specification_version: 3
|
435
|
+
summary: PayPal Client.
|
436
|
+
test_files:
|
437
|
+
- spec/fixtures/adaptive_payments/payment/create/failure.yml
|
438
|
+
- spec/fixtures/adaptive_payments/payment/create/success.yml
|
439
|
+
- spec/fixtures/adaptive_payments/payment/details/success.yml
|
440
|
+
- spec/fixtures/adaptive_payments/payment/pay/failure.yml
|
441
|
+
- spec/fixtures/adaptive_payments/payment/pay/preapproval.yml
|
442
|
+
- spec/fixtures/adaptive_payments/payment/pay/success.yml
|
443
|
+
- spec/fixtures/adaptive_payments/payment/pay/with_pay_key.yml
|
444
|
+
- spec/fixtures/adaptive_payments/payment/refund/failure.yml
|
445
|
+
- spec/fixtures/adaptive_payments/payment/refund/success.yml
|
446
|
+
- spec/fixtures/adaptive_payments/payment/shipping_addresses/success.yml
|
447
|
+
- spec/fixtures/adaptive_payments/payment_options/get/success.yml
|
448
|
+
- spec/fixtures/adaptive_payments/payment_options/set/success.yml
|
449
|
+
- spec/fixtures/adaptive_payments/preapproval/create/success.yml
|
450
|
+
- spec/fixtures/adaptive_payments/preapproval/details/success.yml
|
451
|
+
- spec/fixtures/express_checkout/account/balance/success.yml
|
452
|
+
- spec/fixtures/express_checkout/account/pal_details/success.yml
|
453
|
+
- spec/fixtures/express_checkout/checkout/checkout/sales/success.yml
|
454
|
+
- spec/fixtures/express_checkout/checkout/checkout/success.yml
|
455
|
+
- spec/fixtures/express_checkout/checkout/details/failure.yml
|
456
|
+
- spec/fixtures/express_checkout/checkout/details/success.yml
|
457
|
+
- spec/fixtures/express_checkout/checkout/pay/sales/success.yml
|
458
|
+
- spec/fixtures/express_checkout/checkout/pay/success.yml
|
459
|
+
- spec/fixtures/express_checkout/payment/details/failure.yml
|
460
|
+
- spec/fixtures/express_checkout/payment/details/success.yml
|
461
|
+
- spec/fixtures/express_checkout/payment/refund/failure.yml
|
462
|
+
- spec/fixtures/express_checkout/payment/refund/success.yml
|
463
|
+
- spec/fixtures/express_checkout/payment/search/success.yml
|
464
|
+
- spec/fixtures/express_checkout/recurring/cancel/failure.yml
|
465
|
+
- spec/fixtures/express_checkout/recurring/cancel/success.yml
|
466
|
+
- spec/fixtures/express_checkout/recurring/checkout/success.yml
|
467
|
+
- spec/fixtures/express_checkout/recurring/create_profile/failure.yml
|
468
|
+
- spec/fixtures/express_checkout/recurring/create_profile/success.yml
|
469
|
+
- spec/fixtures/express_checkout/recurring/profile/failure.yml
|
470
|
+
- spec/fixtures/express_checkout/recurring/profile/success.yml
|
471
|
+
- spec/fixtures/express_checkout/recurring/reactivate/failure.yml
|
472
|
+
- spec/fixtures/express_checkout/recurring/reactivate/success.yml
|
473
|
+
- spec/fixtures/express_checkout/recurring/suspend/failure.yml
|
474
|
+
- spec/fixtures/express_checkout/recurring/suspend/success.yml
|
475
|
+
- spec/fixtures/express_checkout/recurring/update_profile/failure.yml
|
476
|
+
- spec/fixtures/express_checkout/recurring/update_profile/profile.yml
|
477
|
+
- spec/fixtures/express_checkout/recurring/update_profile/success.yml
|
478
|
+
- spec/fixtures/invoice/cancel/success.yml
|
479
|
+
- spec/fixtures/invoice/create/failure.yml
|
480
|
+
- spec/fixtures/invoice/create/success.yml
|
481
|
+
- spec/fixtures/invoice/create_and_send/failure.yml
|
482
|
+
- spec/fixtures/invoice/create_and_send/success.yml
|
483
|
+
- spec/fixtures/invoice/details/success.yml
|
484
|
+
- spec/fixtures/invoice/mark_as_paid/failure.yml
|
485
|
+
- spec/fixtures/invoice/mark_as_paid/success.yml
|
486
|
+
- spec/fixtures/invoice/mark_as_refunded/success.yml
|
487
|
+
- spec/fixtures/invoice/mark_as_unpaid/success.yml
|
488
|
+
- spec/fixtures/invoice/search/success.yml
|
489
|
+
- spec/fixtures/invoice/send/success.yml
|
490
|
+
- spec/fixtures/invoice/update/failure.yml
|
491
|
+
- spec/fixtures/invoice/update/success.yml
|
492
|
+
- spec/fixtures/ipn/express_checkout.json
|
493
|
+
- spec/fixtures/ipn/recurring_payment.json
|
494
|
+
- spec/fixtures/ipn/recurring_payment_profile_created.json
|
495
|
+
- spec/fixtures/ipn/recurring_payment_profile_created_with_initial_amount.json
|
496
|
+
- spec/fixtures/ipn/recurring_payment_skipped.json
|
497
|
+
- spec/fixtures/ipn/recurring_payment_with_initial_amount.json
|
498
|
+
- spec/fixtures/notification/failure.yml
|
499
|
+
- spec/fixtures/notification/success.yml
|
500
|
+
- spec/paypal/adaptive_payments/api_spec.rb
|
501
|
+
- spec/paypal/adaptive_payments/payment/base_spec.rb
|
502
|
+
- spec/paypal/adaptive_payments/payment/create_spec.rb
|
503
|
+
- spec/paypal/adaptive_payments/payment/details_spec.rb
|
504
|
+
- spec/paypal/adaptive_payments/payment/pay_spec.rb
|
505
|
+
- spec/paypal/adaptive_payments/payment/refund_spec.rb
|
506
|
+
- spec/paypal/adaptive_payments/payment/shipping_addresses_spec.rb
|
507
|
+
- spec/paypal/adaptive_payments/payment_options/get_spec.rb
|
508
|
+
- spec/paypal/adaptive_payments/payment_options/set_spec.rb
|
509
|
+
- spec/paypal/adaptive_payments/preapproval/cancel_spec.rb
|
510
|
+
- spec/paypal/adaptive_payments/preapproval/create_spec.rb
|
511
|
+
- spec/paypal/adaptive_payments/preapproval/details_spec.rb
|
512
|
+
- spec/paypal/adaptive_payments/request_spec.rb
|
513
|
+
- spec/paypal/api_spec.rb
|
514
|
+
- spec/paypal/common/base_spec.rb
|
515
|
+
- spec/paypal/common/error_data_spec.rb
|
516
|
+
- spec/paypal/common/request_envelope_spec.rb
|
517
|
+
- spec/paypal/common/response_spec.rb
|
518
|
+
- spec/paypal/express_checkout/account/balance_spec.rb
|
519
|
+
- spec/paypal/express_checkout/account/pal_details_spec.rb
|
520
|
+
- spec/paypal/express_checkout/checkout/checkout_spec.rb
|
521
|
+
- spec/paypal/express_checkout/checkout/details_spec.rb
|
522
|
+
- spec/paypal/express_checkout/checkout/pay_spec.rb
|
523
|
+
- spec/paypal/express_checkout/fields_spec.rb
|
524
|
+
- spec/paypal/express_checkout/payment/refund_spec.rb
|
525
|
+
- spec/paypal/express_checkout/payment/search_spec.rb
|
526
|
+
- spec/paypal/express_checkout/payment/transaction_details_spec.rb
|
527
|
+
- spec/paypal/express_checkout/payment_spec.rb
|
528
|
+
- spec/paypal/express_checkout/recurring/create_profile_spec.rb
|
529
|
+
- spec/paypal/express_checkout/recurring/manage_profile_spec.rb
|
530
|
+
- spec/paypal/express_checkout/recurring/profile_spec.rb
|
531
|
+
- spec/paypal/express_checkout/recurring/update_profile_spec.rb
|
532
|
+
- spec/paypal/express_checkout/request_spec.rb
|
533
|
+
- spec/paypal/express_checkout/response/account_spec.rb
|
534
|
+
- spec/paypal/express_checkout/response/base_spec.rb
|
535
|
+
- spec/paypal/invoice/cancel_spec.rb
|
536
|
+
- spec/paypal/invoice/create_and_send_spec.rb
|
537
|
+
- spec/paypal/invoice/create_spec.rb
|
538
|
+
- spec/paypal/invoice/details_spec.rb
|
539
|
+
- spec/paypal/invoice/mark_as_paid_spec.rb
|
540
|
+
- spec/paypal/invoice/mark_as_refunded_spec.rb
|
541
|
+
- spec/paypal/invoice/mark_as_unpaid_spec.rb
|
542
|
+
- spec/paypal/invoice/search_spec.rb
|
543
|
+
- spec/paypal/invoice/send_spec.rb
|
544
|
+
- spec/paypal/invoice/update_spec.rb
|
545
|
+
- spec/paypal/request_spec.rb
|
546
|
+
- spec/spec_helper.rb
|