This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/plugins/checkout/PAYBYCHECK_BASIC.php

86 lines
2.6 KiB
PHP
Raw Normal View History

<?php
/**
* AgileBill - Open Billing Software
*
* This body of work is free software; you can redistribute it and/or
* modify it under the terms of the Open AgileBill License
* License as published at http://www.agileco.com/agilebill/license1-4.txt
*
* For questions, help, comments, discussion, etc., please join the
* Agileco community forums at http://forum.agileco.com/
*
* @link http://www.agileco.com/
* @copyright 2004-2008 Agileco, LLC.
* @license http://www.agileco.com/agilebill/license1-4.txt
* @author Tony Landis <tony@agileco.com>
* @package AgileBill
* @version 1.4.93
*/
include_once(PATH_MODULES.'checkout/base_checkout_plugin.class.php');
class plg_chout_PAYBYCHECK_BASIC extends base_checkout_plugin
{
# Get the config values for this checkout plugin:
function plg_chout_PAYBYCHECK_BASIC($checkout_id=false) {
$this->name = 'PAYBYCHECK_BASIC';
$this->type = 'redirect'; // redirect, gateway, or other
$this->recurr_only = false;
$this->return_url = SSL_URL . 'plugins/checkout/'. $this->name .'.php';
$this->success_url = URL . '?_page=invoice:thankyou&_next_page=invoice:user_view&id=';
$this->decline_url = URL . '?_page=invoice:user_view&id=';
$this->support_cur = Array ('USD');
$this->getDetails($checkout_id);
}
# Validate the user submitted billing details at checkout:
function validate($VAR) {
return true;
}
# Perform the checkout transaction (new purchase):
function bill_checkout( $amount, $invoice, $currency_iso, $acct_fields, $total_recurring=false, $recurr_bill_arr=false) {
if(!$this->validate_currency($currency_iso)) return false;
$url = "https://paybycheck.com/";
$vals = Array (
Array ('id', $this->cfg['id']),
Array ('i', "Invoice No:". $invoice),
Array ('a', $amount),
Array ('s', $this->success_url.$invoice),
Array ('name', $acct_fields['first_name'].' '.$acct_fields['last_name']),
Array ('address1', $acct_fields['address1'].' '.$acct_fields['address2']),
Array ('city', $acct_fields['city']),
Array ('state', $acct_fields['state']),
Array ('zip', $acct_fields['zip']),
Array ('email', $acct_fields['email'])
);
$this->post_vars($url, $vals);
return true;
}
# Stores new billing details, & return account_billing_id (gateway only)
function store_billing($VAR) {
return 0;
}
# Perform a transaction for an (new invoice):
function bill_invoice($VAR) {
return true;
}
# Issue a refund for a paid invoice (captured charges w/gateway)
function refund($VAR) {
return true;
}
# Void a authorized charge (gateways only)
function void($VAR) {
return true;
}
}
?>