PHP code example of netopia / paymentsv2

1. Go to this page and download the library: Download netopia/paymentsv2 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netopia / paymentsv2 example snippets


        $request = new Request();
        $request->posSignature  = 'XXXX-XXXX-XXXX-XXXX-XXXX';                                 // Your signiture ID hear
        $request->apiKey        = 'ApiKey_GENERATE-YOUR-KEY-FROM-MobilPay-AND-USE-IT-HEAR';   // Your API key hear
        $request->isLive        = false;                                                      // false for SANDBOX & true for LIVE
        $request->notifyUrl     = 'http://your-domain.com/ipn.php';                           // Path of your IPN
        $request->redirectUrl   = null;
    

        $request->setRequest($configData, $cardData, $orderData, $threeDSecusreData);
    

        $request->startPayment();
    

        $verifyAuth = new VerifyAuth();
        $verifyAuth->apiKey              = 'ApiKey_GENERATE-YOUR-KEY-FROM-MobilPay-AND-USE-IT-HEAR';
        $verifyAuth->authenticationToken = 'YOUR-UNIQUE-AUTHENTICATION-TOKEN-PER-REQUEST';
        $verifyAuth->ntpID               = 'THE-UNIQUE-TRANSACTION-ID';
        $verifyAuth->paRes               = 'THE-DATA-WHAT-YOU-RECIVE-IT-FROM-THE-BANK';
        $verifyAuth->isLive              = false;       // FALSE for SANDBOX & TRUE for LIVE mode
    

        $jsonAuthParam = $verifyAuth->setVerifyAuth();  // To set parameters for /payment/card/verify-auth
    

        $paymentResult = $verifyAuth->sendRequestVerifyAuth($jsonAuthParam);  // To send request to verify-auth