Class: PaypalMarketplace

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.access_tokenObject

Returns the value of attribute access_token.



6
7
8
# File 'lib/paypal_marketplace.rb', line 6

def access_token
  @access_token
end

.credentialsObject

Returns the value of attribute credentials.



6
7
8
# File 'lib/paypal_marketplace.rb', line 6

def credentials
  @credentials
end

.developmentObject

Returns the value of attribute development.



6
7
8
# File 'lib/paypal_marketplace.rb', line 6

def development
  @development
end

Class Method Details



8
9
10
11
12
13
14
15
16
17
# File 'lib/paypal_marketplace.rb', line 8

def create_onboarding_link(tracking_id: nil)
  uri = URI(partner_referral_url)
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path, onboarding_headers)
  request.body = onboarding_data(tracking_id: tracking_id).to_json

  response = http.request(request)
end