本文整理汇总了PHP中Environment::setSubscriptionsCustomUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::setSubscriptionsCustomUrl方法的具体用法?PHP Environment::setSubscriptionsCustomUrl怎么用?PHP Environment::setSubscriptionsCustomUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::setSubscriptionsCustomUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($isCashPayment = false, $credentials = array())
{
PayU::$language = SupportedLanguages::ES;
//Seleccione el idioma.
if (sizeof($credentials) > 0) {
if (isset($credentials['accountID'])) {
$this->setAccountID($credentials['accountID']);
}
if (isset($credentials['apiKey'])) {
$this->setApiKey($credentials['apiKey']);
}
if (isset($credentials['apiLogin'])) {
$this->setApiLogin($credentials['apiLogin']);
}
if (isset($credentials['merchantId'])) {
$this->setMerchantId($credentials['merchantId']);
}
}
// URL de Pagos
Environment::setPaymentsCustomUrl("https://api.payulatam.com/payments-api/4.0/service.cgi");
// URL de Consultas
Environment::setReportsCustomUrl("https://api.payulatam.com/reports-api/4.0/service.cgi");
// URL de Suscripciones para Pagos Recurrentes
Environment::setSubscriptionsCustomUrl("https://api.payulatam.com/payments-api/rest/v4.3/");
//Informacion para conexion de SDK
PayU::$apiKey = $this->getApiKey();
PayU::$apiLogin = $this->getApiLogin();
PayU::$merchantId = $this->getMerchantId();
}
示例2: date
* @author nick
* @since 2015/12/09
*
*/
require_once 'payulib/PayU.php';
$startTime = date('Y-m-d H:i:s');
PayU::$apiKey = "6u39nqhq8ftd0hlvnjfs66eh8c";
PayU::$merchantId = "500238";
PayU::$apiLogin = "11959c415b33d0c";
PayU::$language = SupportedLanguages::ES;
PayU::$isTest = false;
Environment::setPaymentsCustomUrl("https://stg.api.payulatam.com/payments-api/4.0/service.cgi");
// Queries URL
Environment::setReportsCustomUrl("https://stg.api.payulatam.com/reports-api/4.0/service.cgi");
// Subscriptions for recurring payments URL
Environment::setSubscriptionsCustomUrl("https://stg.api.payulatam.com/payments-api/rest/v4.3/");
//---------------get order by order_test.php--------------------------
$filename = 'createOrderId.php';
$handle = fopen($filename, "r");
$order_id = fread($handle, filesize($filename));
fclose($handle);
$netOrder = $order_id + 1;
file_put_contents($filename, $netOrder);
//orderid = orderid + 1 in order_test.php
//---------------get order by order_test.php--------------------------
$reference = "comprame_test_" . $order_id;
$parameters = array(PayUParameters::ACCOUNT_ID => "500538", PayUParameters::REFERENCE_CODE => $reference, PayUParameters::DESCRIPTION => $reference, PayUParameters::VALUE => "20000", PayUParameters::CURRENCY => "COP", PayUParameters::BUYER_STREET => "calle 100", PayUParameters::BUYER_STREET_2 => "5555487", PayUParameters::BUYER_CITY => "Medellin", PayUParameters::BUYER_STATE => "Antioquia", PayUParameters::BUYER_COUNTRY => "CO", PayUParameters::BUYER_PHONE => "7563126", PayUParameters::BUYER_EMAIL => "nick@comprame.com", PayUParameters::PAYER_NAME => "11111111111111111", PayUParameters::PAYER_DNI => "5415668464654", PayUParameters::PAYMENT_METHOD => PaymentMethods::BANK_REFERENCED, PayUParameters::COUNTRY => PayUCountries::CO, PayUParameters::EXPIRATION_DATE => date("Y-m-d\\TH:i:s", strtotime("+7 days")), PayUParameters::IP_ADDRESS => "127.0.0.1", PayUParameters::PAYER_COOKIE => "pt1t38347bs6jc9ruv2ecpv7o2", PayUParameters::USER_AGENT => "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0");
$response = PayUPayments::doAuthorizationAndCapture($parameters);
if ($response) {
echo "orderId:" . $response->transactionResponse->orderId . "<br>";
echo "transactionId:" . $response->transactionResponse->transactionId . "<br>";
示例3: orderVerify
private function orderVerify($value)
{
$response = new stdClass();
if (empty($value)) {
$response->status = "Empty Value";
$response->status_code = 201;
} else {
$response->status_code = 202;
}
require_once 'plugin/payu_sdk/PayU.php';
Environment::setPaymentsCustomUrl("https://api.payulatam.com/payments-api/4.0/service.cgi");
Environment::setReportsCustomUrl("https://api.payulatam.com/reports-api/4.0/service.cgi");
Environment::setSubscriptionsCustomUrl("https://api.payulatam.com/payments-api/rest/v4.3/");
$commerce = $this->getDataCommerce();
PayU::$apiKey = $commerce->data['APIKEY'];
// apiKey.
PayU::$apiLogin = $commerce->data['APILOGIN'];
// apiLogin.
PayU::$merchantId = $commerce->data['MERCHANTID'];
// Id de Comercio.
PayU::$language = SupportedLanguages::ES;
//Seleccione el idioma.
PayU::$isTest = true;
//Dejarlo True cuando sean pruebas.
$transaction = new stdClass();
// Código de referencia de la orden.
$parameters = array(PayUParameters::REFERENCE_CODE => $value);
$response_payu = PayUReports::getOrderDetailByReferenceCode($parameters);
foreach ($response_payu as $order) {
$order->accountId;
$order->status;
$order->referenceCode;
$order->additionalValues->TX_VALUE->value;
$order->additionalValues->TX_TAX->value;
if ($order->buyer) {
$order->buyer->emailAddress;
$order->buyer->fullName;
}
$transactions = $order->transactions;
foreach ($transactions as $transaction) {
$transaction->type;
$transaction->transactionResponse->state;
$transaction->transactionResponse->paymentNetworkResponseCode;
$transaction->transactionResponse->trazabilityCode;
$transaction->transactionResponse->responseCode;
if ($transaction->payer) {
$transaction->payer->fullName;
$transaction->payer->emailAddress;
}
}
}
$result = $this->updateDataCommerceByReference($value, $transaction);
$response->answer = $transaction;
$response->status_code = 200;
$response->status = $result->status;
return $response;
}