Since your question is lacking context, I'll suggest isolating the statements and log the values. You can start by asking the following questions:
$result->salePaymentRequestResult->token
at that point of code?$cart->transaction_id
? For example: $cart->transaction_id = 'test_token';
transaction_id
attribute? Defining a Mutator