我在laravel包中的paypal_url有一个问题:返回null。
我正在使用这个包: https:/github.comsrmklivelaravel-paypal。
这是变量$response的输出。
`array:3 [▼
"type" => "error"
"message" => ""
"paypal_link" => null
]`
而另一个变量$provider的输出则是返回我所有的配置。
ExpressCheckout {#309 ▼
-client: Client {#307 ▼
-config: array:8 [▼
"curl" => array:2 [▼
32 => 6
64 => false
]
"handler" => HandlerStack {#313 ▼
-handler: Closure {#316 ▼
class: "GuzzleHttp\Handler\Proxy"
parameters: {▼
$request: {▼
typeHint: "Psr\Http\Message\RequestInterface"
}
$options: {▼
typeHint: "array"
}
}
use: {▼
$default: Closure {#311 …}
$streaming: StreamHandler {#317 …}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php"
line: "49 to 53"
}
-stack: array:4 [▼
0 => array:2 [▼
0 => Closure {#319 ▼
class: "GuzzleHttp\Middleware"
parameters: {▶}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "54 to 69"
}
1 => "http_errors"
]
1 => array:2 [▼
0 => Closure {#320 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "148 to 150"
}
1 => "allow_redirects"
]
2 => array:2 [▼
0 => Closure {#321 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "27 to 43"
}
1 => "cookies"
]
3 => array:2 [▼
0 => Closure {#322 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "216 to 218"
}
1 => "prepare_body"
]
]
-cached: Closure {#334 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$request: {}
$options: {▼
typeHint: "array"
}
}
use: {▼
$handler: RedirectMiddleware {#330 …}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "55 to 68"
}
}
"allow_redirects" => array:5 [▼
"max" => 5
"protocols" => array:2 [▼
0 => "http"
1 => "https"
]
"strict" => false
"referer" => false
"track_redirects" => false
]
"http_errors" => true
"decode_content" => true
"verify" => true
"cookies" => false
"headers" => array:1 [▼
"User-Agent" => "GuzzleHttp/6.2.1 curl/7.54.0 PHP/7.0.17"
]
]
}
+mode: "sandbox"
#post: Collection {#328 ▼
#items: array:23 [▼
"L_PAYMENTREQUEST_0_NAME0" => "Otra vez COn Pendejadas-general"
"L_PAYMENTREQUEST_0_AMT0" => "82.28"
"L_PAYMENTREQUEST_0_QTY0" => 2
"L_PAYMENTREQUEST_0_NAME1" => "Puras Pendejadas-general"
"L_PAYMENTREQUEST_0_AMT1" => "77.44"
"L_PAYMENTREQUEST_0_QTY1" => 2
"PAYMENTREQUEST_0_ITEMAMT" => 319.44
"PAYMENTREQUEST_0_AMT" => 319.44
"PAYMENTREQUEST_0_PAYMENTACTION" => "Sale"
"PAYMENTREQUEST_0_CURRENCYCODE" => "USD"
"PAYMENTREQUEST_0_DESC" => "Order #13 Invoice"
"PAYMENTREQUEST_0_INVNUM" => "CETICKETS_13"
"NOSHIPPING" => 1
"RETURNURL" => "https://ce-tickets.dev/payment/success"
"CANCELURL" => "https://ce-tickets.dev/order/cancel"
"LOCALE" => "en_US"
"L_BILLINGTYPE0" => "MerchantInitiatedBilling"
"L_BILLINGAGREEMENTDESCRIPTION0" => "Order #13 Invoice"
"USER" => "xxx"
"PWD" => "xxxx"
"SIGNATURE" => "xxxx"
"VERSION" => 123
"METHOD" => "SetExpressCheckout"
]
}
-config: array:11 [▼
"username" => "xxxx"
"password" => "xxxx"
"secret" => "xxxx"
"certificate" => ""
"app_id" => "APP-xxx"
"signature" => "xx"
"api_url" => "https://api-3t.sandbox.paypal.com/nvp"
"gateway_url" => "https://www.sandbox.paypal.com"
"payment_action" => "Sale"
"notify_url" => ""
"locale" => ""
]
-currency: "USD"
-options: []
-paymentAction: "Sale"
-locale: "en_US"
-apiUrl: "https://api-3t.sandbox.paypal.com/nvp"
-notifyUrl: ""
-httpBodyParam: "form_params"
}
我不知道我做错了什么, 我只是按照包的文档来做. 但应该是有问题的。谁能帮帮我?
当你在本地主机上测试结账时,你必须把这个选项标记为false。
'validate_ssl' => false
否则它会给你这个错误。