I want to add customer profiles to the vault, without charging any money up front, then start billing on a monthly basis starting in 1 month (it's a free 1 month trial). I have this working with the sandbox, but when I change to live credentials and URL, it only adds a profile to the vault and fails to set up recurring bills... there is no response in $mpgResponse->getRecurSuccess();
I have a basic form with email and client/customer name that is submitted to https://www3.moneris.com/HPPDP/index.php. This sets up a temporary profile in the vault (becomes permanent once credit card info has been added) and responds with the form to enter payment info (I simply have the form target set to an iframe so this response is loaded automatically). When the payment info is submitted, Moneris POSTs the result back to my PHP script, where I get the "data_key", which is what I am using instead of "credential on file". Is that a problem?
//GET CUSTOMER ID AND BILLING KEY FROM MONERIS
$client_name = $_POST["cust_id"];
$billing_key = $_POST["data_key"];
//PRIMARY TRANSACTION - No money up front (free 30 day trial)
$txnArray=array(
'type'=>'res_purchase_cc',
'data_key'=>$billing_key,
'order_id'=>$orderID,
'cust_id'=>$client_name,
'amount'=>'0.00',
'crypt_type'=>'7'
);
$mpgTxn = new mpgTransaction($txnArray);
//START BILLING IN 30 DAYS (will upgrade or use EOM to prevent issues like Feb 30th not existing)
$startDate = date('Y/m/d', strtotime('+30 day', strtotime(date('Y/m/d'))));
$recurArray = array(
'recur_unit'=>'day',
'start_now'=>'false',
'start_date'=>$startDate,
'num_recurs'=>'98',
'period' => '1',
'recur_amount'=> '99.00'
);
$mpgRecur = new mpgRecur($recurArray);
//ADD RECURRING VARS TO MAIN TRANSACTION OBJECT
$mpgTxn->setRecur($mpgRecur);
//SEND IT TO MONERIS
$mpgRequest = new mpgRequest($mpgTxn);
$mpgHttpPost = new mpgHttpsPost($store_id, $api_token, $mpgRequest);
//GET RESPONSE FROM MONERIS
$mpgResponse = $mpgHttpPost->getMpgResponse();
$respCode = $mpgResponse->getResponseCode();
$message = $mpgResponse->getMessage();
//$mpgResponse->getIssuerId();
//GET RECUR RESULT: THIS IS EMPTY IN LIVE ENVIRONMENT, BUT "true" IN SANDBOX
$recurResult = $mpgResponse->getRecurSuccess();