spree_paypal_api_checkout 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07c55f4fc562fc1c5cafec50afb576a3498ff4569cc6d390c1f02fc174efa002
|
4
|
+
data.tar.gz: 7ad4654823019c8eb7b7ee1b14132ce1974240ae373c42fafba6ef0d22d8656a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 168e3b4bf6eb7f34e7f0838853a2bdbfdc4b14bb19520cf7ec737a1e9124b8f6c972786022dccaf8353ac9fb8ffdd5f323f1d7011d096411b93f5c4dae93aaa4
|
7
|
+
data.tar.gz: 36ca56115090032c1487903d9f7b8bde7a7612a37d061fbd37ebe8fd7e02a81e5f4ba2e9b70d30b76b63e1538a068d5a5592db9b7eb0176f40b2df7dc8285a89
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ module Spree
|
|
19
19
|
items << {
|
20
20
|
name: adjustment.label,
|
21
21
|
quantity: 1,
|
22
|
-
|
22
|
+
unit_amount: {
|
23
23
|
currency_code: order.currency,
|
24
24
|
value: adjustment.amount
|
25
25
|
}
|
@@ -70,13 +70,14 @@ module Spree
|
|
70
70
|
def line_item(item)
|
71
71
|
{
|
72
72
|
name: item.product.name,
|
73
|
-
|
73
|
+
sku: item.variant.sku,
|
74
74
|
quantity: item.quantity,
|
75
|
-
|
75
|
+
description: item.product.meta_description,
|
76
|
+
unit_amount: {
|
76
77
|
currency_code: item.order.currency,
|
77
78
|
value: item.price
|
78
79
|
},
|
79
|
-
|
80
|
+
item_category: "Physical"
|
80
81
|
}
|
81
82
|
end
|
82
83
|
|
@@ -87,14 +88,38 @@ module Spree
|
|
87
88
|
{
|
88
89
|
amount: {
|
89
90
|
currency_code: current_order.currency,
|
90
|
-
value: order.total
|
91
|
+
value: order.total,
|
92
|
+
breakdown: {
|
93
|
+
item_total: {
|
94
|
+
currency_code: current_order.currency,
|
95
|
+
value: items.sum{|r| (r[:unit_amount][:value] * r[:quantity]) }
|
96
|
+
}
|
97
|
+
}
|
91
98
|
},
|
92
|
-
|
99
|
+
items: items,
|
100
|
+
shipping: address_options
|
93
101
|
},
|
94
102
|
]
|
95
103
|
}
|
96
104
|
end
|
97
105
|
|
106
|
+
def address_options
|
107
|
+
address = current_order.ship_address
|
108
|
+
{
|
109
|
+
name: { full_name: address.try(:full_name) },
|
110
|
+
address: {
|
111
|
+
address_line_1: address.address1,
|
112
|
+
address_line_2: address.address2,
|
113
|
+
# phone: address.phone,
|
114
|
+
admin_area_1: address.state_text,
|
115
|
+
admin_area_2: address.city,
|
116
|
+
country_code: address.country.iso,
|
117
|
+
postal_code: address.zipcode
|
118
|
+
},
|
119
|
+
type: 'SHIPPING'
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
98
123
|
def payment_method
|
99
124
|
Spree::PaymentMethod.find(params[:payment_method_id])
|
100
125
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "spree_paypal_api_checkout".freeze
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.9"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
6
6
|
s.require_paths = ["lib".freeze]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_paypal_api_checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spree Commerce
|
@@ -401,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
401
401
|
version: '0'
|
402
402
|
requirements:
|
403
403
|
- none
|
404
|
-
rubygems_version: 3.
|
404
|
+
rubygems_version: 3.0.3
|
405
405
|
signing_key:
|
406
406
|
specification_version: 4
|
407
407
|
summary: Adds PayPal API Checkout as a Payment Method to Spree Commerce
|