title: How do I use omnipay to send a payment without credit card details using Paypal express checkout?
body: <p>Hi I noticed that there are 3 example requests in examples.</p>
  
  <p>authorize
  purchase
  capture</p>
  
  <p>I keep getting Security Header invalid error messages so I tried to write my own code to test.</p>
  
  <p>All I want to do is to set off a purchase via express checkout without sending credit card details.</p>
  
  <p>My code thus far:</p>
  
  <pre><code>&lt;?php
  
  
  echo 'testing the omnipay';
  
  require __DIR__.'/../Vendor/autoload.php';
  
  use Omnipay\Common\GatewayFactory;
  
  $gateway = GatewayFactory::create('PayPal_Express');
  $gateway-&gt;setUsername('some_username');
  $gateway-&gt;setPassword('some_password');
  $gateway-&gt;setSignature('some_signature');
  $gateway-&gt;setTestMode(true);
  
  echo 'start';
  $params = array(
      'amount' =&gt; '1.99',
      'currency' =&gt; 'SGD',
      'description' =&gt; 'test purchase',
      'transactionId' =&gt; '123',
      'transactionReference' =&gt; '123ref',
      'returnUrl' =&gt; 'http://localhost:8000/gateways/PayPal_Express/completeAuthorize',
      'cancelUrl' =&gt; 'http://localhost:8000/gateways/PayPal_Express/authorize',
  
   );
  
  
  echo 'end';
  
  $response = $gateway-&gt;capture($params);
  echo 'after capture';
  echo '&lt;pre&gt; ';
  print_r ($response);
  echo '&lt;/pre&gt; ';
  </code></pre>
  
  <p>My output is:</p>
  
  <pre><code>testing the omnipaystartendafter capture
   Omnipay\PayPal\Message\CaptureRequest Object
  (
      [liveEndpoint:protected] =&gt; https://api-3t.paypal.com/nvp
      [testEndpoint:protected] =&gt; https://api-3t.sandbox.paypal.com/nvp
      [parameters:protected] =&gt; Symfony\Component\HttpFoundation\ParameterBag Object
          (
              [parameters:protected] =&gt; Array
                  (
                      [username] =&gt; some_username
                      [password] =&gt; some_password
                      [signature] =&gt; some_signature
                      [testMode] =&gt; 1
                      [solutionType] =&gt; Sole
                      [landingPage] =&gt; Billing
                      [headerImageUrl] =&gt; 
                      [amount] =&gt; 1.99
                      [currency] =&gt; SGD
                      [description] =&gt; test purchase
                      [transactionId] =&gt; 123
                      [transactionReference] =&gt; 123ref
                      [returnUrl] =&gt; http://localhost:8000/gateways/PayPal_Express/completeAuthorize
                      [cancelUrl] =&gt; http://localhost:8000/gateways/PayPal_Express/authorize
                  )
  
          )
  
      [httpClient:protected] =&gt; Guzzle\Http\Client Object
          (
              [defaultHeaders:protected] =&gt; Guzzle\Common\Collection Object
                  (
                      [data:protected] =&gt; Array
                          (
                          )
  
                  )
  
              [userAgent:protected] =&gt; Guzzle/3.7.2 curl/7.29.0 PHP/5.4.9-4ubuntu2.2
              [config:Guzzle\Http\Client:private] =&gt; Guzzle\Common\Collection Object
                  (
                      [data:protected] =&gt; Array
                          (
                              [curl.options] =&gt; Array
                                  (
                                      [78] =&gt; 60
                                      [10065] =&gt; /var/virtual/childlabel/label-ecommerce/src/labelecommapp/Vendor/guzzle/http/Guzzle/Http/Resources/cacert.pem
                                      [64] =&gt; 1
                                      [81] =&gt; 2
                                  )
  
                          )
  
                  )
  
              [baseUrl:Guzzle\Http\Client:private] =&gt; 
              [curlMulti:Guzzle\Http\Client:private] =&gt; 
              [uriTemplate:Guzzle\Http\Client:private] =&gt; 
              [requestFactory:protected] =&gt; Guzzle\Http\Message\RequestFactory Object
                  (
                      [methods:protected] =&gt; Array
                          (
                              [getInstance] =&gt; 0
                              [__construct] =&gt; 1
                              [fromMessage] =&gt; 2
                              [fromParts] =&gt; 3
                              [create] =&gt; 4
                              [cloneRequestWithMethod] =&gt; 5
                              [applyOptions] =&gt; 6
                              [visit_headers] =&gt; 7
                              [visit_body] =&gt; 8
                              [visit_allow_redirects] =&gt; 9
                              [visit_auth] =&gt; 10
                              [visit_query] =&gt; 11
                              [visit_cookies] =&gt; 12
                              [visit_events] =&gt; 13
                              [visit_plugins] =&gt; 14
                              [visit_exceptions] =&gt; 15
                              [visit_save_to] =&gt; 16
                              [visit_params] =&gt; 17
                              [visit_timeout] =&gt; 18
                              [visit_connect_timeout] =&gt; 19
                              [visit_debug] =&gt; 20
                              [visit_verify] =&gt; 21
                              [visit_proxy] =&gt; 22
                              [visit_cert] =&gt; 23
                              [visit_ssl_key] =&gt; 24
                          )
  
                      [requestClass:protected] =&gt; Guzzle\Http\Message\Request
                      [entityEnclosingRequestClass:protected] =&gt; Guzzle\Http\Message\EntityEnclosingRequest
                  )
  
              [eventDispatcher:protected] =&gt; Symfony\Component\EventDispatcher\EventDispatcher Object
                  (
                      [listeners:Symfony\Component\EventDispatcher\EventDispatcher:private] =&gt; Array
                          (
                              [request.sent] =&gt; Array
                                  (
                                      [100] =&gt; Array
                                          (
                                              [0] =&gt; Array
                                                  (
                                                      [0] =&gt; Guzzle\Http\RedirectPlugin Object
                                                          (
                                                              [defaultMaxRedirects:protected] =&gt; 5
                                                          )
  
                                                      [1] =&gt; onRequestSent
                                                  )
  
                                          )
  
                                  )
  
                              [request.clone] =&gt; Array
                                  (
                                      [0] =&gt; Array
                                          (
                                              [0] =&gt; Array
                                                  (
                                                      [0] =&gt; Guzzle\Http\RedirectPlugin Object
                                                          (
                                                              [defaultMaxRedirects:protected] =&gt; 5
                                                          )
  
                                                      [1] =&gt; cleanupRequest
                                                  )
  
                                          )
  
                                  )
  
                              [request.before_send] =&gt; Array
                                  (
                                      [0] =&gt; Array
                                          (
                                              [0] =&gt; Array
                                                  (
                                                      [0] =&gt; Guzzle\Http\RedirectPlugin Object
                                                          (
                                                              [defaultMaxRedirects:protected] =&gt; 5
                                                          )
  
                                                      [1] =&gt; cleanupRequest
                                                  )
  
                                          )
  
                                  )
  
                          )
  
                      [sorted:Symfony\Component\EventDispatcher\EventDispatcher:private] =&gt; Array
                          (
                          )
  
                  )
  
          )
  
      [httpRequest:protected] =&gt; Symfony\Component\HttpFoundation\Request Object
          (
              [attributes] =&gt; Symfony\Component\HttpFoundation\ParameterBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                          )
  
                  )
  
              [request] =&gt; Symfony\Component\HttpFoundation\ParameterBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                          )
  
                  )
  
              [query] =&gt; Symfony\Component\HttpFoundation\ParameterBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                          )
  
                  )
  
              [server] =&gt; Symfony\Component\HttpFoundation\ServerBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                              [DOCUMENT_ROOT] =&gt; /var/virtual/childlabel/label-ecommerce/src/labelecommapp/example
                              [REMOTE_ADDR] =&gt; 127.0.0.1
                              [REMOTE_PORT] =&gt; 35783
                              [SERVER_SOFTWARE] =&gt; PHP 5.4.9-4ubuntu2.2 Development Server
                              [SERVER_PROTOCOL] =&gt; HTTP/1.1
                              [SERVER_NAME] =&gt; localhost
                              [SERVER_PORT] =&gt; 8000
                              [REQUEST_URI] =&gt; /test.php
                              [REQUEST_METHOD] =&gt; GET
                              [SCRIPT_NAME] =&gt; /test.php
                              [SCRIPT_FILENAME] =&gt; /var/virtual/childlabel/label-ecommerce/src/labelecommapp/example/test.php
                              [PHP_SELF] =&gt; /test.php
                              [HTTP_HOST] =&gt; localhost:8000
                              [HTTP_CONNECTION] =&gt; keep-alive
                              [HTTP_CACHE_CONTROL] =&gt; max-age=0
                              [HTTP_ACCEPT] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                              [HTTP_USER_AGENT] =&gt; Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
                              [HTTP_ACCEPT_ENCODING] =&gt; gzip,deflate,sdch
                              [HTTP_ACCEPT_LANGUAGE] =&gt; en-US,en;q=0.8
                              [HTTP_COOKIE] =&gt; PHPSESSID=gm3gv1sb85rh0dpq8iiidut325
                              [REQUEST_TIME_FLOAT] =&gt; 1377418274.3256
                              [REQUEST_TIME] =&gt; 1377418274
                          )
  
                  )
  
              [files] =&gt; Symfony\Component\HttpFoundation\FileBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                          )
  
                  )
  
              [cookies] =&gt; Symfony\Component\HttpFoundation\ParameterBag Object
                  (
                      [parameters:protected] =&gt; Array
                          (
                              [PHPSESSID] =&gt; gm3gv1sb85rh0dpq8iiidut325
                          )
  
                  )
  
              [headers] =&gt; Symfony\Component\HttpFoundation\HeaderBag Object
                  (
                      [headers:protected] =&gt; Array
                          (
                              [host] =&gt; Array
                                  (
                                      [0] =&gt; localhost:8000
                                  )
  
                              [connection] =&gt; Array
                                  (
                                      [0] =&gt; keep-alive
                                  )
  
                              [cache-control] =&gt; Array
                                  (
                                      [0] =&gt; max-age=0
                                  )
  
                              [accept] =&gt; Array
                                  (
                                      [0] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                  )
  
                              [user-agent] =&gt; Array
                                  (
                                      [0] =&gt; Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
                                  )
  
                              [accept-encoding] =&gt; Array
                                  (
                                      [0] =&gt; gzip,deflate,sdch
                                  )
  
                              [accept-language] =&gt; Array
                                  (
                                      [0] =&gt; en-US,en;q=0.8
                                  )
  
                              [cookie] =&gt; Array
                                  (
                                      [0] =&gt; PHPSESSID=gm3gv1sb85rh0dpq8iiidut325
                                  )
  
                          )
  
                      [cacheControl:protected] =&gt; Array
                          (
                              [max-age] =&gt; 0
                          )
  
                  )
  
              [content:protected] =&gt; 
              [languages:protected] =&gt; 
              [charsets:protected] =&gt; 
              [acceptableContentTypes:protected] =&gt; 
              [pathInfo:protected] =&gt; 
              [requestUri:protected] =&gt; 
              [baseUrl:protected] =&gt; 
              [basePath:protected] =&gt; 
              [method:protected] =&gt; 
              [format:protected] =&gt; 
              [session:protected] =&gt; 
              [locale:protected] =&gt; 
              [defaultLocale:protected] =&gt; en
          )
  
      [response:protected] =&gt; 
  )
  </code></pre>