Ejemplo n.º 1
0
 /**
  * Payeezy
  *
  * Generate Payload for Telecheck & Value Link
  */
 public function getTeleCheckValueLinkPayLoad($args = array())
 {
     $method_name = strtolower(func_get_arg(0));
     //check if telecheck or valuelink
     if ($method_name == 'tele_check') {
         //Common required parameters
         $args = array_merge(array("billing_address" => array("street" => "", "city" => "", "state_province" => "", "zip_postal_code" => "", "country" => "")), $args);
         $transaction_type = strtolower(func_get_arg(1));
         $data = "";
         if ($transaction_type == 'purchase') {
             $data = array("method" => $method_name, "transaction_type" => $transaction_type, "amount" => $args['amount'], "currency_code" => $args['currency_code'], "tele_check" => array("check_number" => $args['check_number'], "check_type" => $args['check_type'], "routing_number" => $args['routing_number'], "account_number" => $args['account_number'], "accountholder_name" => $args['accountholder_name'], "customer_id_type" => $args['customer_id_type'], "customer_id_number" => $args['customer_id_number'], "client_email" => $args['client_email'], "gift_card_amount" => $args['gift_card_amount'], "vip" => $args['vip'], "clerk_id" => $args['clerk_id'], "device_id" => $args['device_id'], "micr" => $args['micr'], "release_type" => $args['release_type'], "registration_number" => $args['registration_number'], "registration_date" => $args['registration_date'], "date_of_birth" => $args['date_of_birth']));
             self::$url = self::$baseURL;
         } else {
             //Not Purchase but Void/TaggedVoid/TaggedRefund
             self::$url = self::$baseURL . '/' . $args['transaction_id'];
             if ($transaction_type == "void" || $transaction_type == 'refund' && isset($args['transaction_tag'])) {
                 $data = array("method" => $method_name, "transaction_type" => $transaction_type, "amount" => $args['amount'], "currency_code" => $args['currency_code'], "transaction_tag" => $args['transaction_tag']);
             } else {
                 $data = array("method" => $method_name, "transaction_type" => $transaction_type, "amount" => $args['amount'], "currency_code" => $args['currency_code'], "tele_check" => array("check_number" => $args['check_number'], "check_type" => $args['check_type'], "routing_number" => $args['routing_number'], "account_number" => $args['account_number'], "accountholder_name" => $args['accountholder_name'], "customer_id_type" => $args['customer_id_type'], "customer_id_number" => $args['customer_id_number'], "client_email" => $args['client_email'], "gift_card_amount" => $args['gift_card_amount'], "vip" => $args['vip'], "clerk_id" => $args['clerk_id'], "device_id" => $args['device_id'], "micr" => $args['micr'], "release_type" => $args['release_type'], "registration_number" => $args['registration_number'], "registration_date" => $args['registration_date'], "date_of_birth" => $args['date_of_birth']));
             }
             //end of void/tagged void/tagged refund
         }
         //end of purchase telecheck
     } else {
         //Common required parameters
         $args = array_merge(array("valuelink" => array("cardholder_name" => "", "cc_number" => "", "credit_card_type" => "", "card_cost" => "")), $args);
         $transaction_type = strtolower(func_get_arg(1));
         $data = "";
         if ($transaction_type == 'cashout' || $transaction_type == 'deactivation' || $transaction_type == 'balance_inquiry') {
             $data = array("method" => $method_name, "transaction_type" => $transaction_type);
             self::$url = self::$baseURL;
         } elseif ($transaction_type == 'void') {
             self::$url = self::$baseURL . '/' . $args['transaction_id'];
             $data = array("method" => $method_name, "transaction_type" => $transaction_type, "amount" => $args['amount'], "currency_code" => $args['currency_code'], "transaction_tag" => $args['transaction_tag']);
         } else {
             $data = array("transaction_type" => $transaction_type, "method" => $method_name, "amount" => $args['amount'], "currency_code" => $args['currency_code']);
             self::$url = self::$baseURL;
         }
         //end of valuelink methods
     }
     //end of valuelink
     return json_encode($data, JSON_FORCE_OBJECT);
 }
Ejemplo n.º 2
0
 /**
  * Payeezy
  * 
  * Generate Payload
  */
 public function getPayload($args = array())
 {
     $args = array_merge(array("amount" => "", "card_number" => "", "card_type" => "", "card_holder_name" => "", "card_cvv" => "", "card_expiry" => "", "merchant_ref" => "", "currency_code" => "", "transaction_tag" => "", "split_shipment" => "", "transaction_id" => ""), $args);
     $transaction_type = strtolower(func_get_arg(1));
     $data = "";
     if ($transaction_type == "authorize" || $transaction_type == "purchase") {
         $data = array('merchant_ref' => $args['merchant_ref'], 'transaction_type' => $transaction_type, 'method' => 'credit_card', 'amount' => $args['amount'], 'currency_code' => strtoupper($args['currency_code']), 'credit_card' => array('type' => $args['card_type'], 'cardholder_name' => $args['card_holder_name'], 'card_number' => $args['card_number'], 'exp_date' => $args['card_expiry'], 'cvv' => $args['card_cvv']));
         self::$url = self::$baseURL;
     } else {
         self::$url = self::$baseURL . '/' . $args['transaction_id'];
         if ($transaction_type == "split") {
             $data = array('merchant_ref' => $args['merchant_ref'], 'transaction_type' => $transaction_type, 'method' => 'credit_card', 'amount' => $args['amount'], 'currency_code' => strtoupper($args['currency_code']), 'transaction_tag' => $args['transaction_tag'], 'split_shipment' => $args['split_shipment']);
         } else {
             $data = array('merchant_ref' => $args['merchant_ref'], 'transaction_type' => $transaction_type, 'method' => 'credit_card', 'amount' => $args['amount'], 'currency_code' => strtoupper($args['currency_code']), 'transaction_tag' => $args['transaction_tag']);
         }
     }
     return json_encode($data, JSON_FORCE_OBJECT);
 }