Class: MangoPay::Resource Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/mangopay/resource.rb

Overview

This class is abstract.

Direct Known Subclasses

Acquiring, Acquiring::PayIn::ApplePay::Direct, Acquiring::PayIn::Card::Direct, Acquiring::PayIn::GooglePay::Direct, Acquiring::PayIn::Ideal::Web, Acquiring::PayIn::PayPal::Web, Acquiring::Refund, BankAccount, BankingAliases, Card, CardRegistration, Client, Conversion, Deposit, Dispute, Event, Hook, IdentityVerification, KycDocument, Mandate, PayIn, PayIn::ApplePay::Direct, PayIn::Bancontact::Web, PayIn::BankWire::Direct, PayIn::BankWire::ExternalInstruction, PayIn::Bizum::Web, PayIn::Blik::Web, PayIn::Card::Direct, PayIn::Card::Web, PayIn::DirectDebit::Direct, PayIn::DirectDebit::Web, PayIn::Giropay::Web, PayIn::GooglePay::Direct, PayIn::Ideal::Web, PayIn::Klarna::Web, PayIn::Mbway::Web, PayIn::Multibanco::Web, PayIn::PayByBank::Web, PayIn::PayInIntent::Authorization, PayIn::PayInIntent::Capture, PayIn::PayInIntent::Dispute, PayIn::PayInIntent::Intent, PayIn::PayInIntent::Refund, PayIn::PayInIntent::Split, PayIn::PayPal::Web, PayIn::PreAuthorized::Direct, PayIn::PreAuthorized::Web, PayIn::RecurringPayments::CIT, PayIn::RecurringPayments::MIT, PayIn::RecurringPayments::PayPalCIT, PayIn::RecurringPayments::PayPalMIT, PayIn::RecurringPayments::Recurring, PayIn::RecurringPayments::RecurringApplePayPayIn, PayIn::RecurringPayments::RecurringCardPayIn, PayIn::RecurringPayments::RecurringGooglePayPayIn, PayIn::RecurringPayments::RecurringPayInRegistration, PayIn::RecurringPayments::RecurringPayPalPayIn, PayIn::Satispay::Web, PayIn::Swish::Web, PayIn::Twint::Web, PayOut, PayOut::BankWire, PayOut::InstantPayoutEligibility::Reachability, PaymentMethodMetadata, PreAuthorization, Recipient, Refund, Regulatory, Report, ReportV2, Settlement, Transaction, Transfer, Ubo, UboDeclaration, User, VirtualAccount, Wallet

Class Method Summary collapse

Class Method Details

.class_nameObject



5
6
7
# File 'lib/mangopay/resource.rb', line 5

def class_name
  name.split('::').last
end

.url(id = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/mangopay/resource.rb', line 9

def url(id = nil)
  if self == Resource
    raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
  end
  if id
    "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s/#{CGI.escape(id.to_s)}"
  else
    "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s"
  end
end