# File lib/active_merchant/billing/gateways/paypal.rb, line 24 24: def express 25: @express ||= PaypalExpressGateway.new(@options) 26: end
# File lib/active_merchant/billing/gateways/paypal.rb, line 19 19: def purchase(money, credit_card_or_referenced_id, options = {}) 20: requires!(options, :ip) 21: commit define_transaction_type(credit_card_or_referenced_id), build_sale_or_authorization_request('Sale', money, credit_card_or_referenced_id, options) 22: end
# File lib/active_merchant/billing/gateways/paypal.rb, line 79 79: def add_credit_card(xml, credit_card, address, options) 80: xml.tag! 'n2:CreditCard' do 81: xml.tag! 'n2:CreditCardType', credit_card_type(card_brand(credit_card)) 82: xml.tag! 'n2:CreditCardNumber', credit_card.number 83: xml.tag! 'n2:ExpMonth', format(credit_card.month, :two_digits) 84: xml.tag! 'n2:ExpYear', format(credit_card.year, :four_digits) 85: xml.tag! 'n2:CVV2', credit_card.verification_value 86: 87: if [ 'switch', 'solo' ].include?(card_brand(credit_card).to_s) 88: xml.tag! 'n2:StartMonth', format(credit_card.start_month, :two_digits) unless credit_card.start_month.blank? 89: xml.tag! 'n2:StartYear', format(credit_card.start_year, :four_digits) unless credit_card.start_year.blank? 90: xml.tag! 'n2:IssueNumber', format(credit_card.issue_number, :two_digits) unless credit_card.issue_number.blank? 91: end 92: 93: xml.tag! 'n2:CardOwner' do 94: xml.tag! 'n2:PayerName' do 95: xml.tag! 'n2:FirstName', credit_card.first_name 96: xml.tag! 'n2:LastName', credit_card.last_name 97: end 98: 99: xml.tag! 'n2:Payer', options[:email] 100: add_address(xml, 'n2:Address', address) 101: end 102: end 103: end
# File lib/active_merchant/billing/gateways/paypal.rb, line 116 116: def build_response(success, message, response, options = {}) 117: Response.new(success, message, response, options) 118: end
# File lib/active_merchant/billing/gateways/paypal.rb, line 105 105: def credit_card_type(type) 106: case type 107: when 'visa' then 'Visa' 108: when 'master' then 'MasterCard' 109: when 'discover' then 'Discover' 110: when 'american_express' then 'Amex' 111: when 'switch' then 'Switch' 112: when 'solo' then 'Solo' 113: end 114: end
# File lib/active_merchant/billing/gateways/paypal.rb, line 30 30: def define_transaction_type(transaction_arg) 31: if transaction_arg.is_a?(String) 32: return 'DoReferenceTransaction' 33: else 34: return 'DoDirectPayment' 35: end 36: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.