本文整理汇总了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);
}
示例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);
}
示例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());
}