当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::setApiUrl方法代码示例

本文整理汇总了PHP中Client::setApiUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::setApiUrl方法的具体用法?PHP Client::setApiUrl怎么用?PHP Client::setApiUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client的用法示例。


在下文中一共展示了Client::setApiUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startTransaction

 function startTransaction()
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     try {
         $order_id = time();
         $order = $msp->orders->post(array("type" => "redirect", "order_id" => $order_id, "currency" => "EUR", "amount" => 2000, "description" => "Demo Transaction", "var1" => "", "var2" => "", "var3" => "", "items" => "items list", "manual" => "false", "gateway" => "KLARNA", "days_active" => "30", "payment_options" => array("notification_url" => BASE_URL . "notificationController.php?type=initial", "redirect_url" => BASE_URL . "mainController.php?view=klarnaComplete", "cancel_url" => BASE_URL . 'cancelController.php', "close_window" => "true"), "customer" => array("locale" => "nl_NL", "ip_address" => "127.0.0.1", "forwarded_ip" => "127.0.0.1", "first_name" => "Testperson-nl", "last_name" => "Approved", "address1" => "Neherkade", "address2" => "", "house_number" => "1 XI", "zip_code" => "2521VA", "city" => "Gravenhage", "state" => "Zuid holland", "country" => "NL", "phone" => "0612345678", "email" => "test@test.nl"), "gateway_info" => array("birthday" => "10071970", "bank_account" => "", "phone" => "0612345678", "referrer" => "http://google.nl", "user_agent" => "msp01", "gender" => "male", "email" => "test@test.nl"), "shopping_cart" => array("items" => array(array("name" => "Test", "description" => "", "unit_price" => "10", "quantity" => "2", "merchant_item_id" => "test123", "tax_table_selector" => "BTW0", "weight" => array("unit" => "KB", "value" => "20")))), "checkout_options" => array("tax_tables" => array("default" => array("shipping_taxed" => "true", "rate" => "0.21"), "alternate" => array(array("standalone" => "true", "name" => "BTW0", "rules" => array(array("rate" => "0.00")))))), "plugin" => array("shop" => "MultiSafepay Toolkit", "shop_version" => TOOLKIT_VERSION, "plugin_version" => TOOLKIT_VERSION, "partner" => "MultiSafepay", "shop_root_url" => "http://www.demo.nl")));
         header("Location: " . $msp->orders->getPaymentLink());
     } catch (Exception $e) {
         echo "Error " . htmlspecialchars($e->getMessage());
     }
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:13,代码来源:klarnaController.php

示例2: startDirectTransaction

 function startDirectTransaction($issuer)
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     try {
         $order_id = time();
         $order = $msp->orders->post(array("type" => "direct", "order_id" => $order_id, "currency" => "EUR", "amount" => 1000, "description" => "Demo Transaction", "var1" => "1", "var2" => "2", "var3" => "3", "items" => "items list", "manual" => "false", "gateway" => "IDEAL", "days_active" => "30", "payment_options" => array("notification_url" => BASE_URL . "notificationController.php?type=initial", "redirect_url" => BASE_URL . "mainController.php?view=idealComplete", "cancel_url" => BASE_URL . 'cancelController.php', "close_window" => "true"), "customer" => array("locale" => "nl_NL", "ip_address" => "127.0.0.1", "forwarded_ip" => "127.0.0.1", "first_name" => "Jan", "last_name" => "Modaal", "address1" => "Kraanspoor", "address2" => "", "house_number" => "39", "zip_code" => "1032 SC", "city" => "Amsterdam", "state" => "", "country" => "NL", "phone" => "0208500500", "email" => "test@test.nl"), "gateway_info" => array("issuer_id" => $issuer), "plugin" => array("shop" => "MultiSafepay Toolkit", "shop_version" => TOOLKIT_VERSION, "plugin_version" => TOOLKIT_VERSION, "partner" => "MultiSafepay", "shop_root_url" => "http://www.demo.nl")));
         header("Location: " . $msp->orders->getPaymentLink());
     } catch (Exception $e) {
         echo "Error " . htmlspecialchars($e->getMessage());
     }
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:13,代码来源:idealController.php

示例3: startTransaction

 function startTransaction()
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     try {
         $order_id = time();
         $order = $msp->orders->post(array("type" => "checkout", "order_id" => $order_id, "currency" => "EUR", "amount" => 2000, "description" => "Demo Transaction", "var1" => "", "var2" => "", "var3" => "", "items" => "items list", "manual" => "false", "gateway" => "", "days_active" => "30", "payment_options" => array("notification_url" => BASE_URL . "notificationController.php?type=initial", "redirect_url" => BASE_URL . "mainController.php?view=fastcheckoutComplete", "cancel_url" => BASE_URL . 'cancelController.php', "close_window" => "true"), "customer" => array("locale" => "nl_NL", "ip_address" => "127.0.0.1", "forwarded_ip" => "127.0.0.1", "first_name" => "Jan", "last_name" => "Modaal", "address1" => "Kraanspoor", "address2" => "", "house_number" => "39", "zip_code" => "1032 SC", "city" => "Amsterdam", "state" => "", "country" => "NL", "phone" => "0208500500", "email" => "test@test.nl"), "gateway_info" => array("birthday" => "1980-01-30", "bank_account" => "2884455", "phone" => "0208500500", "referrer" => "http://google.nl", "user_agent" => "msp01"), "shopping_cart" => array("items" => array(array("name" => "Test", "description" => "", "unit_price" => "10", "quantity" => "2", "merchant_item_id" => "test123", "tax_table_selector" => "BTW0", "weight" => array("unit" => "KB", "value" => "20")))), "checkout_options" => array("no-shipping-methods" => false, "shipping_methods" => array("flat_rate_shipping" => array(array("name" => "Post Nl - verzending NL", "price" => "7", "currency" => "", "allowed_areas" => array("NL")), array("name" => "TNT verzending", "price" => "9", "excluded_areas" => array("NL", "FR", "ES"))), "pickup" => array("name" => "Ophalen", "price" => "0")), "tax_tables" => array("default" => array("shipping_taxed" => "true", "rate" => "0.21"), "alternate" => array(array("standalone" => "true", "name" => "BTW0", "rules" => array(array("rate" => "0.00")))))), "custom_fields" => array(array("standard_type" => "birthday"), array("standard_type" => "companyname")), "plugin" => array("shop" => "MultiSafepay Toolkit", "shop_version" => TOOLKIT_VERSION, "plugin_version" => TOOLKIT_VERSION, "partner" => "MultiSafepay", "shop_root_url" => "http://www.demo.nl")));
         header("Location: " . $msp->orders->getPaymentLink());
     } catch (Exception $e) {
         echo "Error " . htmlspecialchars($e->getMessage());
     }
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:13,代码来源:fastcheckoutController.php

示例4: getDetails

 function getDetails()
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     try {
         $transactionid = '1437027267';
         //get the order
         $order = $msp->orders->get($endpoint = 'orders', $transactionid, $body = array(), $query_string = false);
     } catch (Exception $e) {
         echo "Error " . htmlspecialchars($e->getMessage());
     }
     return $order;
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:14,代码来源:detailsController.php

示例5: startTransaction

 function startTransaction()
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     try {
         $order_id = time();
         $order = $msp->orders->post(array("type" => "direct", "order_id" => $order_id, "currency" => "EUR", "amount" => 1000, "description" => "Demo Transaction", "gateway" => "DIRDEB", "recurring_id" => "9985046659087797728", "days_active" => "30"));
         //do redirect to recurring view
         $return_url = substr(BASE_URL, 0, -12) . 'index.php?view=recurringComplete';
         header("Location: " . $return_url);
     } catch (Exception $e) {
         echo "Error " . htmlspecialchars($e->getMessage());
     }
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:15,代码来源:recurringController.php

示例6: doRefund

 public function doRefund()
 {
     $msp = new Client();
     $msp->setApiKey($this->api_key);
     $msp->setApiUrl($this->api_url);
     $transactionid = $_GET['transactionid'];
     //get the order status
     $order = $msp->orders->get($type = 'orders', $transactionid, $body = array(), $query_string = false);
     if ($order->status == "completed") {
         //the transaction status was competed, now we will refund the transaction
         $endpoint = 'orders/' . $transactionid . '/refunds';
         try {
             $order = $msp->orders->post(array("type" => "refund", "amount" => "20", "currency" => "EUR", "description" => "PHP Wrapper Toolkit Refund"), $endpoint);
         } catch (Exception $e) {
             echo "Error " . htmlspecialchars($e->getMessage());
         }
     }
     $return_url = substr(BASE_URL, 0, -12) . 'index.php?view=refundComplete';
     header("location: " . $return_url);
 }
开发者ID:BradCrumb,项目名称:PHP,代码行数:20,代码来源:refundController.php

示例7: createFromArray

 /**
  * Creates a new instance of Client
  * @param array $options
  * @return Client
  */
 public function createFromArray($options)
 {
     $instance = new Client();
     $instance->setNetworkId($options['networkId']);
     $instance->setApiUrl($options['url']);
     $instance->setLogin($options['login']);
     $instance->setPassword($options['password']);
     return $instance;
 }
开发者ID:2y-media,项目名称:smartadserver-api,代码行数:14,代码来源:Client.php


注:本文中的Client::setApiUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。