我正在尝试在我的网络应用程序上实现Stripe,而我在设置API密钥时遇到问题
这是我的代码:
<?php //composer autoloader require_once 'vendor/autoload.php';
$stripe = [
'publishable' =>'pk_test(public code))',
'private' => 'sk_test(private code)' ]
Stripe::setApiKey($stripe['private']);
// \Stripe\Stripe::setApiKey($stripe['private']);
?>
我尝试了两种方法,但似乎都没有。我一直收到这个错误:
解析错误:语法错误,意外&#39; \&#39; (T_NS_SEPARATOR)in 第12行的C:\ xampp \ htdocs \ stripe_test \ app \ init.php
答案 0 :(得分:0)
您错过了 /// <summary>
/// Initialize Game Item:
/// Given an Item ID, constructs a BaseGameItem object and returns it to instigator.
/// Refers to ItemInfoTable to initialize object parameters.
/// </summary>
/// Paramater - Int ID: The provided Item ID
/// Parameter - out BaseGameItem Item: The constructed object returned to the instigator.
public static void InitializeGameItem(int id, out BaseGameItem item)
{
FItemInfoData itemInfoData = ItemTable.Find(x => x.ItemID == id);
if(itemInfoData.ItemID != id)
{
itemInfoData = ItemTable[0];
}
// Check if item is a Pickup. If so, then item is returned as a PickupPlaceable.
// Otherwise, initialize to BaseGameItem.
item = itemInfoData.IsPickupItem ? new PickupPlaceable() : new BaseGameItem();
item.SetItemName(itemInfoData.ItemName);
item.SetItemDescription(itemInfoData.ItemDescription);
item.SetItemIcon(itemInfoData.ItemIcon);
item.SetItemMesh(itemInfoData.ItemMesh);
}
;