當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gateway::getPayment方法代碼示例

本文整理匯總了PHP中Gateway::getPayment方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gateway::getPayment方法的具體用法?PHP Gateway::getPayment怎麽用?PHP Gateway::getPayment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gateway的用法示例。


在下文中一共展示了Gateway::getPayment方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * @dataProvider getPayment
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $instance = Gateway::getPayment(['wechat' => 'native']);
     $this->object = new Pay($instance);
 }
開發者ID:ljimmy,項目名稱:pay,代碼行數:10,代碼來源:PayTest.php

示例2: testGetPayment

 /**
  * @covers pay\Gateway::getPayment
  * @todo   Implement testGetPayment().
  */
 public function testGetPayment()
 {
     $instance = $this->object->getPayment(array('wechat' => 'jsapi'));
     $this->assertInstanceOf('pay\\gateway\\GatewayInterface', $instance);
 }
開發者ID:ljimmy,項目名稱:pay,代碼行數:9,代碼來源:GatewayTest.php

示例3: Pay

$object = new Pay($instance);
$data = array('subject' => 'test', 'out_trade_no' => date('Ymd') . mt_rand(10000, 99999), 'total_amount' => 0.01);
try {
    $result = $object->createOrder($data);
    var_dump('alipay_qrcode:');
    var_dump($result);
} catch (\Exception $e) {
    var_dump('alipay_qrcode:' . $e->getMessage());
}
//手機網站即時到賬支付
$instance = Gateway::getPayment(['alipay' => 'wap']);
$object = new Pay($instance);
$data = array('subject' => 'test', 'out_trade_no' => date('Ymd') . mt_rand(10000, 99999), 'total_fee' => 0.01, 'show_url' => 'http://www.lohas100.com');
try {
    $result = $object->createOrder($data);
    var_dump('alipay_wap:');
    var_dump($result);
} catch (\Exception $e) {
    var_dump('alipay_wap:' . $e->getMessage());
}
//即時到賬支付
$instance = Gateway::getPayment(['alipay' => 'wap']);
$object = new Pay($instance);
$data = array('subject' => 'test', 'out_trade_no' => date('Ymd') . mt_rand(10000, 99999), 'total_fee' => 0.01);
try {
    $result = $object->createOrder($data);
    var_dump('alipay_web:');
    var_dump($result);
} catch (\Exception $e) {
    var_dump('alipay_web:' . $e->getMessage());
}
開發者ID:ljimmy,項目名稱:pay,代碼行數:31,代碼來源:index.php


注:本文中的Gateway::getPayment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。