Answers.Body: <p>We contacted the payment express and asked them to setup the PxPost creds for the client and then the recur started to work properly. Seems it is a necessary config for recur to function correctly using the automatic cron execution. Below lines is from Rishabh(Payment Express team member)</p>
  
  <blockquote>
    <p>The PxPay 2.0 is only used to tokenized the card details and PxPost runs in the backend to rebill those tokens in automatic process.</p>
    
    <p>You will not be able to rebill the tokens automatically, until you have PxPost setup in the backend.</p>
  </blockquote>
  
  <p>Thanks :-)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-22T06:48:26.773Z
Answers.LastActivityDate: 2018-08-22T06:48:26.773Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>CiviCRM 5.3.1 with Omnipay extension 2.5</p>
  
  <p>Added a PaymentExpress PxPay processor. After setting up a recur contribution for a contact the first payment is done successfully without any errors.</p>
  
  <p>The second payment run by the scheduled job <code>ProcessRecurring</code> only records a pending payment for the contact. The job log at <code>civicrm/admin/joblog?jid=18&amp;reset=1</code> shows only the starting of the execution message. There is no <code>Finished</code> indication of the job so it seems it errored in between and aborted the execution.</p>
  
  <p><a href="https://i.sstatic.net/B2nfC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/B2nfC.png" alt="enter image description here"></a></p>
  
  <p>There is a success message in the ConfigAndLog file at the same time when the above job was started at <code>00:41:45</code>-</p>
  
  <pre><code>Aug 10 00:41:46  [info] Contribution record updated successfully
  
  Aug 10 00:41:46  [info] Success: Database updated
  </code></pre>
  
  <p>But, when I check the log tables, the contribution was never set to completed. </p>
  
  <ol>
  <li>If I execute the job manually the recur payment is completed successfully.</li>
  <li>If I manually run the <code>completetransation</code> API from the API explorer, it correctly completes the payment.</li>
  </ol>
  
  <p>So there seems to be no way I can replicate this behaviour from my side. It is just that the automatic cron job fails to give the proper result. Shrug.</p>
  
  <p>No error reporting in the system log table -</p>
  
  <blockquote>
    <p>295    payment_notification processor_id=11    {"q":"civicrm/payment/ipn/761/11","result":"00001100039341640bfef9f4cb5d3c06","userid":"****","IDS_request_uri":"/civicrm/payment/ipn/761/11?result=00001100039341640bfef9f4cb5d3c06&amp;userid=****","IDS_user_agent":"***"}</p>
  </blockquote>
  
  <p>Can anyone point out what is wrong happening here?</p>
  
  <p>UPDATE: There is no system log entry for the recur payment. It seems the return URL is not triggered when the job is executed.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-11T06:50:47.807Z
Comments.Text: When you run the `completetransaction` API call, you're probably logged in as your own user with presumably some level of admin rights. When cron executes it, this may be using a different user account. Could this be explained by different permissions for the calling user?
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-11T06:51:36.970Z
Comments.Text: Also a note that above you say **Paypal** PxPay, but AFAIK you'll be talking about PaymentExpress PxPay?
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-11T14:21:53.670Z
Comments.Text: Ah yes, a bit typo there - updated the question. On further debug - I see it is a problem related to the redirect. When I execute the job manually it redirects me to the payment site and gives an approved status. Auto execution isn't able to handle the redirection and finally doesn't complete the payment on either side.
Comments.UserDisplayName: jitendra - fuzion
Tags: <payment-processor><recurring-contributions>
Title: PxPay Recur Payment gets stuck in pending mode
ThreadText: # PxPay Recur Payment gets stuck in pending mode
  
  (Asked by: username_0 on 2018-08-10)
  
  CiviCRM 5.3.1 with Omnipay extension 2.5
  
  Added a PaymentExpress PxPay processor. After setting up a recur contribution for a contact the first payment is done successfully without any errors.
  
  The second payment run by the scheduled job `ProcessRecurring` only records a pending payment for the contact. The job log at `civicrm/admin/joblog?jid=18&reset=1` shows only the starting of the execution message. There is no `Finished` indication of the job so it seems it errored in between and aborted the execution.
  
  [![enter image description here](https://i.sstatic.net/B2nfC.png)](https://i.sstatic.net/B2nfC.png)
  
  There is a success message in the ConfigAndLog file at the same time when the above job was started at `00:41:45`-
  
  ```
  Aug 10 00:41:46  [info] Contribution record updated successfully
  
  Aug 10 00:41:46  [info] Success: Database updated
  
  ```
  
  But, when I check the log tables, the contribution was never set to completed.
  
  1. If I execute the job manually the recur payment is completed successfully.
  2. If I manually run the `completetransation` API from the API explorer, it correctly completes the payment.
  
  So there seems to be no way I can replicate this behaviour from my side. It is just that the automatic cron job fails to give the proper result. Shrug.
  
  No error reporting in the system log table -
  
  > 295 payment\_notification processor\_id=11 {"q":"civicrm/payment/ipn/761/11","result":"00001100039341640bfef9f4cb5d3c06","userid":"\*\*\*\*","IDS\_request\_uri":"/civicrm/payment/ipn/761/11?result=00001100039341640bfef9f4cb5d3c06&userid=\*\*\*\*","IDS\_user\_agent":"\*\*\*"}
  
  Can anyone point out what is wrong happening here?
  
  UPDATE: There is no system log entry for the recur payment. It seems the return URL is not triggered when the job is executed.
  
  **Tags:** payment-processor, recurring-contributions
  
  > **Comments:**
  > **username_1**: When you run the `completetransaction` API call, you're probably logged in as your own user with presumably some level of admin rights. When cron executes it, this may be using a different user account. Could this be explained by different permissions for the calling user?  
  > **username_1**: Also a note that above you say **Paypal** PxPay, but AFAIK you'll be talking about PaymentExpress PxPay?  
  > **username_0**: Ah yes, a bit typo there - updated the question. On further debug - I see it is a problem related to the redirect. When I execute the job manually it redirects me to the payment site and gives an approved status. Auto execution isn't able to handle the redirection and finally doesn't complete the payment on either side.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-08-22. Score: 1 | Accepted answer
  
  We contacted the payment express and asked them to setup the PxPost creds for the client and then the recur started to work properly. Seems it is a necessary config for recur to function correctly using the automatic cron execution. Below lines is from Rishabh(Payment Express team member)
  
  > The PxPay 2.0 is only used to tokenized the card details and PxPost runs in the backend to rebill those tokens in automatic process.
  >
  > You will not be able to rebill the tokens automatically, until you have PxPost setup in the backend.
  
  Thanks :-)
  
  
  ---
  
  