Class: Workarea::Paypal::Update
- Inherits:
-
Object
- Object
- Workarea::Paypal::Update
- Defined in:
- app/services/workarea/paypal/update.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#payment ⇒ Object
readonly
Returns the value of attribute payment.
-
#shipping ⇒ Object
readonly
Returns the value of attribute shipping.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #apply ⇒ Object
- #details ⇒ Object
-
#initialize(order, payment, shipping, token) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(order, payment, shipping, token) ⇒ Update
Returns a new instance of Update.
6 7 8 9 10 11 |
# File 'app/services/workarea/paypal/update.rb', line 6 def initialize(order, payment, shipping, token) @order = order @payment = payment @shipping = shipping @token = token end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/services/workarea/paypal/update.rb', line 4 def order @order end |
#payment ⇒ Object (readonly)
Returns the value of attribute payment.
4 5 6 |
# File 'app/services/workarea/paypal/update.rb', line 4 def payment @payment end |
#shipping ⇒ Object (readonly)
Returns the value of attribute shipping.
4 5 6 |
# File 'app/services/workarea/paypal/update.rb', line 4 def shipping @shipping end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'app/services/workarea/paypal/update.rb', line 4 def token @token end |
Instance Method Details
#apply ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/services/workarea/paypal/update.rb', line 17 def apply order.email ||= details.email set_shipping_address(details.params) set_shipping_service set_billing_address(details.params) payment.clear_credit_card payment.set_paypal( token: details.token, payer_id: details.payer_id, details: details.params ) Pricing.perform(order, shipping) payment.adjust_tender_amounts(order.total_price) end |