migs (MasterCard Virtual Payment Client) integration php

后端 未结 4 1028
既然无缘
既然无缘 2021-02-06 05:31

Can any body help me about how to integrate migs (MasterCard Virtual Payment Client) in a php website !

I have read the reference guide but it\

4条回答
  •  野性不改
    2021-02-06 06:17

    You could use the Omnipay PHP Library which has support for the MIGS gateway.

    An example of the off-site payment processing (3-Party) looks like this:

    use Omnipay\Omnipay;
    
    $gateway = Omnipay::create('Migs_ThreeParty');
    $gateway->setMerchantId('foo');
    $gateway->setMerchantAccessCode('foo');
    $gateway->setSecureHash('foo');
    
    $response = $gateway->purchase(array('amount' => '10.00', 'currency' => 'AUD'))->send();
    
    if ($response->isRedirect()) {
        // redirect to offsite payment gateway
        $response->redirect();
    } else {
        // payment failed: display message to customer
        echo $response->getMessage();
    }
    

提交回复
热议问题