• Resolved roshanbi

    (@roshanbi)


    Hello Team,

    I have created a plugin to extend the woocomerce class and make payment. Kindly advise how should I call an existing wordpress page and in which location will be the wordpress page? where should I place the phpseclib directory?

    //code to generate signature
    			$payload=json_encode($payload);
    			$rsa= new \wamp642\www\transportation\wordpress\wp-content\phpseclib\phpseclib\Crypt\RSA();
    			$rsa->setHash('sha1');
    			$rsa->setMGFHash('sha1');
    			$rsa->setEncryptionMode(RSA::ENCRYPTION_OAEP);
    			$rsa->setPublicKeyFormat(RSA::PUBLIC_FORMAT_PKCS1);
    			$rsa->loadKey($publickey);
    			$encryptedPayload=base64_encode($rsa->encrypt($payload));
    			$signaturedata="appID&merTradeNo=$merTradeNo$merTradeNo&payload=$encryptedPayload&paymentType=$paymentType";
    			$sign=base64_encode(hash_hmac('sha512',$signaturedata,$apiKey,true));
    			
    			
    			//initiate payment
    			$response = $moovpay->purchase($appID,$merTradeNo,$encryptedPayload,$paymentType,$sign);
    			$fh = fopen(plugin_dir_path(__FILE__).'redirect.php', 'w+');
    			fwrite($fh, $response);
    			fclose($fh);
    		<strong>	$redirect_url = plugin_dir_url(__FILE__).'redirect.php';</strong>
      
    			return array(
    			'result' => 'success',
    			'redirect' => $redirect_url
    			);

    Thanks,

    Roshan

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘payment plugin page’ is closed to new replies.