Skip to content

interpret paybox response #1

@fred-gb

Description

@fred-gb

Hi, I try your awesome module !

I have a problem with this function.

// ExpressJS example to get datas received in the request
var datas = req.body;

// ExpressJS example to get the param "transactionId" passed in the url
var transactionId = req.query.transactionId;

// Assuming myTransactions is where you store transactions from paybox.createTransaction() method
// You can store it wherever you want but you have to find it to check identity
var transaction = myTransactions[transactionId];

paybox.response(transaction, datas, '/path/to/pubkey/of/paybox.pem', function(error, transaction){
  if(error === null){
    // payment is accepted
  }
  else{
    // error is a String that you can display if you want
  }
});

When I receive the response from paybox, req.body, req.query are empty

  body: {},
  params: { id: '1463004879722' },
  query: {},

So this is the error :

ReferenceError: datas is not defined

And I would like to validate the haybox response... What's wrong ? is it your module ? Did Haybox change something ?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions