Class: Spree::PaypalPlatform::PaymentSources::ApplePay

Inherits:
Spree::PaymentSource
  • Object
show all
Defined in:
app/models/spree/paypal_platform/payment_sources/apple_pay.rb

Overview

An Apple Pay wallet used through PayPal Checkout.

PayPal returns payment_source.apple_pay on the captured order. The card brand / last digits (when present) are stored so admin can show "Apple Pay · Visa 4242" rather than a bare wallet name.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.display_nameString

Returns:

  • (String)


31
32
33
# File 'app/models/spree/paypal_platform/payment_sources/apple_pay.rb', line 31

def self.display_name
  'Apple Pay'
end

Instance Method Details

#actionsArray<String>

Returns:

  • (Array<String>)


24
25
26
# File 'app/models/spree/paypal_platform/payment_sources/apple_pay.rb', line 24

def actions
  %w[credit void]
end

#display_payment_infoString

Human-readable wallet line for admin and order emails.

Returns:

  • (String)


40
41
42
43
44
45
# File 'app/models/spree/paypal_platform/payment_sources/apple_pay.rb', line 40

def display_payment_info
  parts = ['Apple Pay']
  parts << card_brand.to_s.titleize if card_brand.present?
  parts << last_digits if last_digits.present?
  parts.join(' · ')
end