Initial import: Carteasy Shop (Dev-Stand)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_cancel_request.php';
|
||||
|
||||
// This is the order reference from the capture request
|
||||
$ref = $_GET["ref"];
|
||||
|
||||
$req = new ipl_cancel_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_cancel_params($ref, 27455, "EUR");
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
else {
|
||||
echo "Cancel successful<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_capture_request.php';
|
||||
|
||||
// This is the transaction ID obtained from the preauthorization response
|
||||
$tx_id = $_GET["tx_id"];
|
||||
|
||||
// The order ID must be unique -> generate a random number for this example
|
||||
$orderReference = rand(1, 15000000000);
|
||||
|
||||
$req = new ipl_capture_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_capture_params($tx_id, 27455, "EUR", $orderReference, "12345612");
|
||||
$req->set_payment_info_params(true, true);
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if (!$req->has_error()) {
|
||||
echo "Account holder: " . $req->get_account_holder() . "<br />";
|
||||
echo "Account number: " . $req->get_account_number() . "<br />";
|
||||
echo "Bank code: " . $req->get_bank_code() . "<br />";
|
||||
echo "Bank name: " . $req->get_bank_name() . "<br />";
|
||||
echo "Invoice reference: " . $req->get_invoice_reference() . "<br />";
|
||||
|
||||
echo "<input type=\"button\" value=\"Update order\" onclick=\"window.location.href='updateorder.php?tx_id=$tx_id&ref=$orderReference'\" />";
|
||||
echo "<input type=\"button\" value=\"Invoice\" onclick=\"window.location.href='invoicecreated.php?ref=$orderReference'\" />";
|
||||
echo "<input type=\"button\" value=\"Edit cart content\" onclick=\"window.location.href='edit.php?ref=$orderReference'\" />";
|
||||
echo "<input type=\"button\" value=\"Full cancel\" onclick=\"window.location.href='cancel.php?ref=$orderReference'\" />";
|
||||
}
|
||||
else {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_edit_cart_content_request.php';
|
||||
|
||||
// This is the order reference from the capture request
|
||||
$ref = $_GET["ref"];
|
||||
|
||||
$req = new ipl_edit_cart_content_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_total(500, 595, "Express-Versand", 500, 650, 5300, 7905, "EUR", $ref);
|
||||
$req->add_article("article003", 3, "Kaffetasse 07/11", "", 1200, 1950);
|
||||
$req->add_article("article004", 2, "Kuchenteller 007", "", 850, 1000);
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
else {
|
||||
echo "Edit cart content successful<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
|
||||
$validateError = (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') && (
|
||||
empty($_POST['api-url-base']) || empty($_POST['mid']) ||
|
||||
empty($_POST['pid']) || empty($_POST['security-key']));
|
||||
|
||||
if ($validateError == false) {
|
||||
$_SESSION['api-url-base'] = $_POST['api-url-base'];
|
||||
$_SESSION['mid'] = $_POST['mid'];
|
||||
$_SESSION['pid'] = $_POST['pid'];
|
||||
$_SESSION['security-key'] = $_POST['md5'] ? $_POST['security-key'] : md5($_POST['security-key']);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['api-url-base']) || empty($_SESSION['mid']) || empty($_SESSION['pid']) || empty($_SESSION)) {
|
||||
echo "Please insert your credentials that you received from Billpay:<br/>";
|
||||
echo "<form method='POST'>";
|
||||
echo "<table><tr>";
|
||||
echo "<td>API Url Base</td><td><input type='text' name='api-url-base' style='width:250px' value='https://test-api.billpay.de/xml/offline' /></td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>Merchant ID</td><td><input type='text' name='mid' style='width:50px' /></td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>Portal ID</td><td><input type='text' name='pid' style='width:50px' /></td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>Security Key</td><td><input type='text' name='security-key' />";
|
||||
echo "<div><input type='radio' name='md5' value='0' checked /> Plain <input type='radio' name='md5' value='1' /> MD5 </div> </td>";
|
||||
echo "</tr></table>";
|
||||
if ($validateError) {
|
||||
echo "<span style='color:red; font-weight:bold'>Please provide values for all fields</span><br />";
|
||||
}
|
||||
echo "<input type='submit' />";
|
||||
echo "</form>";
|
||||
}
|
||||
else {
|
||||
$startPage = 'preauth.php';
|
||||
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
||||
|
||||
if (!strstr($url, 'index.php')) {
|
||||
$rev = strrev($url);
|
||||
if ($rev[0] != '/') {
|
||||
$url .= '/';
|
||||
}
|
||||
$url .= $startPage;
|
||||
}
|
||||
else {
|
||||
$url = str_replace('index.php', $startPage, $url);
|
||||
}
|
||||
|
||||
header ("HTTP/1.1 303 See other");
|
||||
header ("Location: $url");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_invoice_created_request.php';
|
||||
|
||||
// This is the order reference from the capture request
|
||||
$ref = $_GET["ref"];
|
||||
|
||||
$req = new ipl_invoice_created_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_invoice_params(27455, "EUR", $ref, 5);
|
||||
$req->set_payment_info_params(true, true);
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if (!$req->has_error()) {
|
||||
echo "Account holder: " . $req->get_account_holder() . "<br />";
|
||||
echo "Account number: " . $req->get_account_number() . "<br />";
|
||||
echo "Bank code: " . $req->get_bank_code() . "<br />";
|
||||
echo "Bank name: " . $req->get_bank_name() . "<br />";
|
||||
echo "Invoice reference: " . $req->get_invoice_reference() . "<br />";
|
||||
echo "Invoice due date: " . $req->get_invoice_duedate() . "<br />";
|
||||
echo "Activation performed: " . ($req->get_activation_performed() ? "Yes" : "No") . "<br />";
|
||||
|
||||
if (count($req->get_dues()) > 0) {
|
||||
echo "Hire purchase payment:<br />";
|
||||
$pos = 0;
|
||||
foreach ($req->get_dues() as $due) {
|
||||
echo (++$pos).") date: ".$due['date'].", amount: ".$due['value']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<input type=\"button\" value=\"Edit cart content\" onclick=\"window.location.href='edit.php?ref=" . $ref . "'\" />";
|
||||
echo "<input type=\"button\" value=\"Full cancel\" onclick=\"window.location.href='cancel.php?ref=" . $ref . "'\" />";
|
||||
|
||||
}
|
||||
else {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_module_config_request.php';
|
||||
|
||||
$req = new ipl_module_config_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_locale("DEU", "EUR", "de");
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
else {
|
||||
echo "Module config request successful<br />";
|
||||
echo "Direct debit allowed: " . $req->is_direct_debit_allowed() . "<br />";
|
||||
echo "Invoice allowed: " . $req->is_invoice_allowed() . "<br />";
|
||||
echo "Invoice business allowed: " . $req->is_invoicebusiness_allowed() . "<br />";
|
||||
echo "Limit direct debit: " . $req->get_static_limit_direct_debit() . "<br />";
|
||||
echo "Limit invoice: " . $req->get_static_limit_invoice() . "<br />";
|
||||
echo "Limit hire purchase: " . $req->get_static_limit_hire_purchase() . "<br />";
|
||||
echo "Min value direct debit: " . $req->get_direct_debit_min_value() . "<br />";
|
||||
echo "Min value invoice: " . $req->get_invoice_min_value() . "<br />";
|
||||
echo "Min value hire purchase: " . $req->get_hire_purchase_min_value() . "<br />";
|
||||
echo "Available terms: " . implode(", ", $req->get_terms());
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_partialcancel_request.php';
|
||||
|
||||
// This is the order reference from the capture request
|
||||
$ref = $_GET["ref"];
|
||||
|
||||
$req = new ipl_partialcancel_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_cancel_params($ref, 0, 0, 0, 0, "EUR");
|
||||
$req->add_canceled_article("article001", 1);
|
||||
$req->add_canceled_article("article002", 1);
|
||||
|
||||
if ($req->is_transaction_credit_order()) {
|
||||
print_r($req->get_due_update());
|
||||
}
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
else {
|
||||
echo "Partial cancel successful<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_preauthorize_request.php';
|
||||
|
||||
// Generate a random suffix to create unique customer
|
||||
$randSuffix = rand(1, 15000000000);
|
||||
|
||||
$req = new ipl_preauthorize_request($_SESSION['api-url-base'], IPL_CORE_PAYMENT_TYPE_INVOICE);
|
||||
|
||||
// UN-COMMENT THIS FOR A DIRECT DEBIT REQUEST
|
||||
//$req = new ipl_preauthorize_request($_SESSION['api-url-base'], IPL_CORE_PAYMENT_TYPE_DIRECT_DEBIT);
|
||||
// UN-COMMENT THIS FOR A RATE PAYMENT REQUEST
|
||||
//$req = new ipl_preauthorize_request($_SESSION['api-url-base'], IPL_CORE_PAYMENT_TYPE_RATE_PAYMENT);
|
||||
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_customer_details("123456", "e", "Herr", "", "Herbert $randSuffix", "Billpay $randSuffix",
|
||||
"Teststrasse $randSuffix", "123", "", "12345", "Teststadt $randSuffix", "DEU", "testing@billpay.de",
|
||||
"0302333459", "01775112389", "19850911", "de", "85.214.7.23", "p");
|
||||
$req->set_shipping_details(true);
|
||||
// UN-COMMENT THIS FOR A DIRECT DEBIT REQUEST OR RATE PAYMENT
|
||||
//$req->set_bank_account("Herbert_$randSuffix Tester_$randSuffix", "4973024088", "10050000");
|
||||
// UN-COMMENT THIS FOR A RATE PAYMENT REQUEST
|
||||
//$req->set_rate_request(6, 28599);
|
||||
|
||||
$req->set_total(500, 595, "Express-Versand", 500, 650, 17800, 27455, "EUR", "");
|
||||
$req->add_article("article001", 12, "Kaffetasse 08/15", "Eine Kaffetasse aus Porzellan", 1200, 1950);
|
||||
$req->add_article("article002", 4, "Kuchenteller 07-11", "Kuchenteller - weiss", 850, 1000);
|
||||
$req->add_order_history("1233343321", "20080101 10:23:30", 12300, "EUR", 4, 0);
|
||||
$req->set_terms_accepted(true);
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
}
|
||||
|
||||
echo "Status: " . $req->get_status() . "<br />";
|
||||
|
||||
if (!$req->has_error()) {
|
||||
echo "TX ID: " . $req->get_bptid() . "<br />";
|
||||
echo "<input type=\"button\" value=\"Capture\" onclick=\"window.location.href='capture.php?tx_id=" . $req->get_bptid() . "'\" />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_calculate_rates_request.php';
|
||||
|
||||
$req = new ipl_calculate_rates_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_rate_request_params(26805, 27455);
|
||||
$req->set_locale("DEU", "EUR", "de");
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if (!$req->has_error()) {
|
||||
echo 'Response data:<br />';
|
||||
echo '<pre>';
|
||||
print_r($req->get_options());
|
||||
echo '</pre>';
|
||||
}
|
||||
else {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*
|
||||
* This request should be used in case the merchant-side unique order ID for
|
||||
* the order is only known AFTER the capture request has already been sent.
|
||||
* In this case the billpay transation id (tx_id) that is obtained from the
|
||||
* result of the preauthorize request should be used as a "temporary order id" in
|
||||
* the capture request. The update order request should be sent after the order
|
||||
* is created and therefor the order id is known.
|
||||
*
|
||||
* Please note that it is absolutely necessary that no user action takes place
|
||||
* between the capture request and the update order request!
|
||||
*/
|
||||
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_update_order_request.php';
|
||||
|
||||
// This is the order reference from the capture request
|
||||
$tx_id = $_GET["tx_id"];
|
||||
$ref = $_GET["ref"];
|
||||
$refUpdated = $ref . '_foo';
|
||||
|
||||
// The order ID must be unique -> generate a random number for this example
|
||||
$orderReference = rand(1, 15000000000);
|
||||
|
||||
$req = new ipl_update_order_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_update_params($tx_id, $refUpdated);
|
||||
$req->add_id_update("article001", "article001_mod");
|
||||
$req->add_id_update("article002", "article002_mod");
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
}
|
||||
else {
|
||||
echo "Update order successful!<br />";
|
||||
echo "<input type=\"button\" value=\"Invoice\" onclick=\"window.location.href='invoicecreated.php?ref=$refUpdated'\" />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
/**
|
||||
* @author Jan Wehrs (jan.wehrs@billpay.de)
|
||||
* @copyright Copyright 2010 Billpay GmbH
|
||||
* @license commercial
|
||||
*/
|
||||
require_once '../../api/ipl_xml_api.php';
|
||||
require_once '../../api/php5/ipl_validation_request.php';
|
||||
|
||||
$req = new ipl_validation_request($_SESSION['api-url-base']);
|
||||
$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
|
||||
$req->set_customer_details("123456", "e", "Herr", "", "Tamlin", "Wallder",
|
||||
"Wanderweg", "6", "", "24857", "Borgwedel",
|
||||
"DEU", "demo@billpay.de", "0302333459", "01775112389",
|
||||
"19850911", "de", "85.214.7.22");
|
||||
|
||||
$req->set_shipping_details(true);
|
||||
|
||||
try {
|
||||
$req->send();
|
||||
|
||||
if ($req->has_error()) {
|
||||
echo "Error occured!<br />";
|
||||
echo "Error code: " . $req->get_error_code() . "<br />";
|
||||
echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
|
||||
echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
|
||||
}
|
||||
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
|
||||
echo "<br /><br />";
|
||||
echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
|
||||
}
|
||||
catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user