Skip to content

simplyphpdotcom/papapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Post Affiliate Pro API Ruby Client

Configuration

Papapi.configure do |config|
  config.uri  = 'http://example.com/scripts/server.php'
  config.user = '[email protected]'
  config.pass = 'password'
end

Affiliates

# Create a new affiliate
affiliate = Papapi::Affiliate.create!(
  :username  => '[email protected]',
  :password  => 'password',
  :firstname => 'Tom',
  :lastname  => 'Foolery',
  :url       => 'http://playpen.com/models/tom-foolery',
  :company   => 'Foolery INC',
  :street    => '875 Rodeo Drive',
  :city      => 'Beverly Hills',
  :state     => 'CA',
  :country   => 'US',
  :zip       => '90210',
  :phone     => '3234789181',
  :refid     => 'tom-foolery'
)

puts affiliate.userid  # userid is set after creation


# add affiliate to a commission group    
affiliate.add_to_commission_group(
  campaign_id,
  commission_group_id,
  :note => 'added by ...'
)

Transactions

Papapi::Transaction.create!(
  :userid     => '78392178',
  :campaignid => '93847461',
  :commtypeid => '10938476',
  :totalcost  => 1000             # in dollars
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%