Open pbalan opened 6 years ago
What happens if you replace getDefaultParameters()
with getParameters()
?
if (null !== $paymentGateway) {
- $params = $paymentGateway->getDefaultParameters();
+ $params = $paymentGateway->getParameters();
dump($params);
Does that return the output you'd expect?
@colinodell It doesn't either. Not sure if its an issue with the custom gateway. https://github.com/lokielse/omnipay-wechatpay/blob/master/src/MwebGateway.php There's no way to set parameters. Although https://github.com/lokielse/omnipay-wechatpay/blob/master/src/BaseAbstractGateway.php has a way to set params.
I ended up changing my service definitions as below:
service.pay.alipay:
class: Omnipay\Alipay\AopPageGateway
calls:
- ['setAppId', ['%alipay_app_id%']]
- ['setSignType', ['%alipay_sign_type%']]
- ['setPrivateKey', ['%alipay_private_key%']]
- ['setAlipayPublicKey', ['%alipay_public_key%']]
- ['setNotifyUrl', ['%alipay_notify_url%']]
tags:
- { name: omnipay.gateway, alias: Alipay_AopPage }
service.pay.wechat:
class: Omnipay\WechatPay\MwebGateway
calls:
- ['setAppId', ['%wechat_app_id%']]
- ['setApiKey', ['%wechat_api_key%']]
- ['setMchId', ['%wechat_mch_id%']]
- ['setNotifyUrl', ['%wechat_notify_url%']]
tags:
- { name: omnipay.gateway, alias: WechatPay_Mweb }
And for now, I am passing in these services manually to ProcessPayment
service.
Ideally, I would prefer using one interface that is your bundle to set parameters.
Any ideas?
Sorry @pbalan, things have been quite busy for me lately. I'll try to take a closer look at this over the next few days if I get some time.
Meanwhile, if you'd like to continue debugging this, I'd recommend trying to test your code with the same payment gateway and configuration in our README file - see if you're able to access those parameters in your ProcessPayment
class. If that does work, I'd guess the problem is one of these two things:
config.yml
for any small typos, indentation issues, etc.Also, could you tell me if this issue is affecting both of the payment gateways or just one of them?
Hi,
Thanks for the great work. Really appreciate it.
I am trying to use this bundle in one of my project as follows:
service.pay.wechat: class: Omnipay\WechatPay\MwebGateway tags:
service.process.payment: class: AppBundle\Service\ProcessPayment arguments: