1.首先需要获取paypal的授权信息,参考:http://www.fecshop.com/topic/297
2.需要进行配置,打开配置文件:
@common/config/fecshop_local_services/Payment.php
paypal是有两种支付方式,购物车快捷支付
和标准支付
:
2.1标准支付配置:
'paypal_standard' => [
'start_url' => '@homeUrl/payment/paypal/standard/start',
'nvp_url' => 'https://api-3t.sandbox.paypal.com/nvp',
'api_url' => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
'account' => 'zqy234api1-facilitator_api1.126.com',
'password' => 'HF4TNTTXUD6YQREH',
'signature'=> 'An5ns1Kso7MWUdW4ErQKJJJ4qi4-ANB-xrkMmTHpTszFaUx2v4EHqknV',
'label'=> 'PayPal Express Payments',
// 跳转到paypal确认后,返回fecshop的url
'return_url' => '@homeUrl/payment/paypal/standard/review',
// 取消支付后,返回fecshop的url
'cancel_url' => '@homeUrl/payment/paypal/standard/cancel',
// 支付成功后,返回fecshop的url
'success_redirect_url' => '@homeUrl/payment/success',
// IPN地址
'ipn_url' => '@homeUrl/payment/paypal/standard/ipn',
],
将上面的配置中nvp_url
api_url
改成下面的url
'nvp_url' => 'https://api-3t.paypal.com/nvp',
'api_url' => 'https://www.paypal.com/cgi-bin/webscr',
account
password
ignature
为上面步骤1得到的信息
2.2 购物车快捷支付
'express' => [ // 在购物车页面直接跳转到支付平台,譬如paypal快捷支付方式。
'paypal_express' => [
'nvp_url' => 'https://api-3t.sandbox.paypal.com/nvp',
'api_url' => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
'account' => 'zqy234api1-facilitator_api1.126.com',
'password' => 'HF4TNTTXUD6YQREH',
'signature'=> 'An5ns1Kso7MWUdW4ErQKJJJ4qi4-ANB-xrkMmTHpTszFaUx2v4EHqknV',
'label'=> 'PayPal Express Payments',
// 跳转到paypal确认后,返回fecshop的url
'return_url' => '@homeUrl/payment/paypal/express/review',
// 取消支付后,返回fecshop的url
'cancel_url' => '@homeUrl/payment/paypal/express/cancel',
// 支付成功后,返回fecshop的url
'success_redirect_url' => '@homeUrl/payment/success',
// IPN地址
'ipn_url' => '@homeUrl/payment/paypal/express/ipn',
],
],
修改和2.1一样。一样的原理,需要更改 nvp_url
api_url
account
password
ignature
等配置