Payum\Paypal\Masspay\Nvp\Api::massPay PHP Method

massPay() public method

public massPay ( array $fields ) : array
$fields array
return array
    public function massPay(array $fields)
    {
        $fields['METHOD'] = 'MassPay';
        $this->addVersionField($fields);
        $this->addAuthorizeFields($fields);
        return $this->doRequest($fields);
    }

Usage Example

Beispiel #1
0
 /**
  * @test
  */
 public function shouldUseSandboxApiEndpointIfSandboxTrue()
 {
     $testCase = $this;
     $clientMock = $this->createHttpClientMock();
     $clientMock->expects($this->once())->method('send')->will($this->returnCallback(function (RequestInterface $request) use($testCase) {
         $testCase->assertEquals('https://api-3t.sandbox.paypal.com/nvp', $request->getUri());
         return new Response(200, [], $request->getBody());
     }));
     $api = new Api(array('username' => 'a_username', 'password' => 'a_password', 'signature' => 'a_signature', 'sandbox' => true), $clientMock, $this->createHttpMessageFactory());
     $api->massPay([]);
 }