[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: adding missing PHP
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: adding missing PHP snippets. |
Date: |
Tue, 13 Mar 2018 14:54:27 +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 b466a12 adding missing PHP snippets.
b466a12 is described below
commit b466a12f337976cde190da4a28a9ec852e4bdaf4
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 13 14:54:09 2018 +0100
adding missing PHP snippets.
---
doc/merchant-api.content.texi | 66 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 64 insertions(+), 2 deletions(-)
diff --git a/doc/merchant-api.content.texi b/doc/merchant-api.content.texi
index 6f52342..0ddd98d 100644
--- a/doc/merchant-api.content.texi
+++ b/doc/merchant-api.content.texi
@@ -398,9 +398,9 @@ curl -i
"https://backend.demo.taler.net/check-payment?order_id=$ORDER_ID" \
@set GOT_LANG 1
@example
@verbatim
-$ORDER_ID = "2018.072.12.48.51-014DKDKBMHPDP";
+php > $ORDER_ID = "2018.072.12.48.51-014DKDKBMHPDP";
php > curl_init
("https://backend.demo.taler.net/check-payment?order_id=$ORDER_ID");
-php > $options = array(CURLOPT_RETURNTRANSFER=>true,
+php > $options = array(CURLOPT_RETURNTRANSFER=>true,
php ( CURLOPT_CUSTOMREQUEST=>"GET",
php ( CURLOPT_HTTPHEADER=>array(
php ( "Authorization: ApiKey sandbox"));
@@ -506,6 +506,29 @@ curl -i -X POST 'https://backend.demo.taler.net/refund' \
@end verbatim
@end example
@end ifset
+
address@hidden LANG_PHP
address@hidden GOT_LANG 1
address@hidden
address@hidden
+php > $REFUND_REQ = array("order_id"=>$ORDER_ID,
+php ( "refund"=>"KUDOS:0.5",
+php ( "instance"=>"default",
+php ( "reason"=>"Customer did not like product");
+php > $options = array(CURLOPT_RETURNTRANSFER=>true,
+php ( CURLOPT_CUSTOMREQUEST=>"POST",
+php ( CURLOPT_HTTPHEADER=>array(
+php ( "Authorization: ApiKey sandbox"),
+php ( CURLOPT_POSTFIELDS=>json_encode($REFUND_REQ));
+php > $c = curl_init("https://backend.demo.taler.net/refund");
+php > curl_setopt_array($c, $options);
+php > $r = curl_exec($c);
+php > echo $r;
+php > echo curl_getinfo($c, CURLINFO_HTTP_CODE);
+200 # Make sure you paid first!
address@hidden verbatim
address@hidden example
address@hidden ifset
@ifclear GOT_LANG
@example
(example not available for this language)
@@ -566,6 +589,22 @@ curl -i
'https://backend.demo.taler.net/tip-query?instance=default' --header "Au
@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/tip-query?instance=default");
+php > $options = array(CURLOPT_RETURNTRANSFER=>true,
+php ( CURLOPT_CUSTOMREQUEST=>"GET",
+php ( CURLOPT_HTTPHEADER=>array(
+php ( "Authorization: ApiKey sandbox"));
+php > curl_setopt_array($c, $options);
+php > $r = curl_exec($c);
+php > echo curl_getinfo($c, CURLINFO_HTTP_CODE);
+200
address@hidden verbatim
address@hidden example
address@hidden ifset
@ifclear GOT_LANG
@example
(example not available for this language)
@@ -627,6 +666,29 @@ curl -i -X POST
'https://backend.demo.taler.net/tip-authorize' \
@end verbatim
@end example
@end ifset
+
address@hidden LANG_PHP
address@hidden GOT_LANG 1
address@hidden
address@hidden
+php > $TIP_REQ = array(
+php ( "amount"=>"KUDOS:1",
+php ( "instance"=>"default",
+php ( "justification"=>"surveying",
+php ( "next_url"=>"https://example.com/survey-thanks.html");
+php > $options = array(CURLOPT_RETURNTRANSFER=>true,
+php ( CURLOPT_CUSTOMREQUEST=>"POST",
+php ( CURLOPT_POSTFIELDS=>json_encode($TIP_REQ),
+php ( CURLOPT_HTTPHEADER=>array("Authorization: ApiKey
sandbox"));
+php > $c = curl_init("https://backend.demo.taler.net/tip-authorize");
+php > curl_setopt_array($c, $options);
+php > $r = curl_exec($c);
+php > echo curl_getinfo($c, CURLINFO_HTTP_CODE);
+200
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: adding missing PHP snippets.,
gnunet <=