public function setUp() { parent::setUp(); $this->gateway = new ExpressGateway($this->getHttpClient(), $this->getHttpRequest()); $this->gateway->setPartner('20880127040'); $this->gateway->setKey('sc1n78r0faswga7jjrpf6o'); $this->gateway->setSellerEmail('*****@*****.**'); $this->gateway->setNotifyUrl('https://www.example.com/notify'); $this->gateway->setReturnUrl('https://www.example.com/return'); $this->options = array('out_trade_no' => '2014010122390001', 'subject' => 'test', 'total_fee' => '0.01'); }
/** * @param array|null $config * @return \Omnipay\Alipay\ExpressGateway */ public function alipay(array $config = null) { $returnUrl = url('pay/alipay/return'); $notifyUrl = url('pay/alipay/notify'); $gateway = new AlipayExpressGateway(); if (is_null($config)) { $config = Config::get('payments.alipay'); } $gateway->setPartner(array_get($config, 'id')); $gateway->setKey(array_get($config, 'key')); $gateway->setSellerEmail(array_get($config, 'email')); $gateway->setNotifyUrl($notifyUrl); $gateway->setReturnUrl($returnUrl); return $gateway; }