User Tools

Site Tools


payment_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
payment_api [2019/03/18 17:25] – [Install] mibasepayment_api [2019/03/18 17:27] (current) mibase
Line 52: Line 52:
  
 The PHP code to add The PHP code to add
-<?php 
  
  
- +{{:api:code.jpg?800|}}
-$inputData = array(); +
- +
-//input data is a named array with keys +
-//surname => , borid => , librarycode => , key => , amount => } +
-//eg +
-/* +
-$inputData['surname'] = 'Smith'; +
-$inputData['borid'] = '200'; +
-$inputData['librarycode'] = 'demo'; +
-$inputData['key'] = 'xxx'; +
-$inputData['amount'] = '55.00'; +
-*/ +
- +
-$postdata = http_build_query($inputData); +
- +
-$context_options = array('http' => +
-    array( +
-        'method' => 'POST', +
-        'header' => "Content-type+
-        . "application/x-www-form-urlencoded\r\n" . "Content-Lengthstrlen($postdata) . "\r\n", +
-        'content' => $postdata +
-    ) +
-); +
- +
-$context = stream_context_create($context_options); +
- +
-$result = file_get_contents('https://' . $inputData['librarycode'] .'.mibase.com.au/home/api/RecPayment.php', false, $context); +
- +
-$outData = json_decode($result); +
- +
-//outdata is a name array +
-//{ error => , id => , status => } +
- +
- +
-/* +
-echo $result; +
- */+
  
  
  
  
payment_api.1552890302.txt.gz · Last modified: 2019/03/18 17:25 by mibase

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki