Class accounting_p2b

Description

Function to handle provider to buyer based accounting logic

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.accounting_p2b.inc.php (line 28)

accounting
   |
   --accounting_p2b
Method Summary
nothing construct_p2b_transaction ([string $amount = 0], [integer $sellerid = 0], [integer $buyerid = 0], [integer $projectid = 0], [string $comments = ''], [string $txnfee = 0], [bool $instantpay = 0], [string $paymentstatus = 'unpaid'], [string $paymentmethod = ''])
mixed payment ([integer $userid = 0], [integer $invoiceid = 0], [string $invoicetype = 'p2b'], [string $amount = 0], [string $method = 'account'], [string $gateway = ''], [string $gatewaytxn = ''], [boolean $silentmode = false])
Variables

Inherited Variables

Inherited from accounting

accounting::$currencyid
Methods
construct_p2b_transaction (line 339)

Function for constructing a provider to buyer generated transaction to be paid through the marketplace.

Basically, we have an invoice type of "p2b" where the provider can generate an unpaid invoice through the marketplace officially. As a result, provider to buyer transactions can be viewed by the buyers on a per-project basis and multiple invoices can be generated based on a single auction. Allowing the service such as this, it is also possible to pre-configure "p2b fees" where you can set a rate of 5% (for example) to let the provider generate an invoice to his/her buyer. Upon the buyer's payment, the fee will be debitted from that service provider.

  • return: The data inserted into datastore
nothing construct_p2b_transaction ([string $amount = 0], [integer $sellerid = 0], [integer $buyerid = 0], [integer $projectid = 0], [string $comments = ''], [string $txnfee = 0], [bool $instantpay = 0], [string $paymentstatus = 'unpaid'], [string $paymentmethod = ''])
  • string $amount: amount to process
  • integer $sellerid: service provider id
  • integer $buyerid: service buyer id
  • integer $projectid: associated project id
  • string $comments: associated comments
  • string $txnfee: transaction fee amount (if applicable)
  • bool $instantpay: defines if instant payment (from account balance) was selected by payer
  • string $paymentstatus: defines the providers selected payment status of this newly generated transaction (unpaid or paid) unpaid is used by default
  • string $paymentmethod: defines the providers preferred payment method when being viewed on the transaction page
payment (line 44)

Function for processing a provider generated (to buyer) transaction type being paid by the actual buyer.

  • return: for ipn processing, boolean is used, others will use a print_notice() function to end user.
mixed payment ([integer $userid = 0], [integer $invoiceid = 0], [string $invoicetype = 'p2b'], [string $amount = 0], [string $method = 'account'], [string $gateway = ''], [string $gatewaytxn = ''], [boolean $silentmode = false])
  • integer $userid: user id
  • integer $invoiceid: invoice id
  • string $invoicetype: invoice type
  • string $amount: amount to process
  • string $method: method of payment (ipn/account/creditcard)
  • string $gateway: name of gateway processing this transaction
  • string $gatewaytxn: gateway transaction id
  • boolean $silentmode: silent mode (return only true or false; default false)

Inherited Methods

Inherited From accounting

accounting::check_currency()
accounting::creditcard_country_pulldown()
accounting::creditcard_month_pulldown()
accounting::creditcard_type_pulldown()
accounting::creditcard_year_pulldown()
accounting::insert_bank_account()
accounting::insert_creditcard()
accounting::insert_transaction()
accounting::print_bank_account_type_pulldown()
accounting::print_destination_currency_pulldown()
accounting::process_credential_payment()
accounting::process_debit_payment()
accounting::remove_bank_account()
accounting::remove_creditcard()
accounting::update_bank_account()
accounting::update_creditcard()
accounting::verify_creditcard_mod10()

Documentation generated on Mon, 08 Aug 2011 17:40:45 +0200 by phpDocumentor 1.4.1