Class: Paysafe::Api::PaymentsApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/paysafe/api/payments_api.rb

Constant Summary

Constants inherited from BaseApi

BaseApi::HEADERS

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize

Constructor Details

This class inherits a constructor from Paysafe::Api::BaseApi

Instance Method Details

#create_customer(**data) ⇒ Object



9
10
11
# File 'lib/paysafe/api/payments_api.rb', line 9

def create_customer(**data)
  perform_post_with_object("/paymenthub/v1/customers", data, Customer)
end

#create_payment(**data) ⇒ Object



17
18
19
# File 'lib/paysafe/api/payments_api.rb', line 17

def create_payment(**data)
  perform_post_with_object("/paymenthub/v1/payments", data, Payment)
end

#create_single_use_customer_token(id:) ⇒ Object



13
14
15
# File 'lib/paysafe/api/payments_api.rb', line 13

def create_single_use_customer_token(id:)
  perform_post_with_object("/paymenthub/v1/customers/#{id}/singleusecustomertokens", {}, SingleUseCustomerToken)
end

#create_standalone_credit(**data) ⇒ Object



21
22
23
# File 'lib/paysafe/api/payments_api.rb', line 21

def create_standalone_credit(**data)
  perform_post_with_object("/paymenthub/v1/standalonecredits", data, StandaloneCredit)
end

#get_customer(id:) ⇒ Object



25
26
27
# File 'lib/paysafe/api/payments_api.rb', line 25

def get_customer(id:)
  perform_get_with_object("/paymenthub/v1/customers/#{id}", Customer)
end

#get_payment(id:) ⇒ Object



29
30
31
# File 'lib/paysafe/api/payments_api.rb', line 29

def get_payment(id:)
  perform_get_with_object("/paymenthub/v1/payments/#{id}", Payment)
end

#get_payment_methods(currency_code:) ⇒ Object



5
6
7
# File 'lib/paysafe/api/payments_api.rb', line 5

def get_payment_methods(currency_code:)
  perform_get_with_object("/paymenthub/v1/paymentmethods?currencyCode=#{currency_code}", PaymentMethods)
end

#get_standalone_credit(id:) ⇒ Object



33
34
35
# File 'lib/paysafe/api/payments_api.rb', line 33

def get_standalone_credit(id:)
  perform_get_with_object("/paymenthub/v1/standalonecredits/#{id}", StandaloneCredit)
end