Subscription Payment with initial payment and recurring bill via Credit Card

Hi,

I'm trying to integrate the Moneris payment gateway to a particular WordPress plugin using the PHP API. Below is the code.

$txnArray = array( 'type' => 'purchase', 'order_id' => 'order id', 'cust_id' => 'cust id', 'amount' => $amount, 'pan' => '', 'expdate' => '', 'crypt_type'=> '7', ); $mpgTxn = new mpgTransaction($txnArray); $cvdTemplate = array( 'cvd_indicator' => '1', 'cvd_value' => '' ); $mpgCvdInfo = new mpgCvdInfo($cvdTemplate); $mpgTxn->setCvdInfo($mpgCvdInfo); if($recurring) { $recurArray = array( 'recur_unit' => 'day', 'start_date' => date('Y/m/d', strtotime( '+ 30 day')), 'num_recurs' => '99', 'start_now' => 'false', 'period' => 30, 'recur_amount' => $amount ); $mpgRecur = new mpgRecur($recurArray); $mpgTxn->setRecur($mpgRecur); } $mpgRequest = new mpgRequest($mpgTxn); $mpgRequest->setProcCountryCode('CA'); $mpgRequest->setTestMode(true); $mpgHttpPost = new mpgHttpsPost($store_id, $api_token, $mpgRequest);

I've verified the recurring bill pushes through. What I'm concerned about is the initial payment, credit card verification, and response code. The initial payment does not happen. Nothing regards the CVD. The response code returns null, which by the documentation means the transaction was cancelled.

Am I doing something wrong?

  • Im not sure if I'm understanding what you're asking. Are you doing a separate call for the Card Verification, or are you setting "bill now" to true and passing CVD?
  • In reply to RR_Moneris:

    It's in one single call as per the code shown. Should it be separate? What's this "bill now" parameter? I don't see it in the docs.
  • In reply to ChangeLeaderSolutions:

    I can see that you are passing the CVD, but that will not do anything unless start now is set to true and there is an initial transaction. That's because the CVD is not allowed to be stored, so unless there is a transaction right away, we just discard it.

    Alternatively, you could just do a CardVerifiaction first and pass your CVD (and AVS if you want)... and based on those results setup your recur payment.

    Also have you considered using our hosted tokenization solution to handle the card input? The advantage of that is that it reduces PCI scope.