lapalvel中的paypal_link = null包:srmklive / laravel-paypal

时间:2017-09-28 23:01:00

标签: php paypal laravel-5.4 paypal-sandbox

我在laravel包中遇到了paypal_url的问题:return 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"
}

我不知道自己做得不好,只是我按照包裹的说明进行操作。但有些事情应该是错的。有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

在本地主机上测试签出时,必须将此选项标记为false:

'validate_ssl'   => false

否则,它将给您该错误。