Braintree\TransactionSearch::paypalPayerEmail PHP Method

paypalPayerEmail() public static method

public static paypalPayerEmail ( )
    public static function paypalPayerEmail()
    {
        return new TextNode('paypal_payer_email');
    }

Usage Example

 public function testHandlesPayPalAccounts()
 {
     $http = new HttpClientApi(Braintree\Configuration::$global);
     $nonce = $http->nonceForPayPalAccount(['paypal_account' => ['access_token' => 'PAYPAL_ACCESS_TOKEN']]);
     $result = Braintree\Transaction::sale(['amount' => Braintree\Test\TransactionAmounts::$authorize, 'paymentMethodNonce' => $nonce]);
     $this->assertTrue($result->success);
     $paypalDetails = $result->transaction->paypalDetails;
     $collection = Braintree\Transaction::search([Braintree\TransactionSearch::paypalPaymentId()->is($paypalDetails->paymentId), Braintree\TransactionSearch::paypalAuthorizationId()->is($paypalDetails->authorizationId), Braintree\TransactionSearch::paypalPayerEmail()->is($paypalDetails->payerEmail)]);
     $this->assertEquals(1, $collection->maximumCount());
     $this->assertEquals($result->transaction->id, $collection->firstItem()->id);
 }