SynapseFI / SynapseNode

Node.js Client Library for SynapseFI REST V3.1 API | https://docs.synapsefi.com
MIT License
13 stars 36 forks source link

Amount isn't being set for dummy transactions #48

Closed zeckdude closed 4 years ago

zeckdude commented 4 years ago

I was able to create a dummy transaction with a custom amount using the query params on Postman and hitting the REST API directly, but when I use the SynapseNode library, it isn't working. It looks like the amount is not being sent in the request: https://github.com/SynapseFI/SynapseNode/blob/master/src/lib/User.js#L200-L211

 triggerDummyTransactions(node_id, queryParams = {}) {
    const { foreign_transaction, is_credit, subnet_id, type } = queryParams;

    return apiRequests.user[triggerDummyTransactions]({
      node_id,
      foreign_transaction,
      is_credit,
      subnet_id,
      type,
      userInfo: this
    });
  }

This is my attempt to get it work btw:

const result = await synapsePayNode.triggerDummyTransactionAsync({
        amount: '20.22',
        foreign_transaction: 'yes',
        is_credit: 'no',
        type: 'POS_DEBIT',
        subnetid: '1212-33434-21212-33323',
      });

I also noticed that when you destructure, you use subnet_id instead of subnetid as it says in the Rest API docs, but for some reason subnetid still works, so I'm not concerned about that, but I am curious why.

zeckdude commented 4 years ago

This was fixed in https://github.com/SynapseFI/SynapseNode/pull/50