Jump to content

Return array creditcard payment


Recommended Posts

Hello, I'm trying to create a payment module with credit card, is almost done, I only have a doubts about the validation of payment, I need to do it on method capture or create a callback for that module?

Also sometimes the credit card has another return, analyzing, or waiting, i tried to setup other status without success. Sometime the credit card need sometime to confirm the payment, so how do I setup it on capture method or callback file?

Also the documentation at: https://developers.whmcs.com/payment-gateways/merchant-gateway/ show 

  return array(
        'status' => ($data->success == 1) ? 'success' : 'declined',
        'rawdata' => $data,
        'transid' => $data->transaction_id,
        'fees' => $data->fees,
    );

 

thanks

 

Link to comment
Share on other sites

 The answer of the whmcs support:

John KiplingStaff

Merchant gateways can leverage a callback file to handle out-of-sequence payments. You can use the callback file per the example in the gateway module: https://github.com/WHMCS/sample-gateway-module/blob/master/modules/gateways/callback/gatewaymodule.php
You'd just need to pass the URL to the callback file to your payment gateway in the _capture function, so that it knows to send the payment details to the callback file when required.

Related documentation: https://developers.whmcs.com/payment-gateways/callbacks/

In the instances when payment is held for manual review, you might like to add a message to the invoice letting the customer know that payment has been processed but is pending review. This can be done by redirecting the client to the following URL after payment:
.$CONFIG["SystemURL"].'/viewinvoice.php?id='.$invoiceid.'&pendingreview=true"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated