/**
  * Returns asiapay direct client
  *
  * @param *string
  * @param *boolean
  * @return Eden_Asiapay_Directclient
  */
 public function directClient($merchantId, $test = true)
 {
     //argument test
     Eden_Asiapay_Error::i()->argument(1, 'string')->argument(2, 'bool');
     //Argument 2 must be a boolean
     return Eden_Asiapay_Directclient::i($merchantId, $test);
 }
Exemplo n.º 2
0
 /**
  * Returns asiapay direct client
  *
  * @param *string
  * @param *boolean
  * @return Eden_Asiapay_Directclient
  */
 public function directClient($merchantId, $test = true, $hash = NULL)
 {
     //argument test
     Eden_Asiapay_Error::i()->argument(1, 'string')->argument(2, 'bool')->argument(3, 'string', 'null');
     //Argument 3 must be a string or null
     return Eden_Asiapay_Directclient::i($merchantId, $test, $hash);
 }
 /**
  * Create asia pay form 
  *  
  * @param integer|float The total amount your want to charge the customer for the provided currency
  * @param url A Web page address you want us to redirect upon the transaction being rejected by us.
  * @param url A Web page address you want us to redirect upon the transaction being rejected by us.
  * @param url A Web page address you want us to redirect upon the transaction being cancelled by your customer
  * @param credit card number 
  * @param string Credit Card Verification Code
  * @param string Credit card holder name
  * @param string Credit card expiry month
  * @param string Credit card expiry year
  * @return string
  */
 public function createForm($amount, $successUrl, $failUrl, $cancelUrl, $cardNumber, $securityCode, $cardHolder, $month, $year)
 {
     //argument test
     Eden_Asiapay_Error::i()->argument(1, 'int', 'float')->argument(2, 'url')->argument(3, 'url')->argument(4, 'url')->argument(5, 'cc')->argument(6, 'string')->argument(7, 'string')->argument(8, 'string')->argument(9, 'string');
     //argument 9 must be a string
     //creata a random order reference number
     $orderRef = rand(10000, 99999);
     //populate fields
     $query = array('amount' => $amount, 'successUrl' => $successUrl, 'failUrl' => $failUrl, 'cancelUrl' => $cancelUrl, 'cardNo' => $cardNumber, 'securityCode' => $securityCode, 'cardHolder' => $cardHolder, 'epMonth' => $month, 'epYear' => $year, 'orderRef' => $orderRef, 'merchantId' => $this->_merchantId, 'currCode' => $this->_currencyCode, 'payType' => $this->_payType, 'lang' => $this->_language, 'pMethod' => $this->_payMethod, 'mpsMode' => $this->_mpsMode, 'remark' => $this->_remark, 'redirect' => $this->_redirect, 'print' => $this->_print, 'failRetry' => $this->_failRetry);
     //optional
     //prevent sending fields with no value
     $query = $this->_removeNull($query);
     //if test is true
     if ($this->_test) {
         //use the test url
         $url = self::DIRECTCLIENT_TEST_URL;
         //else test is false
     } else {
         //use the live url
         $url = self::DIRECTCLIENT_LIVE_URL;
         //make a secure hash to prevent hacking
         $hash = $this->_generateHash($amount, $orderRef);
         //use secure hash when using live transaction
         $query['secureHash'] = $hash;
     }
     //make a form template
     $parameters = Eden_Template::i()->set('query', $query)->set('url', $url)->parsePHP(dirname(__FILE__) . '/template/asiapay.php');
     //reset variables
     $this->_reset();
     return $parameters;
 }
Exemplo n.º 4
0
 /**
  * Create asia pay form 
  *  
  * @param integer|float The total amount your want to charge the customer for the provided currency
  * @param url A Web page address you want us to redirect upon the transaction being rejected by us.
  * @param url A Web page address you want us to redirect upon the transaction being rejected by us.
  * @param url A Web page address you want us to redirect upon the transaction being cancelled by your customer
  * @return string
  */
 public function createForm($amount, $successUrl, $failUrl, $cancelUrl)
 {
     //argument test
     Eden_Asiapay_Error::i()->argument(1, 'int', 'float')->argument(2, 'url')->argument(3, 'url')->argument(4, 'url');
     //argument 4 must be a url
     //creata a random order reference number
     $orderRef = rand(10000, 99999);
     $this->_query['amount'] = $amount;
     $this->_query['successUrl'] = $successUrl;
     $this->_query['failUrl'] = $failUrl;
     $this->_query['cancelUrl'] = $cancelUrl;
     $this->_query['orderRef'] = $orderRef;
     $this->_query['merchantId'] = $this->_merchantId;
     $this->_query['currCode'] = $this->_currencyCode;
     //if not specify, default is '608' - PH
     $this->_query['payType'] = $this->_payType;
     //if not specify, default is 'N' - Normal Payment (Sales)
     $this->_query['lang'] = $this->_language;
     //if not specify, default is 'E' - English
     $this->_query['payMethod'] = $this->_payMethod;
     //if not specify, default is 'CC' - Credit Card Payment
     //prevent sending fields with no value
     $this->_query = $this->_removeNull($this->_query);
     //if test is true
     if ($this->_test) {
         //use the test url
         $url = self::CLIENTPOST_TEST_URL;
         //else test is false
     } else {
         //use the live url
         $url = self::CLIENTPOST_LIVE_URL;
         //make a secure hash to prevent hacking
         $hash = $this->_generateHash($amount, $orderRef);
         //use secure hash when using live transaction
         $this->_query['secureHash'] = $hash;
     }
     //echo '<pre>'; print_r($this->_query); exit;
     //make a form template
     $parameters = Eden_Template::i()->set('query', $this->_query)->set('url', $url)->parsePHP(dirname(__FILE__) . '/template/asiapay.php');
     //reset variables
     unset($this->_query);
     return $parameters;
 }
Exemplo n.º 5
0
 public function directClient($merchantId, $test = true)
 {
     Eden_Asiapay_Error::i()->argument(1, 'string')->argument(2, 'bool');
     return Eden_Asiapay_Directclient::i($merchantId, $test);
 }