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


PHP PagSeguroLibrary::init方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->ci =& get_instance();
     $this->ci->load->config('pagseguro');
     PagSeguroLibrary::init();
     self::$pgEmail = $this->ci->config->item('pagseguroAccount');
     self::$pgToken = $this->ci->config->item('pagseguroToken');
 }
开发者ID:joel-medeiros,项目名称:vencendoconcursos,代码行数:8,代码来源:pagseguro.php

示例2: __construct

 public function __construct()
 {
     $this->ci =& get_instance();
     $this->ci->load->config('pagseguro');
     PagSeguroLibrary::init();
     self::$config = $this->ci->config->item('pagseguro');
     self::$environment = self::$config['environment'];
     self::$email = self::$config[self::$environment]['pagseguroAccount'];
     self::$token = self::$config[self::$environment]['pagseguroToken'];
 }
开发者ID:rcalderini,项目名称:pagseguro-codeigniter,代码行数:10,代码来源:pagseguro.php

示例3: pay

 public function pay($id)
 {
     \PagSeguroLibrary::init();
     \PagSeguroConfig::setEnvironment('production');
     $this->plan = Plans::find($id);
     $this->client = User::find(Auth::user()->id);
     $this->payment = Payments::create(['plan_name' => $this->plan->name, 'plan_value' => $this->plan->value, 'plan_id' => $this->plan->id, 'user_id' => $this->client->id, 'confirmed' => 0]);
     // Instantiate a new payment request
     $paymentRequest = new \PagSeguroPaymentRequest();
     // Set the currency
     $paymentRequest->setCurrency("BRL");
     /* // Add an item for this payment request
        $paymentRequest->addItem('0001', 'Sempre da Negócio - Plano '.$this->plan->name, 1, $this->plan->value);*/
     $paymentRequest->addItem($this->plan->id, 'Sempre da Negócio - Plano ' . $this->plan->name, 1, $this->plan->value);
     // Set a reference code for this payment request. It is useful to identify this payment
     // in future notifications.
     $paymentRequest->setReference($this->payment->id);
     //Create object PagSeguroShipping
     $shipping = new \PagSeguroShipping();
     //Set Type Shipping
     $type = new \PagSeguroShippingType(3);
     $shipping->setType($type);
     //Set address of client
     $data = array('postalCode' => $this->client->zipcode, 'street' => $this->client->address, 'number' => $this->client->number, 'city' => $this->client->city, 'state' => $this->client->state);
     $address = new \PagSeguroAddress($data);
     $shipping->setAddress($address);
     //Add Shipping to Payment Request
     $paymentRequest->setShipping($shipping);
     // Set your customer information.
     $phone = str_replace(['(', ')', ' ', '-'], ['', '', '', ''], $this->client->phone);
     $paymentRequest->setSender($this->client->name, $this->client->email_responsible, substr($phone, 0, 2), substr($phone, 2));
     try {
         /*
                      * #### Credentials #####
                      * Replace the parameters below with your credentials (e-mail and token)
                      * You can also get your credentials from a config file. See an example:
                      * $credentials = PagSeguroConfig::getAccountCredentials();
                     //  */
         $credentials = new \PagSeguroAccountCredentials($this->email, $this->token);
         // Register this payment request in PagSeguro to obtain the payment URL to redirect your customer.
         $onlyCheckoutCode = true;
         $code = $paymentRequest->register($credentials, $onlyCheckoutCode);
         return view('site.pages.confirma_pagamento', compact('code'));
     } catch (\PagSeguroServiceException $e) {
         die($e->getMessage());
     }
 }
开发者ID:jpsilveira13,项目名称:sempredanegocio,代码行数:47,代码来源:PaymentController.php

示例4: getPath

    public static final function getPath()
    {
        return self::$path;
    }
    public static final function getModuleVersion()
    {
        return self::$module_version;
    }
    public static final function setModuleVersion($version)
    {
        self::$module_version = $version;
    }
    public static final function getPHPVersion()
    {
        return self::$php_version = phpversion();
    }
    public static final function setPHPVersion($version)
    {
        self::$php_version = $version;
    }
    public static final function getCMSVersion()
    {
        return self::$cms_version;
    }
    public static final function setCMSVersion($version)
    {
        self::$cms_version = $version;
    }
}
PagSeguroLibrary::init();
开发者ID:ronal2do,项目名称:openshift-wordpress-developer-quickstart,代码行数:30,代码来源:PagSeguroLibrary.php

示例5: __construct

 public function __construct($dadosCliente)
 {
     $this->dados_cliente = $dadosCliente;
     $this->pagseguroConfig = new \PagSeguroPaymentRequest();
     \PagSeguroLibrary::init();
 }
开发者ID:skydark007,项目名称:loja-laravel5.1,代码行数:6,代码来源:Pagseguro.php

示例6: __construct

 function __construct($file)
 {
     PagSeguroLibrary::init();
     $this->pg = new PagSeguroPaymentRequest();
     $this->init($file);
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:6,代码来源:PPagSeguro.class.php

示例7: __construct

 public function __construct()
 {
     PagSeguroLibrary::init();
 }
开发者ID:novasdream,项目名称:php,代码行数:4,代码来源:PagSeguroDirectPaymentRequest.class.php

示例8: testDependencies

 public function testDependencies()
 {
     $this->assertInstanceOf('PagSeguroLibrary', PagSeguroLibrary::init());
 }
开发者ID:songinfo,项目名称:php,代码行数:4,代码来源:BasicTest.php


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