万事达卡Masterpass require_once(XML / Parser.php):无法打开流:

时间:2019-05-29 09:45:15

标签: php mastercard

我正在尝试通过以下链接使用PHP实现万事达卡付款接口:https://developer.mastercard.com/page/masterpass-sdk-details-v2#php

我已经成功创建了项目,以下是我的文件结构: enter image description here

但是,当我运行以下应用程序代码时:

include_once '../masterpass/vendor/masterpass/mpasscoresdk/MasterCardCoreSDK.phar';
include_once '../masterpass/vendor/masterpass/merchantcheckoutsdk/MastercardMerchantCheckout.phar';

use MasterCardCoreSDK\MasterCardApiConfig;
use MasterCardCoreSDK\Configuration;

MasterCardApiConfig::$consumerKey = "K9gWPCijgmDohuujBZmP4orfiuMZJTiSns84RFHK7bbbffdb!6ec600e361734cf6a875ed42e8fd29c80000000000000000";
MasterCardApiConfig::$privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJMZbbNaQW1RsZ
yo72V1eQ+X462kDSs1UYbn06fj0Hj0+l+HBUNFDxkNw9fhKkREoZT/Memg+HPuFz
zrPOnRGRwF5F37Pa/Gc5/Vp7LZ6H5/nWoXuUOO1QH2kCgBPoL2dlhQ6j0/thm0oN
CQ4sY9WAPLYSvGiAn3sBDaIEhlJ7tZ17cxko+fgGsgpspdEDDHx944Wa1BuqGVHO
RFPc4DOTIWOb7+dpgma7wFwx/qbYt2WElo/nX/ZJWUq5MraJ9I3KXAt/HL2t0zQW
rk0+JvbY+Kqkfe7OPCTcQEIZWJ+SLs9tQ0E6/pypKJozMNFokuQt3Oaal4HaD3sM
w+Fsr2g1AgMBAAECggEADG0hbNl+81J6Eev25vkiRU9Tz6DVHkCABKZ9UT796CFi
5XWLNxVF/5tPV4KDzb0huQk0zCDIJ0faw9KFFsHDRaBW6Z1JfRw/fVElUOLg6Q5p
4rbdqp89X3R43nEbXHxusRNMMCqTKlQWcPfRANRKEkNtemT2UjAfxAioFCDWd73p
eAGpJxcQFO9Wi1gJmv27moXUHvf2iRopEuYtWEPd3su9by+zyqaIiUVJtDObwLOv
ggSc9yDfK39M2roBD4XeOVUx3O0oTADOcZlDS85kbNCngtr2ClkDdhfPMdpG5G06
nCeqlfluYW78808urF9etiLLIvH1WcxCoWuHxbgSAQKBgQDE7fAtCY2lgksVHVBV
2K0wCEWEKZEZkHaVzuv76LTTfQHb65EAmWu3474NCpGFv0siJnue3TKsNnCQ+JSy
i+Yo7WXgIuZ5WB4/yarckupcMy/XgkLovonB6BlrW0YJwFjKyFviJGABNb5eltHA
4s7qMeo3FZTnBkMYEVq0AHuozQKBgQCyWJbiFcDi58qEX/Sp9Ox4Q9+d3yUZg96s
QO4Ro2JQGdlPU1cu0bahveG/6L/vO0IplzMi58TS2xU3mEzGK0yX9ae2p3eYH339
24RDmTkk3BPZ4fORN8JaBZs5sI25ESQIYS7X8d/403Ez6+QnfDCF0ntBjsu8IbOz
IA/EfBRdCQKBgGoOdr3amkVboVISwnQpSERJAB9IP5PUAHl3whGd5tzLQxgMisAW
4DNd3LmrSmoMdstCjGsnV6X1f7Qjm/l4bJD4IViPky4grdHOq001djAHhSl8RsqP
6yLZ++6cbmDMDUXQl+N3kZi1N/w7H2XRAHySO0BFSDcPYUzx87ZjWDW1AoGBAJzP
RcL9q34Wnbrsf7vbzPslen1d0Unw551+7ZP2mx+gyrBzr6lL3Q+zW8WYCQJ4kQDu
n5imPinDVZFvSLnJImxOIyt3bbEEp4vIMjAZjeP52T5u6/CYHTt3yHbd5I5/IrZ3
dG+MjQhEKTmkxBNvn15apeMLgdklrNHnc9Wn32O5AoGATeVlItFbR0E1FMDkOutH
6ofL1Ew+rnhMq6tbB1SRaVJ9zk7NJbUsndw1Ya9XVdBqVuhuweI9VuBeg4QcfeJ/
9ZC75WVs4W2U/omCdv5+DiBNku8rmHp7sx/VeCPRisaARR/LuzifT2RT1S434s1x
j+UUCmR4Fj9tEdyNd1GWnl8=";
MasterCardApiConfig::setSandBox(true); // For sandbox environment
MasterCardApiConfig::setSandBox(false); // For production environment 
// SSL Configuration if not set in php.ini  
// Note: If proxy is set then use cacert for proxy server
$conf = new Configuration();
$conf->setSSLVerification("C:\\Users\\Documents\\cert.pem");
Configuration::setDefaultConfiguration($conf);


//Proxy setup (optional)
// Example for http proxy
MasterCardApiConfig::$proxy = "http://127.0.0.1:8585";

// Example for https proxy
MasterCardApiConfig::$proxy = ['https' => '127.0.0.1:8585'];

// Example to setup http and https proxy
MasterCardApiConfig::$proxy = [
    'http' => '127.0.0.1:8585',
    'https' => '127.0.0.1:8585'
];

我收到以下错误:

Warning: require_once(XML/Parser.php): failed to open stream: No such file or directory in phar://C:/xampp/htdocs/masterpass/vendor/masterpass/mpasscoresdk/MasterCardCoreSDK.phar/XML/Unserializer.php on line 58

Fatal error: require_once(): Failed opening required 'XML/Parser.php' (include_path='phar://C:\xampp\htdocs\masterpass\vendor\masterpass\mpasscoresdk\MasterCardCoreSDK.phar;C:\xampp\php\PEAR') in phar://C:/xampp/htdocs/masterpass/vendor/masterpass/mpasscoresdk/MasterCardCoreSDK.phar/XML/Unserializer.php on line 58

如何解决库中遇到的配置文件问题。

以下是我的作曲家列表:

{
    "require": {
        "guzzlehttp/guzzle":"6.0.0",
        "apache/log4php": "2.3.0",
        "pear/xml_parser": "1.3.7",
        "pear/xml_util": "1.4.3",
        "masterpass/mpasscoresdk": "2.3.0",
        "masterpass/merchantcheckoutsdk":"2.3.0"
    }
}

0 个答案:

没有答案