Jump to content
souzadavi

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

 

Share this post


Link to post
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"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines