Trouble Using Omnipay with Stripe?

646 views Asked by At

I'm currently developing a web app that features online payments. We've settled on Stripe as the gateway. I initially thought Omnipay would be perfect, but I have to admit I find the documentation confusing -- For example where to find options that can be set or what's included in responses?

I actually have a test payment working with Omnipay, but once it's successful I can't see how to pull out the transaction details to store in the db:

if ($response->isSuccessful()) {
  // how to grab the transaction date, id other useful information to store.
  // How to see what is available?!
}

Also is the only documentation the general page in the git, I seem to be failing to navigate my way through it. General nerd fail at current time

1

There are 1 answers

0
Adrian Macneil On BEST ANSWER

To get the transaction details from an omnipay response, there are a few methods you can use on the response object.

// how to grab the transaction date, id other useful information to store.
if ($response->isSuccessful()) {  
    // the transaction date is right now
    $date = gmdate();

    // the id
    $id = $response->getTransactionReference();

    // other useful information (the raw response from Stripe)
    $data = $response->getData();
}