gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: php order


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: php order
Date: Tue, 13 Mar 2018 12:54:25 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new db4ee62  php order
db4ee62 is described below

commit db4ee624c0b09277b90abcf9c5cf945fc6978d70
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 13 12:54:01 2018 +0100

    php order
---
 doc/merchant-api.content.texi | 45 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/doc/merchant-api.content.texi b/doc/merchant-api.content.texi
index 6efe1c5..b491fa2 100644
--- a/doc/merchant-api.content.texi
+++ b/doc/merchant-api.content.texi
@@ -104,6 +104,10 @@ It uses the requests library for HTTP requests.
 This version of the tutorial has examples for the
 command line with cURL.
 @end ifset
address@hidden LANG_PHP
+This version of the tutorial has examples for PHP,
+using the pecl_http package.
address@hidden ifset
 @c
 Versions for other languages/environments are available as well.
 
@@ -191,6 +195,23 @@ curl -i 'https://backend.demo.taler.net/' \
 @end verbatim
 @end example
 @end ifset
address@hidden LANG_PHP
address@hidden GOT_LANG 1
address@hidden
address@hidden
+php > $c = curl_init("https://backend.demo.taler.net/";);
+php >  $options = array(CURLOPT_RETURNTRANSFER => true,
+php (                   CURLOPT_CUSTOMREQUEST => "GET",
+php (                   CURLOPT_HTTPHEADER => array("Authorization: ApiKey 
sandbox"));
+php > curl_setopt_array ($c, $options);
+php > $r = curl_exec ($c);
+php > echo curl_getinfo ($c, CURLINFO_HTTP_CODE);
+200
+php > echo $r;
+Hello, I'm a merchant's Taler backend. This HTTP server is not for humans.
address@hidden verbatim
address@hidden example
address@hidden ifset
 @ifclear GOT_LANG
 @example
 (example not available for this language)
@@ -298,6 +319,30 @@ curl -i -X POST 'https://backend.demo.taler.net/order' \
 @end verbatim
 @end example
 @end ifset
address@hidden LANG_PHP
address@hidden GOT_LANG 1
address@hidden
address@hidden
+php > $c = curl_init("https://backend.demo.taler.net/order";);
+php > $json = array("order"=>
+php (   array("amount"=>"KUDOS:1",
+php (         "fulfillent_url"=>"https://example.com/thanks.html";, 
+php (         "summary"=>"nice product"));
+php > $options = array(CURLOPT_RETURNTRANSFER=>true,
+php (                  CURLOPT_CUSTOMREQUEST=>"POST",
+php (                  CURLOPT_POSTFIELDS=>json_encode($json),
+php (                  CURLOPT_HTTPHEADER=>array("Authorization: ApiKey 
sandbox"));
+php > curl_setopt_array($c, $options);
+php > $r = curl_exec($c);
+php > echo curl_getinfo($c, CURLINFO_HTTP_CODE);
+200
+php > echo $r;
+{
+  "order_id": "2018.072.12.48.51-014DKDKBMHPDP"
+}
address@hidden verbatim
address@hidden example
address@hidden ifset
 @ifclear GOT_LANG
 @example
 (example not available for this language)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]