PHP Classes

File: example/index.php

Recommend this page to a friend!
  Classes of Hicri   Yapikredi PHP Posnet Service   example/index.php   Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Yapikredi PHP Posnet Service
Process payment requests using the Posnet API
Author: By
Last change:
Date: 2 years ago
Size: 1,436 bytes
 

Contents

Class file image Download
<?php


require __DIR__ . '/../vendor/autoload.php';


//use \qwerty\RequestClass as RequestClass;
//use \qwerty\Client as Client;
//use \qwerty\Config as Config;
//use \qwerty\OrderClass as OrderClass;
//use \qwerty\ResponseClass as ResponseClass;
//use \qwerty\SeederClass as SeederClass;



$conf = array(
   
'mid' => 'xxxxxxxxxx',
   
'tid' => 'xxxxxxxx',
   
'clientId' => 'xxxx',
   
'clientUser' => 'xxxxxxxx',
   
'clientPass' => 'xxxxxxxx',
   
'encKey' => 'x,xx,xx,xxx,xx,xx,xx,xxx'
);


$config = new Qwerty\PosnetPaymentService\Config($conf);
$client = new Qwerty\PosnetPaymentService\Client($config);




$orderData = array(
   
'amount' => "x",
   
'installment' => 'x',
   
'tranType' => 'Sale',
   
'cardName' => 'xxxxx xxxxxxxxx',
   
'ccno' => 'xxxx xxxx xxxx xxxx',
   
'expDate' => 'xxxx',
   
'cvc' => 'xxx',
   
'currencyCode' => 'TL'
);




$order = new Qwerty\PosnetPaymentService\OrderClass($orderData);



$seed = new Qwerty\PosnetPaymentService\SeederClass($config);


$seed->setOrder($order);
$xmlData = $seed->getXml();



$query = new Qwerty\PosnetPaymentService\RequestClass();


$xmlUrl = 'https://posnet.yapikredi.com.tr/PosnetWebService/XML?';
$query->setXmlUrl($xmlUrl);



$cre_request = $query->xml_create_request($xmlData);



$reponse = new Qwerty\PosnetPaymentService\ResponseClass($cre_request);



$arr = $reponse->getRequestClassJson();
$rest = $reponse->ResponseRequest();
echo
$rest;


?>