我正在尝试将PayPal SDK集成到我的网站中,但遇到了一个我无法在文档中或通过Stackoverflow找到解决方案的问题.
我使用标准设置:
start.php:
<?php
//require 'vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;
define('BASE_URL', 'http://localhost:80/paypaltut/');
if(!defined("PP_CONFIG_PATH")){
define('PP_CONFIG_PATH', '../vendor/paypal/rest-api-sdk-php/tests/');
}
$clientid = 'ARe54bHOzRcn13nRglDpIst46bWOp6pyBRYlP4nulwwTL2ivIuKlIJrUp5LdgZfuC0qPbqIuGdVFsmeK';
$clientsecret = 'EJarieZ8B_6WEZ__gZl0uS-Dmc-ypa1RH1joF1u4_XlJje2IINBRCsARhNyZk-dJG7kBJS8ceQF5GNVr';
$apiContext = new ApiContext(new OAuthTokenCredential($clientid, $clientsecret));
Run Code Online (Sandbox Code Playgroud)
index.php文件:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Scripts-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="../scripts/modernizr.js"> </script> <!-- Modernizr -->
<!--Stylesheets-->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../CSS/reset.css"> <!-- CSS reset -->
<link rel="stylesheet" href="css/"> <!-- Resource style -->
<link rel="stylesheet" href="css/ongakuStandard.css"> …Run Code Online (Sandbox Code Playgroud)