Class: PaymentSetupSessions::PaypalCheckout
- Inherits:
-
PaymentSetupSession
- Object
- PaymentSetupSession
- PaymentSetupSessions::PaypalCheckout
- Defined in:
- app/models/spree/payment_setup_sessions/paypal_checkout.rb
Instance Method Summary collapse
-
#approve_link ⇒ Object
The approve link the storefront redirects the buyer to.
- #paypal_payment_token_id ⇒ Object
-
#paypal_setup_token_id ⇒ Object
PayPal’s Vault API uses setup tokens (temporary) that get exchanged for permanent payment tokens once the buyer approves on PayPal.
- #successful? ⇒ Boolean
Instance Method Details
#approve_link ⇒ Object
The approve link the storefront redirects the buyer to.
14 15 16 |
# File 'app/models/spree/payment_setup_sessions/paypal_checkout.rb', line 14 def approve_link Array(external_data&.dig('links')).find { |l| l['rel'] == 'approve' }&.dig('href') end |
#paypal_payment_token_id ⇒ Object
9 10 11 |
# File 'app/models/spree/payment_setup_sessions/paypal_checkout.rb', line 9 def paypal_payment_token_id external_data&.dig('payment_token', 'id') end |
#paypal_setup_token_id ⇒ Object
PayPal’s Vault API uses setup tokens (temporary) that get exchanged for permanent payment tokens once the buyer approves on PayPal.
5 6 7 |
# File 'app/models/spree/payment_setup_sessions/paypal_checkout.rb', line 5 def paypal_setup_token_id external_id end |
#successful? ⇒ Boolean
18 19 20 |
# File 'app/models/spree/payment_setup_sessions/paypal_checkout.rb', line 18 def successful? status == 'completed' end |