【发布时间】:2017-09-28 23:00:59
【问题描述】:
我在 laravel 包中的 paypal_url 有问题:返回 null。
我正在使用这个包:https://github.com/srmklive/laravel-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"
}
我不知道我做错了什么,只是我按照包的文档。但是应该有什么问题。有人可以帮助我吗?
【问题讨论】:
-
看起来某处有错误:“type”=>“error”?这可能就是你没有链接去的原因
-
但是我已经设置了 return-url 和 cancel_url 及其对应的 url...
-
在本地主机上不起作用,但是,在服务器上工作...谢谢...
-
我在自适应支付模式下面临同样的事情,成功交易我没有得到任何东西。您对srmklive/laravel-paypal中的自适应支付有任何想法
-
不应该在本地主机...应该在线,可以访问网络的东西...
标签: php paypal laravel-5.4 paypal-sandbox