Giter Club home page Giter Club logo

connect-nodejs-sdk's People

Contributors

cszhu avatar dange42 avatar deanpapastrat avatar dianed-square avatar gkchestertron avatar goblinhorde avatar hukid avatar jawspeak avatar jessdelacruzsantos avatar lindzeng avatar mikekono avatar mohsin-sq avatar okenshields avatar shaofu88 avatar soloniss avatar square-sdk-deployer avatar sseaman avatar tristansokol avatar vzhu avatar yonpols avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connect-nodejs-sdk's Issues

Getting string expected error for source_id even though the source_id is a string(using square connect with cloud functions)

I have made a cloud function to create and complete a payment request to square connect API.

This is the function:

const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);

var SquareConnect = require("square-connect");
var defaultClient = SquareConnect.ApiClient.instance;

exports.sqProcessPayments = functions
  .region("europe-west1")
  .firestore.document("users/{userId}")
  .onUpdate(async (change, context) => {
    var accessToken = "access--token";
    let previousData = change.before.data();
    let updatedData = change.after.data();
    let previousNonce = previousData["payment_nonce"];
    let updatedNonce = updatedData["payment_nonce"];
    if (previousNonce !== updatedNonce) {
      var oauth2 = defaultClient.authentications["oauth2"];
      oauth2.accessToken = accessToken;
      var idempotencyKey = new Date();
      var apiInstance = new SquareConnect.PaymentsApi();
      var body = new SquareConnect.CreatePaymentRequest({
        source_id: updatedNonce.toString(),
        idempotency_key: idempotencyKey.toString(),
        amount_money: {
        amount: 10,
        currency: "USD",
        },
        location_id: "location-id",
        autocomplete: true,
      });
      apiInstance
        .createPayment(body)
        .then(
          function (data) {
            console.log(
              "API called successfully. Returned data: " + data.payment.id
            ); 
            return data;
          },
          function (error) {
            console.error(error);
          }
        )
        .catch((error) => console.log(error));
      }
    });

But I am getting this error on running this function

'{"errors": [{"code": "EXPECTED_STRING","detail": "Expected a string value (line 1, character 14)","field": "source_id","category": "INVALID_REQUEST_ERROR"}]}\n'

I have checked the value of source_id and it is a string. But the error says otherwise.

Please help me resolve this. Any help would be great.

Thanks for your time!

Broken links in docs

At this page in docs:

https://github.com/square/connect-javascript-sdk/blob/master/docs/OrdersApi.md#type-order

The three links in this block of text:

Creates an Order that can then be referenced as order_id in a request to the Charge endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order's id in the order_id field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the Orders API Overview.

do not lead any where. The one in "Orders API Overview" leads to a not found page.

Case for property names

It appears Swagger is rendering the Javascript SDK docs incorrectly. Property names in the SDK docs are being shown in camel case. However the camel case property names aren't working. Whereas underscore case property names are working.

CreateCheckoutRequest.md example:

askForShippingAddress
Boolean
If true, Square Checkout will collect shipping information on your behalf and store that information with the transaction information in your Square Dashboard. Default: false

When I try askForShippingAddress it does not work, but when I instead use ask_for_shipping_address that does work.

I haven't tested other languages. (Fwiw, underscore case is shown in...)
https://github.com/square/connect-php-sdk/blob/master/docs/Model/CreateCheckoutRequest.md
https://github.com/square/connect-python-sdk/blob/master/docs/CreateCheckoutRequest.md
https://github.com/square/connect-ruby-sdk/blob/master/docs/CreateCheckoutRequest.md

(Camel case is shown in...)
https://github.com/square/connect-csharp-sdk/blob/master/docs/CreateCheckoutRequest.md
https://github.com/square/connect-java-sdk/blob/master/docs/CreateCheckoutRequest.md

Trying to use Oauth access_token to call v1/ APIs

I get an error when I obtain a token from a merchant then call a retrieveBusiness and listLocations APIs to get their business information. Does the Oauth access token allow me to call v1 API? I'm doing this against the sandbox and I see the call going to production in the error (https://squareup.com/v1/me)

const {
  OAuthApi,
  V1LocationsApi
} = require("square-connect");
const oauthApi = new OAuthApi();
const v1Locations = new V1LocationsApi();

const defaultClient = SquareConnect.ApiClient.instance;
defaultClient.basePath = "https://connect.squareupsandbox.com"

let oauth2 = defaultClient.authentications["oauth2"];
oauth2.accessToken = <my_access_token>


exports.squareAuthorize = functions.https.onRequest(
  async (request, response) => {
    var body = new SquareConnect.ObtainTokenRequest();
    body.client_id = <application_id>;
    body.client_secret = <application_secret>;
    body.grant_type = "authorization_code";
    body.code = request.query.code; //query param "code" sent by the request from square

    try {
      let authInfo = {};
      await oauthApi.obtainToken(body).then(data => {
        authInfo = data;
        console.log(
          "API called successfully. Returned data: " + JSON.stringify(data)
        );

        return data;
      });

       // access token from obtainToken
       oauth2.accessToken = authInfo.access_token;

      await v1Locations.retrieveBusiness().then(data => {
        console.log("API called successfully. Returned business data: " + data);
        return data;
      });
   } catch (e) {
       console.log(
          `[Error] Status:${e.status}, Messages: ${JSON.stringify(
            JSON.parse(e.response.text).errors,
            null,
            2
          )}`
        );
   } 

Error:

>  e : {"status":404,"response":{"req":{"method":"GET","url":"https://squareup.com/v1/me","data":null,"headers":{"user-agent":"Square-Connect-Javascript/2.20190925.0","accept-encoding":"gzip, deflate","square-version":"2019-09-25","accept":"application/json"}},"header":{"date":"Sun, 06 Oct 2019 17:32:38 GMT","content-type":"application/json; charset=utf-8","vary":"Accept-Encoding","cache-control":"no-cache","set-cookie":["_savt=92a0ba37-bb2e-453b-9217-5d2f7fb2XXXX; domain=.squareup.com; path=/; expires=Thu, 06 Oct 2022 17:32:38 -0000; secure"],"x-request-id":"cce7b44b-0e43-441f-9cb8-f6f2381cXXXX","x-frame-options":"sameorigin","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-download-options":"noopen","x-permitted-cross-domain-policies":"none","content-encoding":"gzip","content-length":"47","x-envoy-upstream-service-time":"17","strict-transport-security":"max-age=604800; includeSubDomains","server":"envoy","connection":"close"},"status":404,"text":"{\"message\":\"NotFoundError\"}"}}
>  [Error] Status:404, Messages: undefined

Another question around this topic is I want to be able to have a user connect their square account to my application but after I obtain the token there isn't any information I can use to tie the token to their customer profile in the application. Can I use the state query param in the Oauth to pass a customer ID from my application? https://developer.squareup.com/reference/square/oauth-api/authorize#response__property-state

CORS/SRI enabled

Hi, I'm trying to implement some cross-origin policy on the website I'm developing which uses square-connect. I've calculated a hash for your canonical script (https://js.squareup.com/v2/paymentform) but the request for the script is failing in chrome.

Developer Tools say:

  • Access to script at 'https://js.squareup.com/v2/paymentform' from origin 'https://xxxxxxxxxx' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

  • GET https://js.squareup.com/v2/paymentform net::ERR_FAILED

  • sq-payment-form.js:11 Uncaught ReferenceError: SqPaymentForm is not defined at sq-payment-form.js:11

.pug:
script(type="text/javascript" src="https://js.squareup.com/v2/paymentform" integrity='sha384-34EN2lpxCUBt12wAXfAdmPQIUXKu7hxPZ9EeL4k3NJBP0Nrx6nYn/rnjPW3H8HDV', crossorigin='anonymous')

Could you please make the endpoint CORS enabled?

It works for jQuery..
pug:
script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous')

CreateOrderRequest fails to generate an object

Problem

Following the examples from https://github.com/square/connect-nodejs-sdk/blob/master/docs/OrdersApi.md#createorder I am unable to successfully send an object to createOrder.

Example Code

Does NOT Work due to body being === exports {}.

const idempotency_key = crypto.randomBytes(22).toString('hex');
const orders_api = new squareConnect.OrdersApi();
const request_fields = {
  order: {
    location_id: "sample_Location",
      line_items: [
        {
          name: reqBody.name,
          quantity: reqBody.quantity,
          total_money: {
            amount: reqBody.amount, // $1.00 charge
            currency: 'USD'
          }
        }
      ]
    },
  idempotency_key
};
const body = new squareConnect.CreateOrderRequest(request_fields);
orders_api.createOrder(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
  res.status(200).json(data);
}, function(error) {
  console.error(error);
  res.status(error?.status ?? 502).json(error);
});

Works by BYPASSING CreateOrderRequest:

const idempotency_key = crypto.randomBytes(22).toString('hex');
const orders_api = new squareConnect.OrdersApi();
const request_fields = {
  order: {
    location_id: "sample_Location",
      line_items: [
        {
          name: reqBody.name,
          quantity: reqBody.quantity,
          total_money: {
            amount: reqBody.amount, // $1.00 charge
            currency: 'USD'
          }
        }
      ]
    },
  idempotency_key
};
orders_api.createOrder(request_fields).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
  res.status(200).json(data);
}, function(error) {
  console.error(error);
  res.status(error?.status ?? 502).json(error);
});

iOS React Native IDFA Issue

Does inclusion of this library trigger Apple's IDFA warnings? Can't find any mention of this in the docs nor do I find it when we GREP for the Advertising Identifier. But when we say no we don't do any advertising during the iOS submission process, we can't continue and get this warning.

Your app is using the Advertising Identifier (IDFA). You must either provide details about the IDFA usage or remove it from the app and submit your binary again.

Square in-app payments and customer verification packages are the only one we could think of that might have this.

How to get item's images?

Hi! Since last API update (2019-03-27), I'm not able to get the item's images, I see the image_id field on each item, but there is no explanation on the docs on how to retrieve the image url from there.
Is it explained somewhere I couldn't find?

Thanks!

.createPayment() doesn't return valid JSON object

It returns something like

exports {
  payment:
   exports {
     id: 'xxxxxxxxxxxxxx',
     created_at: '2019-12-09T22:04:32.612Z',
     updated_at: '2019-12-09T22:04:32.782Z',
     amount_money: exports { amount: 2000, currency: 'USD' },
     total_money: exports { amount: 2000, currency: 'USD' },
     status: 'COMPLETED',
     source_type: 'CARD',
     card_details:
      exports {
        status: 'CAPTURED',
        card: [exports],
        entry_method: 'KEYED',
        cvv_status: 'CVV_ACCEPTED',
        avs_status: 'AVS_ACCEPTED',
        statement_description: 'SQ *DEFAULT TEST ACCOUNT' },
     location_id: 'xxxxxxxxxxx',
     order_id: 'xxxxxxxxxxxx' } }

What type of object is this, how do I handle it? Can I only treat it as a PaymentResponse object?

Payments API not submitting charge with customer id and source_id (formerly customer_card_id)

I have tried multiple times with multiple test cards. All have no problem creating a customer_id and customer_card_id with the Customers API. However, when I try to apply a payment using these values, it does not want to work. Here is a copy of my error:

'{"errors": [{"code": "NOT_FOUND","detail": "Card on file not found","category": "INVALID_REQUEST_ERROR"}]}\n' },

This was not a problem with the transactions API. Also to be noted, I am using updated api keys and location ids.

GET requests to catalog fail with CORS Missing Allow Origin

I am trying to use the catalog API but requests are failing with CORS Missing Allow Origin.

I can use curl to send GET requests to the sandbox API and I get the expected result.

But when I send the same request from my webapp, which includes the origin and referer headers, the response is a 403 with "CORS Missing Allow Origin"

This works

 curl "https://connect.squareupsandbox.com/v2/catalog/list" -H "User-Agent: Square-TypeScript-SDK/8.0.0" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "authorization: Bearer SANDBOX_ACCESS_TOKEN" -H "Square-Version: 2020-12-16" -H "Connection: keep-alive"

This fails

curl "https://connect.squareupsandbox.com/v2/catalog/list" -H "User-Agent: Square-TypeScript-SDK/8.0.0" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "authorization: Bearer SANDBOX_ACCESS_TOKEN" -H "Square-Version: 2020-12-16" -H "Origin: http://dev.domain.com" -H "Connection: keep-alive" -H "Referer: http://dev.domain.com/product-list"

Typescript error: completePayment body

I am getting the typescript error expected 1 arguments, but got 2 with the following call

return payments_api.completePayment(payment_id, body);

However, the call fails with just the payment_id and not the body even though according to the docs the body is empty

"Missing the required parameter 'body' when calling completePayment"

Issue: Using PaymentsApi.completePayment(paymentId) yields the following error: "Missing the required parameter 'body' when calling completePayment".
Expected: There should be no errors when using PaymentsApi.completePayment(paymentId) with a valid paymentId.
Solutions: Simply pass an empty object as the body in the API, or do not throw an error for fields that are allowed to be empty.

CreateCatalogImage Missing? - Feature Request or Clarification

I'm looking for the correct way to add a catalog image using the nodejs sdk. I see that other languages (python, ruby, java, etc) have a method called CatalogApi.CreateCatalogImageAsync or something similar. I don't see anything like this in the nodejs sdk. Am I missing something? If not, is there a workaround using Axios or another library for node? Thank you.

Seeking for security recommendation - Nodejs singleton

Hello team,

I'm planning to use this library to connect Square API for checkout/order API purpose. As SaaS application, we tend to allow multiple tenants to connect to Square endpoint via Oauth as per documentation. looks like this nodejs sdk library is a singleton ( Afaik )

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

but when accessing it looks like the default client has internal reference and has single instance of the client.

var apiInstance = new SquareConnect.CheckoutApi();

Consider, in nodejs server ( express ) application is it possible that the particular instance of the application ( square API ) mixes with other similar requests and leading to a security flaw?

Can someone from the square team or experienced with the holding singleton reference of the api client can cause such issues ?

Regards,
Shivasurya

Square.PaymentsApi is not a constructor

When trying to access the payments Api I get the error:
Square.PaymentsApi is not a constructor

I am using Meteor on node, I am able to connect to and use the other API's without issue. Below is my code:

`
import Square from 'square-connect'

Square.ApiClient.instance.basePath = 'https://connect.squareupsandbox.com';
Square.ApiClient.instance.authentications.oauth2.accessToken = Meteor.settings.SQUARE.SANDBOXTOKEN
const squarePaymentsApi = new Square.PaymentsApi();

const locationsApi = new Square.LocationsApi();
const squareTrasactionsApi = new Square.TransactionsApi();
const squareCustomersApi = new Square.CustomersApi()
`

Typescript error: UpdateOrder signature is inaccurate.

I am getting TS errors because tslint thinks my call is wrong when I provide

await this.ordersApi.updateOrder(location.id, orderId, {...orderApiStuff});

it thinks it should match:

/**
     * Updates an open [Order](#type-order) by adding, replacing, or deleting fields. Orders with a `COMPLETED` or `CANCELED`
     * state cannot be updated. An UpdateOrder request requires the following:
     * - The `order_id` in the endpoint path, identifying the order to update.
     * - The latest `version` of the order to update.
     * - The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to.
     * - If deleting fields, the [dot notation paths](/orders-api/manage-orders#on-dot-notation) identifying fields to clear.
     * To pay for an order, please refer to the [Pay for Orders](/orders-api/pay-for-orders) guide.
     * To learn more about the Orders API, see the [Orders API Overview](/orders-api/what-it-does).
     */
    updateOrder(body: UpdateOrderRequest): Promise<UpdateOrderResponse>;

but in reality the javascript matches the former signature I am using, forcing me to use ts-ignore

Problems with amount

Hello community, I have the following problem using nodejs sdk.

It turns out that a platform that processes payments of 200 usd and up.

Apparently the payments in the square system go wrong.

In my personal system they are well saved in the database with the amount entered.

The amount is sent and converted into a whole number.

Example of delivery: 1,250.00 and it becomes 1250 but in square it takes it as 12.50, I await your response, thank you

WhatsApp Image 2020-09-27 at 18 59 58 (1)

Insufficient permissions error when using production

This may not be a bug but when i use the production credentials in the app I get the following in response to a createOrder call:

 text: '{"errors": [{"code": "FORBIDDEN","detail": "You have insufficient permissions to perform that action.","category": "AUTHENTICATION_ERROR"}]}\n',

Not sure what could be a problem here, everything is exactly the same except that i switched the .env vars to the production credentials.

This is the file where the call happens:
https://github.com/nichoth/whammy/blob/5bd6c72bcc64e143599b031607af79fee4ee0b86/functions/create-order.js#L121

Documentation for running tests locally is missing

I checked out the project, ran:

$ npm install
$ npm test

I get this error:

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~pretest: [email protected]
npm info lifecycle [email protected]~test: [email protected]

> [email protected] test /Users/donovan/src/connect-javascript-sdk
> mocha --recursive

fs.js:663
  return binding.open(pathModule.toNamespacedPath(path),
                 ^

Error: ENOENT: no such file or directory, open '/Users/donovan/src/connect-javascript-sdk/travis-ci/accounts.json'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.readFileSync (fs.js:568:33)
    at Object.<anonymous> (/Users/donovan/src/connect-javascript-sdk/test/support/accounts.js:4:32)
    at Module._compile (module.js:641:30)
    at loader (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/donovan/src/connect-javascript-sdk/test/support/setup.js:1:18)
    at Module._compile (module.js:641:30)
    at loader (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/donovan/src/connect-javascript-sdk/test/api/ApplePayApi.spec.js:22:5)
    at Module._compile (module.js:641:30)
    at loader (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/donovan/src/connect-javascript-sdk/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at /Users/donovan/src/connect-javascript-sdk/node_modules/mocha/lib/mocha.js:216:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/Users/donovan/src/connect-javascript-sdk/node_modules/mocha/lib/mocha.js:213:14)
    at Mocha.run (/Users/donovan/src/connect-javascript-sdk/node_modules/mocha/lib/mocha.js:453:10)
    at Object.<anonymous> (/Users/donovan/src/connect-javascript-sdk/node_modules/mocha/bin/_mocha:393:18)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Function.Module.runMain (module.js:682:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:613:3
npm info lifecycle [email protected]~test: Failed to exec test script
npm ERR! Test failed.  See above for more details.

Rate Limit Issue

I have some issue where square block the IP of the server from calling to square API. I did some research and found that there a rate limit 10 request per second on Square per merchant.

Anywhere we can increase this rate limit?

Thanks,
Punleu

API table description column: Many (all?) linked objects broken. Point to Connect v2 API reference, not GitHub SDK reference.

It appears that some or all JavaScript API object text references in the API table description columns are pointing to the Connect v2 API reference instead of to objects in the connect-javascript-sdk docs. For example, in Order.md:
CreateOrder is incorrect.ย  #endpoint-createorder is the correct hash for the Connect v2.0 API reference (https://docs.connect.squareup.com/api/connect/v2#endpoint-createorder)ย but the link should be pointing to the JavaScript SDK CreateOrderRequest object (https://github.com/square/connect-javascript-sdk/blob/master/docs/CreateOrderRequest.md).

It appears that all links in the description column for each of the JavaScript SDK topics in the GitHub docs are pointing to Connect V2.0 API reference topics instead of to the appropriate GitHub JavaScript SDK topics.

getting code 400

i keep getting string expected error for source_id but when i console.log it, it is a string. I m stumped. Could there be another reason for this error?

the nonce is generated by square react payments form which is in beta but the value is a string.

here's the code


const uuid = require('uuid/v4');

const SquareConnect = require('square-connect');

const defaultClient = SquareConnect.ApiClient.instance;

const saveCharge = require('./saveCharge');

module.exports = async (data) => {
  try {
    const {
      tokenId,
      sourceId,
      verifyToken,
    } = data;
    const { oauth2 } = defaultClient.authentications;
    oauth2.accessToken = tokenId;

    const api = new SquareConnect.PaymentsApi();
    console.log({
      source_id: sourceId,
      idempotency_key: uuid(),
      amount_money: {
        amount: 500,
        currency: 'USD',
      },
      app_fee_money: {
        amount: 200,
        currency: 'USD',
      },
      verification_token: verifyToken,
    }, ' this  is paymentobject');
    const body = new SquareConnect.CreatePaymentRequest({
      source_id: sourceId,
      idempotency_key: uuid(),
      amount_money: {
        amount: 500,
        currency: 'USD',
      },
      app_fee_money: {
        amount: 200,
        currency: 'USD',
      },
      verification_token: verifyToken,
    });
    const payment = await api.createPayment(body);

    console.log(payment, 'createPayment called.');

    const savedTransaction = await saveCharge(payment, data);

    return savedTransaction;
  } catch (e) {
    console.error(e);
    return e;
  }
};

React-Native : Unable to resolve module 'fs'

Hi,

We want to use the Square-Connect SDK to process payments with the Transactions API. We are currently encountering a problem when attempting to integrate the SquareConnect SDK. To problem seem to be related to the fact that the SDK requires the 'fs' module. I get the following error.

Error: Unable to resolve module fs from C:\Redcandy\Software\React\AreaRN\node_modules\square-connect\src\ApiClient.js: Module fs does not exist in the Haste module map

I replaced the code using fs in ApiClient.js with the following:
exports.prototype.isFileParam = function(param) { // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) if (typeof require === 'function') { /*var fs; try { fs = require('fs'); } catch (err) {} if (fs && fs.ReadStream && param instanceof fs.ReadStream) { return true; }*/ console.log('Square Connect asked for something we dont know ...'); return false; } // Buffer in Node.js if (typeof Buffer === 'function' && param instanceof Buffer) { return true; } // Blob in browser if (typeof Blob === 'function' && param instanceof Blob) { return true; } // File in browser (it seems File object is also instance of Blob, but keep this for safe) if (typeof File === 'function' && param instanceof File) { return true; } return false; };

And with that i am able to use the desired Square-Connect SDK features.

What is fs used for ? Would there be a possibility to remove or make the dependancy on fs optionnal so i don't have to make that modification everytime i reset the node_modules of my project ?

Thank you!

Y

Creating a request

Im trying to create a request but failing for the money field. The docs are a little confusing as the naming conventions do not seem to be right. Can anyone help me with an example?

here is what I have

`var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'sandbox--TOKEN';

var apiInstance = new SquareConnect.TransactionsApi();
var money = new SquareConnect.Money();
money.amount_money = 100;
money.currency = "USD";

var locationId = "PB7DD187ZCTCB"; // String | The ID of the location to associate the created transaction with.

var body = new SquareConnect.ChargeRequest(); // ChargeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
body.idempotency_key = "YTHDGJIK";
body.amount_money = money;;
body.currency = "USD";
body.cardNonce = "CBASECXnYKA9fd8KXid_9sKAHukgAF";
body["referenceId"] = "Confirmation purchase";
body["note"] = "Thank you for your purchase";
apiInstance.charge(locationId, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
`

.createPayment() doesn't return valid JSON object

It returns something like

exports {
  payment:
   exports {
     id: 'xxxxxxxxxxxxxx',
     created_at: '2019-12-09T22:04:32.612Z',
     updated_at: '2019-12-09T22:04:32.782Z',
     amount_money: exports { amount: 2000, currency: 'USD' },
     total_money: exports { amount: 2000, currency: 'USD' },
     status: 'COMPLETED',
     source_type: 'CARD',
     card_details:
      exports {
        status: 'CAPTURED',
        card: [exports],
        entry_method: 'KEYED',
        cvv_status: 'CVV_ACCEPTED',
        avs_status: 'AVS_ACCEPTED',
        statement_description: 'SQ *DEFAULT TEST ACCOUNT' },
     location_id: 'xxxxxxxxxxx',
     order_id: 'xxxxxxxxxxxx' } }

What type of object is this, how do I handle it? Can I only treat it as a PaymentResponse object?

Exclude unnecessary files from package.json

I recommend using the files configuration in package.json to only include the files/directories you actually want (likely src/). Currently, all files in the package (including ones ignored by git) will be included:

-rw-r--r--  0 0      0         484 Dec 12 11:55 package/package.json
-rw-r--r--  0 0      0          27 Dec 12 10:58 package/.babelrc
-rw-r--r--  0 0      0        1030 Dec 12 10:58 package/.swagger-codegen-ignore
-rw-r--r--  0 0      0        1058 Dec 12 10:58 package/.travis.yml
-rw-r--r--  0 0      0          63 Dec 12 10:58 package/CHANGES.md
-rw-r--r--  0 0      0         124 Dec 12 10:58 package/CONTRIBUTING.md
-rw-r--r--  0 0      0       11357 Dec 12 10:58 package/LICENSE
-rw-r--r--  0 0      0          16 Dec 12 10:58 package/mocha.opts
-rw-r--r--  0 0      0       38039 Dec 12 10:58 package/README.md
-rw-r--r--  0 0      0         612 Dec 12 10:58 package/docs/AdditionalRecipient.md
-rw-r--r--  0 0      0         944 Dec 12 10:58 package/docs/AdditionalRecipientReceivable.md
-rw-r--r--  0 0      0         810 Dec 12 10:58 package/docs/AdditionalRecipientReceivableRefund.md
-rw-r--r--  0 0      0        8103 Dec 12 10:58 package/docs/Address.md
-rw-r--r--  0 0      0        2114 Dec 12 10:58 package/docs/ApplePayApi.md
-rw-r--r--  0 0      0         507 Dec 12 10:58 package/docs/BatchDeleteCatalogObjectsRequest.md
-rw-r--r--  0 0      0         561 Dec 12 10:58 package/docs/BatchDeleteCatalogObjectsResponse.md
-rw-r--r--  0 0      0         990 Dec 12 10:58 package/docs/BatchRetrieveCatalogObjectsRequest.md
-rw-r--r--  0 0      0         575 Dec 12 10:58 package/docs/BatchRetrieveCatalogObjectsResponse.md
-rw-r--r--  0 0      0         277 Dec 12 10:58 package/docs/BatchRetrieveOrdersRequest.md
-rw-r--r--  0 0      0         403 Dec 12 10:58 package/docs/BatchRetrieveOrdersResponse.md
-rw-r--r--  0 0      0        2175 Dec 12 10:58 package/docs/BatchUpsertCatalogObjectsRequest.md
-rw-r--r--  0 0      0         687 Dec 12 10:58 package/docs/BatchUpsertCatalogObjectsResponse.md
-rw-r--r--  0 0      0         154 Dec 12 10:58 package/docs/CaptureTransactionRequest.md
-rw-r--r--  0 0      0         253 Dec 12 10:58 package/docs/CaptureTransactionResponse.md
-rw-r--r--  0 0      0        1793 Dec 12 10:58 package/docs/Card.md
-rw-r--r--  0 0      0         412 Dec 12 10:58 package/docs/CardBrand.md
-rw-r--r--  0 0      0       22962 Dec 12 10:58 package/docs/CatalogApi.md
-rw-r--r--  0 0      0         208 Dec 12 10:58 package/docs/CatalogCategory.md
-rw-r--r--  0 0      0        1682 Dec 12 10:58 package/docs/CatalogDiscount.md
-rw-r--r--  0 0      0         252 Dec 12 10:58 package/docs/CatalogDiscountType.md
-rw-r--r--  0 0      0         425 Dec 12 10:58 package/docs/CatalogIdMapping.md
-rw-r--r--  0 0      0         147 Dec 12 10:58 package/docs/CatalogInfoRequest.md
-rw-r--r--  0 0      0         339 Dec 12 10:58 package/docs/CatalogInfoResponse.md
-rw-r--r--  0 0      0        2212 Dec 12 10:58 package/docs/CatalogInfoResponseLimits.md
-rw-r--r--  0 0      0        3451 Dec 12 10:58 package/docs/CatalogItem.md
-rw-r--r--  0 0      0        1164 Dec 12 10:58 package/docs/CatalogItemModifierListInfo.md
-rw-r--r--  0 0      0         275 Dec 12 10:58 package/docs/CatalogItemProductType.md
-rw-r--r--  0 0      0        2924 Dec 12 10:58 package/docs/CatalogItemVariation.md
-rw-r--r--  0 0      0         289 Dec 12 10:58 package/docs/CatalogModifier.md
-rw-r--r--  0 0      0        1049 Dec 12 10:58 package/docs/CatalogModifierList.md
-rw-r--r--  0 0      0         129 Dec 12 10:58 package/docs/CatalogModifierListSelectionType.md
-rw-r--r--  0 0      0         470 Dec 12 10:58 package/docs/CatalogModifierOverride.md
-rw-r--r--  0 0      0        4377 Dec 12 10:58 package/docs/CatalogObject.md
-rw-r--r--  0 0      0         290 Dec 12 10:58 package/docs/CatalogObjectBatch.md
-rw-r--r--  0 0      0         302 Dec 12 10:58 package/docs/CatalogObjectType.md
-rw-r--r--  0 0      0         145 Dec 12 10:58 package/docs/CatalogPricingType.md
-rw-r--r--  0 0      0        1910 Dec 12 10:58 package/docs/CatalogQuery.md
-rw-r--r--  0 0      0         304 Dec 12 10:58 package/docs/CatalogQueryExact.md
-rw-r--r--  0 0      0         328 Dec 12 10:58 package/docs/CatalogQueryItemsForModifierList.md
-rw-r--r--  0 0      0         292 Dec 12 10:58 package/docs/CatalogQueryItemsForTax.md
-rw-r--r--  0 0      0         313 Dec 12 10:58 package/docs/CatalogQueryPrefix.md
-rw-r--r--  0 0      0         454 Dec 12 10:58 package/docs/CatalogQueryRange.md
-rw-r--r--  0 0      0         874 Dec 12 10:58 package/docs/CatalogQuerySortedAttribute.md
-rw-r--r--  0 0      0         279 Dec 12 10:58 package/docs/CatalogQueryText.md
-rw-r--r--  0 0      0        1488 Dec 12 10:58 package/docs/CatalogTax.md
-rw-r--r--  0 0      0         382 Dec 12 10:58 package/docs/CatalogV1Id.md
-rw-r--r--  0 0      0        4186 Dec 12 10:58 package/docs/ChargeRequest.md
-rw-r--r--  0 0      0         461 Dec 12 10:58 package/docs/ChargeRequestAdditionalRecipient.md
-rw-r--r--  0 0      0         334 Dec 12 10:58 package/docs/ChargeResponse.md
-rw-r--r--  0 0      0        2733 Dec 12 10:58 package/docs/Checkout.md
-rw-r--r--  0 0      0        2137 Dec 12 10:58 package/docs/CheckoutApi.md
-rw-r--r--  0 0      0        6036 Dec 12 10:58 package/docs/Country.md
-rw-r--r--  0 0      0        3609 Dec 12 10:58 package/docs/CreateCheckoutRequest.md
-rw-r--r--  0 0      0         456 Dec 12 10:58 package/docs/CreateCheckoutResponse.md
-rw-r--r--  0 0      0         825 Dec 12 10:58 package/docs/CreateCustomerCardRequest.md
-rw-r--r--  0 0      0         326 Dec 12 10:58 package/docs/CreateCustomerCardResponse.md
-rw-r--r--  0 0      0         960 Dec 12 10:58 package/docs/CreateCustomerRequest.md
-rw-r--r--  0 0      0         330 Dec 12 10:58 package/docs/CreateCustomerResponse.md
-rw-r--r--  0 0      0        1214 Dec 12 10:58 package/docs/CreateOrderRequest.md
-rw-r--r--  0 0      0         896 Dec 12 10:58 package/docs/CreateOrderRequestDiscount.md
-rw-r--r--  0 0      0        1986 Dec 12 10:58 package/docs/CreateOrderRequestLineItem.md
-rw-r--r--  0 0      0         262 Dec 12 10:58 package/docs/CreateOrderRequestModifier.md
-rw-r--r--  0 0      0        1206 Dec 12 10:58 package/docs/CreateOrderRequestTax.md
-rw-r--r--  0 0      0         321 Dec 12 10:58 package/docs/CreateOrderResponse.md
-rw-r--r--  0 0      0        1322 Dec 12 10:58 package/docs/CreateRefundRequest.md
-rw-r--r--  0 0      0         320 Dec 12 10:58 package/docs/CreateRefundResponse.md
-rw-r--r--  0 0      0        4769 Dec 12 10:58 package/docs/Currency.md
-rw-r--r--  0 0      0        1516 Dec 12 10:58 package/docs/Customer.md
-rw-r--r--  0 0      0         260 Dec 12 10:58 package/docs/CustomerGroupInfo.md
-rw-r--r--  0 0      0         272 Dec 12 10:58 package/docs/CustomerPreferences.md
-rw-r--r--  0 0      0       12076 Dec 12 10:58 package/docs/CustomersApi.md
-rw-r--r--  0 0      0         155 Dec 12 10:58 package/docs/DeleteCatalogObjectRequest.md
-rw-r--r--  0 0      0         804 Dec 12 10:58 package/docs/DeleteCatalogObjectResponse.md
-rw-r--r--  0 0      0         154 Dec 12 10:58 package/docs/DeleteCustomerCardRequest.md
-rw-r--r--  0 0      0         253 Dec 12 10:58 package/docs/DeleteCustomerCardResponse.md
-rw-r--r--  0 0      0         150 Dec 12 10:58 package/docs/DeleteCustomerRequest.md
-rw-r--r--  0 0      0         249 Dec 12 10:58 package/docs/DeleteCustomerResponse.md
-rw-r--r--  0 0      0         286 Dec 12 10:58 package/docs/Device.md
-rw-r--r--  0 0      0        5541 Dec 12 10:58 package/docs/Error.md
-rw-r--r--  0 0      0         358 Dec 12 10:58 package/docs/ErrorCategory.md
-rw-r--r--  0 0      0        4550 Dec 12 10:58 package/docs/ErrorCode.md
-rw-r--r--  0 0      0         119 Dec 12 10:58 package/docs/InventoryAlertType.md
-rw-r--r--  0 0      0        1809 Dec 12 10:58 package/docs/ItemVariationLocationOverrides.md
-rw-r--r--  0 0      0        1189 Dec 12 10:58 package/docs/ListAdditionalRecipientReceivableRefundsRequest.md
-rw-r--r--  0 0      0         751 Dec 12 10:58 package/docs/ListAdditionalRecipientReceivableRefundsResponse.md
-rw-r--r--  0 0      0        1183 Dec 12 10:58 package/docs/ListAdditionalRecipientReceivablesRequest.md
-rw-r--r--  0 0      0         721 Dec 12 10:58 package/docs/ListAdditionalRecipientReceivablesResponse.md
-rw-r--r--  0 0      0         879 Dec 12 10:58 package/docs/ListCatalogRequest.md
-rw-r--r--  0 0      0         572 Dec 12 10:58 package/docs/ListCatalogResponse.md
-rw-r--r--  0 0      0         397 Dec 12 10:58 package/docs/ListCustomersRequest.md
-rw-r--r--  0 0      0         669 Dec 12 10:58 package/docs/ListCustomersResponse.md
-rw-r--r--  0 0      0         149 Dec 12 10:58 package/docs/ListLocationsRequest.md
-rw-r--r--  0 0      0         340 Dec 12 10:58 package/docs/ListLocationsResponse.md
-rw-r--r--  0 0      0        1160 Dec 12 10:58 package/docs/ListRefundsRequest.md
-rw-r--r--  0 0      0         625 Dec 12 10:58 package/docs/ListRefundsResponse.md
-rw-r--r--  0 0      0        1165 Dec 12 10:58 package/docs/ListTransactionsRequest.md
-rw-r--r--  0 0      0         650 Dec 12 10:58 package/docs/ListTransactionsResponse.md
-rw-r--r--  0 0      0       13646 Dec 12 10:58 package/docs/Location.md
-rw-r--r--  0 0      0          99 Dec 12 10:58 package/docs/LocationCapability.md
-rw-r--r--  0 0      0        1462 Dec 12 10:58 package/docs/LocationsApi.md
-rw-r--r--  0 0      0         111 Dec 12 10:58 package/docs/LocationStatus.md
-rw-r--r--  0 0      0         109 Dec 12 10:58 package/docs/LocationType.md
-rw-r--r--  0 0      0        5360 Dec 12 10:58 package/docs/Money.md
-rw-r--r--  0 0      0        1063 Dec 12 10:58 package/docs/Order.md
-rw-r--r--  0 0      0        1635 Dec 12 10:58 package/docs/OrderLineItem.md
-rw-r--r--  0 0      0        2308 Dec 12 10:58 package/docs/OrderLineItemDiscount.md
-rw-r--r--  0 0      0         183 Dec 12 10:58 package/docs/OrderLineItemDiscountScope.md
-rw-r--r--  0 0      0         310 Dec 12 10:58 package/docs/OrderLineItemDiscountType.md
-rw-r--r--  0 0      0         644 Dec 12 10:58 package/docs/OrderLineItemModifier.md
-rw-r--r--  0 0      0         951 Dec 12 10:58 package/docs/OrderLineItemTax.md
-rw-r--r--  0 0      0         165 Dec 12 10:58 package/docs/OrderLineItemTaxType.md
-rw-r--r--  0 0      0        4618 Dec 12 10:58 package/docs/OrdersApi.md
-rw-r--r--  0 0      0        1424 Dec 12 10:58 package/docs/Refund.md
-rw-r--r--  0 0      0         179 Dec 12 10:58 package/docs/RefundStatus.md
-rw-r--r--  0 0      0         260 Dec 12 10:58 package/docs/RegisterDomainRequest.md
-rw-r--r--  0 0      0         538 Dec 12 10:58 package/docs/RegisterDomainResponse.md
-rw-r--r--  0 0      0         127 Dec 12 10:58 package/docs/RegisterDomainResponseStatus.md
-rw-r--r--  0 0      0        7551 Dec 12 10:58 package/docs/ReportingApi.md
-rw-r--r--  0 0      0         911 Dec 12 10:58 package/docs/RetrieveCatalogObjectRequest.md
-rw-r--r--  0 0      0         560 Dec 12 10:58 package/docs/RetrieveCatalogObjectResponse.md
-rw-r--r--  0 0      0         152 Dec 12 10:58 package/docs/RetrieveCustomerRequest.md
-rw-r--r--  0 0      0         334 Dec 12 10:58 package/docs/RetrieveCustomerResponse.md
-rw-r--r--  0 0      0         155 Dec 12 10:58 package/docs/RetrieveTransactionRequest.md
-rw-r--r--  0 0      0         349 Dec 12 10:58 package/docs/RetrieveTransactionResponse.md
-rw-r--r--  0 0      0        2834 Dec 12 10:58 package/docs/SearchCatalogObjectsRequest.md
-rw-r--r--  0 0      0         766 Dec 12 10:58 package/docs/SearchCatalogObjectsResponse.md
-rw-r--r--  0 0      0          92 Dec 12 10:58 package/docs/SortOrder.md
-rw-r--r--  0 0      0         146 Dec 12 10:58 package/docs/TaxCalculationPhase.md
-rw-r--r--  0 0      0         119 Dec 12 10:58 package/docs/TaxInclusionType.md
-rw-r--r--  0 0      0        2204 Dec 12 10:58 package/docs/Tender.md
-rw-r--r--  0 0      0         995 Dec 12 10:58 package/docs/TenderCardDetails.md
-rw-r--r--  0 0      0         221 Dec 12 10:58 package/docs/TenderCardDetailsEntryMethod.md
-rw-r--r--  0 0      0         192 Dec 12 10:58 package/docs/TenderCardDetailsStatus.md
-rw-r--r--  0 0      0         385 Dec 12 10:58 package/docs/TenderCashDetails.md
-rw-r--r--  0 0      0         263 Dec 12 10:58 package/docs/TenderType.md
-rw-r--r--  0 0      0        2211 Dec 12 10:58 package/docs/Transaction.md
-rw-r--r--  0 0      0         349 Dec 12 10:58 package/docs/TransactionProduct.md
-rw-r--r--  0 0      0       16310 Dec 12 10:58 package/docs/TransactionsApi.md
-rw-r--r--  0 0      0         960 Dec 12 10:58 package/docs/UpdateCustomerRequest.md
-rw-r--r--  0 0      0         330 Dec 12 10:58 package/docs/UpdateCustomerResponse.md
-rw-r--r--  0 0      0         684 Dec 12 10:58 package/docs/UpdateItemModifierListsRequest.md
-rw-r--r--  0 0      0         427 Dec 12 10:58 package/docs/UpdateItemModifierListsResponse.md
-rw-r--r--  0 0      0         626 Dec 12 10:58 package/docs/UpdateItemTaxesRequest.md
-rw-r--r--  0 0      0         419 Dec 12 10:58 package/docs/UpdateItemTaxesResponse.md
-rw-r--r--  0 0      0         988 Dec 12 10:58 package/docs/UpsertCatalogObjectRequest.md
-rw-r--r--  0 0      0         517 Dec 12 10:58 package/docs/UpsertCatalogObjectResponse.md
-rw-r--r--  0 0      0         420 Dec 12 10:58 package/docs/V1AdjustInventoryRequest.md
-rw-r--r--  0 0      0        1250 Dec 12 10:58 package/docs/V1BankAccount.md
-rw-r--r--  0 0      0        1373 Dec 12 10:58 package/docs/V1CashDrawerEvent.md
-rw-r--r--  0 0      0        2724 Dec 12 10:58 package/docs/V1CashDrawerShift.md
-rw-r--r--  0 0      0         268 Dec 12 10:58 package/docs/V1Category.md
-rw-r--r--  0 0      0         903 Dec 12 10:58 package/docs/V1CreateRefundRequest.md
-rw-r--r--  0 0      0        1647 Dec 12 10:58 package/docs/V1Discount.md
-rw-r--r--  0 0      0        1357 Dec 12 10:58 package/docs/V1Employee.md
-rw-r--r--  0 0      0        1359 Dec 12 10:58 package/docs/V1EmployeeRole.md
-rw-r--r--  0 0      0       32448 Dec 12 10:58 package/docs/V1EmployeesApi.md
-rw-r--r--  0 0      0        1995 Dec 12 10:58 package/docs/V1Fee.md
-rw-r--r--  0 0      0         337 Dec 12 10:58 package/docs/V1InventoryEntry.md
-rw-r--r--  0 0      0        2465 Dec 12 10:58 package/docs/V1Item.md
-rw-r--r--  0 0      0         281 Dec 12 10:58 package/docs/V1ItemImage.md
-rw-r--r--  0 0      0       69298 Dec 12 10:58 package/docs/V1ItemsApi.md
-rw-r--r--  0 0      0        2353 Dec 12 10:58 package/docs/V1LocationsApi.md
-rw-r--r--  0 0      0        5105 Dec 12 10:58 package/docs/V1Merchant.md
-rw-r--r--  0 0      0         347 Dec 12 10:58 package/docs/V1MerchantLocationDetails.md
-rw-r--r--  0 0      0         699 Dec 12 10:58 package/docs/V1ModifierList.md
-rw-r--r--  0 0      0         922 Dec 12 10:58 package/docs/V1ModifierOption.md
-rw-r--r--  0 0      0        5118 Dec 12 10:58 package/docs/V1Money.md
-rw-r--r--  0 0      0        3127 Dec 12 10:58 package/docs/V1Order.md
-rw-r--r--  0 0      0         661 Dec 12 10:58 package/docs/V1OrderHistoryEntry.md
-rw-r--r--  0 0      0         516 Dec 12 10:58 package/docs/V1Page.md
-rw-r--r--  0 0      0        1306 Dec 12 10:58 package/docs/V1PageCell.md
-rw-r--r--  0 0      0        3364 Dec 12 10:58 package/docs/V1Payment.md
-rw-r--r--  0 0      0         547 Dec 12 10:58 package/docs/V1PaymentDiscount.md
-rw-r--r--  0 0      0         528 Dec 12 10:58 package/docs/V1PaymentItemDetail.md
-rw-r--r--  0 0      0        2201 Dec 12 10:58 package/docs/V1PaymentItemization.md
-rw-r--r--  0 0      0         532 Dec 12 10:58 package/docs/V1PaymentModifier.md
-rw-r--r--  0 0      0         970 Dec 12 10:58 package/docs/V1PaymentTax.md
-rw-r--r--  0 0      0         315 Dec 12 10:58 package/docs/V1PhoneNumber.md
-rw-r--r--  0 0      0         933 Dec 12 10:58 package/docs/V1Refund.md
-rw-r--r--  0 0      0        1014 Dec 12 10:58 package/docs/V1Settlement.md
-rw-r--r--  0 0      0        1661 Dec 12 10:58 package/docs/V1SettlementEntry.md
-rw-r--r--  0 0      0        2578 Dec 12 10:58 package/docs/V1Tender.md
-rw-r--r--  0 0      0        1214 Dec 12 10:58 package/docs/V1Timecard.md
-rw-r--r--  0 0      0        1044 Dec 12 10:58 package/docs/V1TimecardEvent.md
-rw-r--r--  0 0      0       27665 Dec 12 10:58 package/docs/V1TransactionsApi.md
-rw-r--r--  0 0      0         495 Dec 12 10:58 package/docs/V1UpdateModifierListRequest.md
-rw-r--r--  0 0      0         965 Dec 12 10:58 package/docs/V1UpdateOrderRequest.md
-rw-r--r--  0 0      0        2048 Dec 12 10:58 package/docs/V1Variation.md
-rw-r--r--  0 0      0         151 Dec 12 10:58 package/docs/VoidTransactionRequest.md
-rw-r--r--  0 0      0         250 Dec 12 10:58 package/docs/VoidTransactionResponse.md
-rw-r--r--  0 0      0        3584 Dec 12 10:58 package/src/api/ApplePayApi.js
-rw-r--r--  0 0      0       31525 Dec 12 10:58 package/src/api/CatalogApi.js
-rw-r--r--  0 0      0        3621 Dec 12 10:58 package/src/api/CheckoutApi.js
-rw-r--r--  0 0      0       17406 Dec 12 10:58 package/src/api/CustomersApi.js
-rw-r--r--  0 0      0        2577 Dec 12 10:58 package/src/api/LocationsApi.js
-rw-r--r--  0 0      0        7513 Dec 12 10:58 package/src/api/OrdersApi.js
-rw-r--r--  0 0      0        9939 Dec 12 10:58 package/src/api/ReportingApi.js
-rw-r--r--  0 0      0       23619 Dec 12 10:58 package/src/api/TransactionsApi.js
-rw-r--r--  0 0      0       40398 Dec 12 10:58 package/src/api/V1EmployeesApi.js
-rw-r--r--  0 0      0       97584 Dec 12 10:58 package/src/api/V1ItemsApi.js
-rw-r--r--  0 0      0        3366 Dec 12 10:58 package/src/api/V1LocationsApi.js
-rw-r--r--  0 0      0       36144 Dec 12 10:58 package/src/api/V1TransactionsApi.js
-rw-r--r--  0 0      0       17289 Dec 12 10:58 package/src/ApiClient.js
-rw-r--r--  0 0      0       43540 Dec 12 10:58 package/src/index.js
-rw-r--r--  0 0      0        3120 Dec 12 10:58 package/src/model/AdditionalRecipient.js
-rw-r--r--  0 0      0        4412 Dec 12 10:58 package/src/model/AdditionalRecipientReceivable.js
-rw-r--r--  0 0      0        4317 Dec 12 10:58 package/src/model/AdditionalRecipientReceivableRefund.js
-rw-r--r--  0 0      0       22477 Dec 12 10:58 package/src/model/Address.js
-rw-r--r--  0 0      0        1956 Dec 12 10:58 package/src/model/BatchDeleteCatalogObjectsRequest.js
-rw-r--r--  0 0      0        2419 Dec 12 10:58 package/src/model/BatchDeleteCatalogObjectsResponse.js
-rw-r--r--  0 0      0        2797 Dec 12 10:58 package/src/model/BatchRetrieveCatalogObjectsRequest.js
-rw-r--r--  0 0      0        2473 Dec 12 10:58 package/src/model/BatchRetrieveCatalogObjectsResponse.js
-rw-r--r--  0 0      0        1856 Dec 12 10:58 package/src/model/BatchRetrieveOrdersRequest.js
-rw-r--r--  0 0      0        2170 Dec 12 10:58 package/src/model/BatchRetrieveOrdersResponse.js
-rw-r--r--  0 0      0        4294 Dec 12 10:58 package/src/model/BatchUpsertCatalogObjectsRequest.js
-rw-r--r--  0 0      0        2788 Dec 12 10:58 package/src/model/BatchUpsertCatalogObjectsResponse.js
-rw-r--r--  0 0      0        1367 Dec 12 10:58 package/src/model/CaptureTransactionRequest.js
-rw-r--r--  0 0      0        1811 Dec 12 10:58 package/src/model/CaptureTransactionResponse.js
-rw-r--r--  0 0      0        4854 Dec 12 10:58 package/src/model/Card.js
-rw-r--r--  0 0      0        1537 Dec 12 10:58 package/src/model/CardBrand.js
-rw-r--r--  0 0      0        1688 Dec 12 10:58 package/src/model/CatalogCategory.js
-rw-r--r--  0 0      0        4298 Dec 12 10:58 package/src/model/CatalogDiscount.js
-rw-r--r--  0 0      0        1227 Dec 12 10:58 package/src/model/CatalogDiscountType.js
-rw-r--r--  0 0      0        2019 Dec 12 10:58 package/src/model/CatalogIdMapping.js
-rw-r--r--  0 0      0        1311 Dec 12 10:58 package/src/model/CatalogInfoRequest.js
-rw-r--r--  0 0      0        1937 Dec 12 10:58 package/src/model/CatalogInfoResponse.js
-rw-r--r--  0 0      0        6476 Dec 12 10:58 package/src/model/CatalogInfoResponseLimits.js
-rw-r--r--  0 0      0        7804 Dec 12 10:58 package/src/model/CatalogItem.js
-rw-r--r--  0 0      0        3870 Dec 12 10:58 package/src/model/CatalogItemModifierListInfo.js
-rw-r--r--  0 0      0        1288 Dec 12 10:58 package/src/model/CatalogItemProductType.js
-rw-r--r--  0 0      0        7062 Dec 12 10:58 package/src/model/CatalogItemVariation.js
-rw-r--r--  0 0      0        1920 Dec 12 10:58 package/src/model/CatalogModifier.js
-rw-r--r--  0 0      0        3734 Dec 12 10:58 package/src/model/CatalogModifierList.js
-rw-r--r--  0 0      0        1037 Dec 12 10:58 package/src/model/CatalogModifierListSelectionType.js
-rw-r--r--  0 0      0        2221 Dec 12 10:58 package/src/model/CatalogModifierOverride.js
-rw-r--r--  0 0      0       11479 Dec 12 10:58 package/src/model/CatalogObject.js
-rw-r--r--  0 0      0        1723 Dec 12 10:58 package/src/model/CatalogObjectBatch.js
-rw-r--r--  0 0      0        1354 Dec 12 10:58 package/src/model/CatalogObjectType.js
-rw-r--r--  0 0      0        1026 Dec 12 10:58 package/src/model/CatalogPricingType.js
-rw-r--r--  0 0      0        5656 Dec 12 10:58 package/src/model/CatalogQuery.js
-rw-r--r--  0 0      0        2144 Dec 12 10:58 package/src/model/CatalogQueryExact.js
-rw-r--r--  0 0      0        2049 Dec 12 10:58 package/src/model/CatalogQueryItemsForModifierList.js
-rw-r--r--  0 0      0        1854 Dec 12 10:58 package/src/model/CatalogQueryItemsForTax.js
-rw-r--r--  0 0      0        2175 Dec 12 10:58 package/src/model/CatalogQueryPrefix.js
-rw-r--r--  0 0      0        2379 Dec 12 10:58 package/src/model/CatalogQueryRange.js
-rw-r--r--  0 0      0        3041 Dec 12 10:58 package/src/model/CatalogQuerySortedAttribute.js
-rw-r--r--  0 0      0        1794 Dec 12 10:58 package/src/model/CatalogQueryText.js
-rw-r--r--  0 0      0        4216 Dec 12 10:58 package/src/model/CatalogTax.js
-rw-r--r--  0 0      0        1958 Dec 12 10:58 package/src/model/CatalogV1Id.js
-rw-r--r--  0 0      0        8725 Dec 12 10:58 package/src/model/ChargeRequest.js
-rw-r--r--  0 0      0        2929 Dec 12 10:58 package/src/model/ChargeRequestAdditionalRecipient.js
-rw-r--r--  0 0      0        2102 Dec 12 10:58 package/src/model/ChargeResponse.js
-rw-r--r--  0 0      0        6007 Dec 12 10:58 package/src/model/Checkout.js
-rw-r--r--  0 0      0       14547 Dec 12 10:58 package/src/model/Country.js
-rw-r--r--  0 0      0        7565 Dec 12 10:58 package/src/model/CreateCheckoutRequest.js
-rw-r--r--  0 0      0        2179 Dec 12 10:58 package/src/model/CreateCheckoutResponse.js
-rw-r--r--  0 0      0        3203 Dec 12 10:58 package/src/model/CreateCustomerCardRequest.js
-rw-r--r--  0 0      0        2153 Dec 12 10:58 package/src/model/CreateCustomerCardResponse.js
-rw-r--r--  0 0      0        3875 Dec 12 10:58 package/src/model/CreateCustomerRequest.js
-rw-r--r--  0 0      0        2149 Dec 12 10:58 package/src/model/CreateCustomerResponse.js
-rw-r--r--  0 0      0        3739 Dec 12 10:58 package/src/model/CreateOrderRequest.js
-rw-r--r--  0 0      0        2939 Dec 12 10:58 package/src/model/CreateOrderRequestDiscount.js
-rw-r--r--  0 0      0        5465 Dec 12 10:58 package/src/model/CreateOrderRequestLineItem.js
-rw-r--r--  0 0      0        1919 Dec 12 10:58 package/src/model/CreateOrderRequestModifier.js
-rw-r--r--  0 0      0        3406 Dec 12 10:58 package/src/model/CreateOrderRequestTax.js
-rw-r--r--  0 0      0        2092 Dec 12 10:58 package/src/model/CreateOrderResponse.js
-rw-r--r--  0 0      0        4495 Dec 12 10:58 package/src/model/CreateRefundRequest.js
-rw-r--r--  0 0      0        2107 Dec 12 10:58 package/src/model/CreateRefundResponse.js
-rw-r--r--  0 0      0       11338 Dec 12 10:58 package/src/model/Currency.js
-rw-r--r--  0 0      0        5841 Dec 12 10:58 package/src/model/Customer.js
-rw-r--r--  0 0      0        1981 Dec 12 10:58 package/src/model/CustomerGroupInfo.js
-rw-r--r--  0 0      0        1706 Dec 12 10:58 package/src/model/CustomerPreferences.js
-rw-r--r--  0 0      0        1375 Dec 12 10:58 package/src/model/DeleteCatalogObjectRequest.js
-rw-r--r--  0 0      0        2620 Dec 12 10:58 package/src/model/DeleteCatalogObjectResponse.js
-rw-r--r--  0 0      0        1367 Dec 12 10:58 package/src/model/DeleteCustomerCardRequest.js
-rw-r--r--  0 0      0        1811 Dec 12 10:58 package/src/model/DeleteCustomerCardResponse.js
-rw-r--r--  0 0      0        1335 Dec 12 10:58 package/src/model/DeleteCustomerRequest.js
-rw-r--r--  0 0      0        1771 Dec 12 10:58 package/src/model/DeleteCustomerResponse.js
-rw-r--r--  0 0      0        1654 Dec 12 10:58 package/src/model/Device.js
-rw-r--r--  0 0      0       12863 Dec 12 10:58 package/src/model/Error.js
-rw-r--r--  0 0      0        1409 Dec 12 10:58 package/src/model/ErrorCategory.js
-rw-r--r--  0 0      0        9093 Dec 12 10:58 package/src/model/ErrorCode.js
-rw-r--r--  0 0      0         987 Dec 12 10:58 package/src/model/InventoryAlertType.js
-rw-r--r--  0 0      0        4875 Dec 12 10:58 package/src/model/ItemVariationLocationOverrides.js
-rw-r--r--  0 0      0        3628 Dec 12 10:58 package/src/model/ListAdditionalRecipientReceivableRefundsRequest.js
-rw-r--r--  0 0      0        3095 Dec 12 10:58 package/src/model/ListAdditionalRecipientReceivableRefundsResponse.js
-rw-r--r--  0 0      0        3562 Dec 12 10:58 package/src/model/ListAdditionalRecipientReceivablesRequest.js
-rw-r--r--  0 0      0        2963 Dec 12 10:58 package/src/model/ListAdditionalRecipientReceivablesResponse.js
-rw-r--r--  0 0      0        2213 Dec 12 10:58 package/src/model/ListCatalogRequest.js
-rw-r--r--  0 0      0        2325 Dec 12 10:58 package/src/model/ListCatalogResponse.js
-rw-r--r--  0 0      0        1857 Dec 12 10:58 package/src/model/ListCustomersRequest.js
-rw-r--r--  0 0      0        2649 Dec 12 10:58 package/src/model/ListCustomersResponse.js
-rw-r--r--  0 0      0        1327 Dec 12 10:58 package/src/model/ListLocationsRequest.js
-rw-r--r--  0 0      0        2164 Dec 12 10:58 package/src/model/ListLocationsResponse.js
-rw-r--r--  0 0      0        3309 Dec 12 10:58 package/src/model/ListRefundsRequest.js
-rw-r--r--  0 0      0        2573 Dec 12 10:58 package/src/model/ListRefundsResponse.js
-rw-r--r--  0 0      0        3364 Dec 12 10:58 package/src/model/ListTransactionsRequest.js
-rw-r--r--  0 0      0        2678 Dec 12 10:58 package/src/model/ListTransactionsResponse.js
-rw-r--r--  0 0      0       36012 Dec 12 10:58 package/src/model/Location.js
-rw-r--r--  0 0      0         944 Dec 12 10:58 package/src/model/LocationCapability.js
-rw-r--r--  0 0      0         965 Dec 12 10:58 package/src/model/LocationStatus.js
-rw-r--r--  0 0      0         957 Dec 12 10:58 package/src/model/LocationType.js
-rw-r--r--  0 0      0       14721 Dec 12 10:58 package/src/model/Money.js
-rw-r--r--  0 0      0        3628 Dec 12 10:58 package/src/model/Order.js
-rw-r--r--  0 0      0        5497 Dec 12 10:58 package/src/model/OrderLineItem.js
-rw-r--r--  0 0      0        5624 Dec 12 10:58 package/src/model/OrderLineItemDiscount.js
-rw-r--r--  0 0      0        1122 Dec 12 10:58 package/src/model/OrderLineItemDiscountScope.js
-rw-r--r--  0 0      0        1348 Dec 12 10:58 package/src/model/OrderLineItemDiscountType.js
-rw-r--r--  0 0      0        2656 Dec 12 10:58 package/src/model/OrderLineItemModifier.js
-rw-r--r--  0 0      0        3325 Dec 12 10:58 package/src/model/OrderLineItemTax.js
-rw-r--r--  0 0      0        1080 Dec 12 10:58 package/src/model/OrderLineItemTaxType.js
-rw-r--r--  0 0      0        5645 Dec 12 10:58 package/src/model/Refund.js
-rw-r--r--  0 0      0        1100 Dec 12 10:58 package/src/model/RefundStatus.js
-rw-r--r--  0 0      0        1920 Dec 12 10:58 package/src/model/RegisterDomainRequest.js
-rw-r--r--  0 0      0        2537 Dec 12 10:58 package/src/model/RegisterDomainResponse.js
-rw-r--r--  0 0      0        1024 Dec 12 10:58 package/src/model/RegisterDomainResponseStatus.js
-rw-r--r--  0 0      0        2318 Dec 12 10:58 package/src/model/RetrieveCatalogObjectRequest.js
-rw-r--r--  0 0      0        2398 Dec 12 10:58 package/src/model/RetrieveCatalogObjectResponse.js
-rw-r--r--  0 0      0        1351 Dec 12 10:58 package/src/model/RetrieveCustomerRequest.js
-rw-r--r--  0 0      0        2171 Dec 12 10:58 package/src/model/RetrieveCustomerResponse.js
-rw-r--r--  0 0      0        1375 Dec 12 10:58 package/src/model/RetrieveTransactionRequest.js
-rw-r--r--  0 0      0        2233 Dec 12 10:58 package/src/model/RetrieveTransactionResponse.js
-rw-r--r--  0 0      0        5658 Dec 12 10:58 package/src/model/SearchCatalogObjectsRequest.js
-rw-r--r--  0 0      0        2777 Dec 12 10:58 package/src/model/SearchCatalogObjectsResponse.js
-rw-r--r--  0 0      0         924 Dec 12 10:58 package/src/model/SortOrder.js
-rw-r--r--  0 0      0        1034 Dec 12 10:58 package/src/model/TaxCalculationPhase.js
-rw-r--r--  0 0      0         982 Dec 12 10:58 package/src/model/TaxInclusionType.js
-rw-r--r--  0 0      0        6350 Dec 12 10:58 package/src/model/Tender.js
-rw-r--r--  0 0      0        3413 Dec 12 10:58 package/src/model/TenderCardDetails.js
-rw-r--r--  0 0      0        1222 Dec 12 10:58 package/src/model/TenderCardDetailsEntryMethod.js
-rw-r--r--  0 0      0        1147 Dec 12 10:58 package/src/model/TenderCardDetailsStatus.js
-rw-r--r--  0 0      0        2062 Dec 12 10:58 package/src/model/TenderCashDetails.js
-rw-r--r--  0 0      0        1259 Dec 12 10:58 package/src/model/TenderType.js
-rw-r--r--  0 0      0        5849 Dec 12 10:58 package/src/model/Transaction.js
-rw-r--r--  0 0      0        1446 Dec 12 10:58 package/src/model/TransactionProduct.js
-rw-r--r--  0 0      0        3875 Dec 12 10:58 package/src/model/UpdateCustomerRequest.js
-rw-r--r--  0 0      0        2149 Dec 12 10:58 package/src/model/UpdateCustomerResponse.js
-rw-r--r--  0 0      0        2801 Dec 12 10:58 package/src/model/UpdateItemModifierListsRequest.js
-rw-r--r--  0 0      0        2051 Dec 12 10:58 package/src/model/UpdateItemModifierListsResponse.js
-rw-r--r--  0 0      0        2613 Dec 12 10:58 package/src/model/UpdateItemTaxesRequest.js
-rw-r--r--  0 0      0        1987 Dec 12 10:58 package/src/model/UpdateItemTaxesResponse.js
-rw-r--r--  0 0      0        3462 Dec 12 10:58 package/src/model/UpsertCatalogObjectRequest.js
-rw-r--r--  0 0      0        2423 Dec 12 10:58 package/src/model/UpsertCatalogObjectResponse.js
-rw-r--r--  0 0      0        2166 Dec 12 10:58 package/src/model/V1AdjustInventoryRequest.js
-rw-r--r--  0 0      0        4182 Dec 12 10:58 package/src/model/V1BankAccount.js
-rw-r--r--  0 0      0        4231 Dec 12 10:58 package/src/model/V1CashDrawerEvent.js
-rw-r--r--  0 0      0        7877 Dec 12 10:58 package/src/model/V1CashDrawerShift.js
-rw-r--r--  0 0      0        1664 Dec 12 10:58 package/src/model/V1Category.js
-rw-r--r--  0 0      0        3766 Dec 12 10:58 package/src/model/V1CreateRefundRequest.js
-rw-r--r--  0 0      0        4735 Dec 12 10:58 package/src/model/V1Discount.js
-rw-r--r--  0 0      0        4690 Dec 12 10:58 package/src/model/V1Employee.js
-rw-r--r--  0 0      0        4340 Dec 12 10:58 package/src/model/V1EmployeeRole.js
-rw-r--r--  0 0      0        5797 Dec 12 10:58 package/src/model/V1Fee.js
-rw-r--r--  0 0      0        1874 Dec 12 10:58 package/src/model/V1InventoryEntry.js
-rw-r--r--  0 0      0        7035 Dec 12 10:58 package/src/model/V1Item.js
-rw-r--r--  0 0      0        1680 Dec 12 10:58 package/src/model/V1ItemImage.js
-rw-r--r--  0 0      0       12498 Dec 12 10:58 package/src/model/V1Merchant.js
-rw-r--r--  0 0      0        1839 Dec 12 10:58 package/src/model/V1MerchantLocationDetails.js
-rw-r--r--  0 0      0        2796 Dec 12 10:58 package/src/model/V1ModifierList.js
-rw-r--r--  0 0      0        3127 Dec 12 10:58 package/src/model/V1ModifierOption.js
-rw-r--r--  0 0      0       14225 Dec 12 10:58 package/src/model/V1Money.js
-rw-r--r--  0 0      0        9474 Dec 12 10:58 package/src/model/V1Order.js
-rw-r--r--  0 0      0        2630 Dec 12 10:58 package/src/model/V1OrderHistoryEntry.js
-rw-r--r--  0 0      0        2261 Dec 12 10:58 package/src/model/V1Page.js
-rw-r--r--  0 0      0        4028 Dec 12 10:58 package/src/model/V1PageCell.js
-rw-r--r--  0 0      0        9193 Dec 12 10:58 package/src/model/V1Payment.js
-rw-r--r--  0 0      0        2253 Dec 12 10:58 package/src/model/V1PaymentDiscount.js
-rw-r--r--  0 0      0        2403 Dec 12 10:58 package/src/model/V1PaymentItemDetail.js
-rw-r--r--  0 0      0        6641 Dec 12 10:58 package/src/model/V1PaymentItemization.js
-rw-r--r--  0 0      0        2267 Dec 12 10:58 package/src/model/V1PaymentModifier.js
-rw-r--r--  0 0      0        3390 Dec 12 10:58 package/src/model/V1PaymentTax.js
-rw-r--r--  0 0      0        2085 Dec 12 10:58 package/src/model/V1PhoneNumber.js
-rw-r--r--  0 0      0        3487 Dec 12 10:58 package/src/model/V1Refund.js
-rw-r--r--  0 0      0        3460 Dec 12 10:58 package/src/model/V1Settlement.js
-rw-r--r--  0 0      0        4692 Dec 12 10:58 package/src/model/V1SettlementEntry.js
-rw-r--r--  0 0      0        7501 Dec 12 10:58 package/src/model/V1Tender.js
-rw-r--r--  0 0      0        4167 Dec 12 10:58 package/src/model/V1Timecard.js
-rw-r--r--  0 0      0        3610 Dec 12 10:58 package/src/model/V1TimecardEvent.js
-rw-r--r--  0 0      0        2291 Dec 12 10:58 package/src/model/V1UpdateModifierListRequest.js
-rw-r--r--  0 0      0        3542 Dec 12 10:58 package/src/model/V1UpdateOrderRequest.js
-rw-r--r--  0 0      0        5775 Dec 12 10:58 package/src/model/V1Variation.js
-rw-r--r--  0 0      0        1343 Dec 12 10:58 package/src/model/VoidTransactionRequest.js
-rw-r--r--  0 0      0        1787 Dec 12 10:58 package/src/model/VoidTransactionResponse.js
-rw-r--r--  0 0      0        1276 Dec 12 10:58 package/test/api/ApplePayApi.spec.js
-rw-r--r--  0 0      0       11924 Dec 12 10:58 package/test/api/CatalogApi.spec.js
-rw-r--r--  0 0      0        3009 Dec 12 10:58 package/test/api/CheckoutApi.spec.js
-rw-r--r--  0 0      0        5111 Dec 12 10:58 package/test/api/CustomersApi.spec.js
-rw-r--r--  0 0      0         782 Dec 12 10:58 package/test/api/LocationsApi.spec.js
-rw-r--r--  0 0      0        1608 Dec 12 10:58 package/test/api/OrdersApi.spec.js
-rw-r--r--  0 0      0        1536 Dec 12 10:58 package/test/api/ReportingApi.spec.js
-rw-r--r--  0 0      0        5096 Dec 12 10:58 package/test/api/TransactionsApi.spec.js
-rw-r--r--  0 0      0        6319 Dec 12 10:58 package/test/api/V1EmployeesApi.spec.js
-rw-r--r--  0 0      0       13903 Dec 12 10:58 package/test/api/V1ItemsApi.spec.js
-rw-r--r--  0 0      0        1614 Dec 12 10:58 package/test/api/V1LocationsApi.spec.js
-rw-r--r--  0 0      0        4535 Dec 12 10:58 package/test/api/V1TransactionsApi.spec.js
-rw-r--r--  0 0      0          50 Dec 12 10:58 package/test/mocha.opts
-rw-r--r--  0 0      0        1847 Dec 12 10:58 package/test/model/AdditionalRecipient.spec.js
-rw-r--r--  0 0      0        2480 Dec 12 10:58 package/test/model/AdditionalRecipientReceivable.spec.js
-rw-r--r--  0 0      0        2553 Dec 12 10:58 package/test/model/AdditionalRecipientReceivableRefund.spec.js
-rw-r--r--  0 0      0        4604 Dec 12 10:58 package/test/model/Address.spec.js
-rw-r--r--  0 0      0        1150 Dec 12 10:58 package/test/model/BatchDeleteCatalogObjectsRequest.spec.js
-rw-r--r--  0 0      0        1707 Dec 12 10:58 package/test/model/BatchDeleteCatalogObjectsResponse.spec.js
-rw-r--r--  0 0      0        1471 Dec 12 10:58 package/test/model/BatchRetrieveCatalogObjectsRequest.spec.js
-rw-r--r--  0 0      0        1711 Dec 12 10:58 package/test/model/BatchRetrieveCatalogObjectsResponse.spec.js
-rw-r--r--  0 0      0        1105 Dec 12 10:58 package/test/model/BatchRetrieveOrdersRequest.spec.js
-rw-r--r--  0 0      0        1358 Dec 12 10:58 package/test/model/BatchRetrieveOrdersResponse.spec.js
-rw-r--r--  0 0      0        1426 Dec 12 10:58 package/test/model/BatchUpsertCatalogObjectsRequest.spec.js
-rw-r--r--  0 0      0        1950 Dec 12 10:58 package/test/model/BatchUpsertCatalogObjectsResponse.spec.js
-rw-r--r--  0 0      0         840 Dec 12 10:58 package/test/model/CaptureTransactionRequest.spec.js
-rw-r--r--  0 0      0        1098 Dec 12 10:58 package/test/model/CaptureTransactionResponse.spec.js
-rw-r--r--  0 0      0        2626 Dec 12 10:58 package/test/model/Card.spec.js
-rw-r--r--  0 0      0         698 Dec 12 10:58 package/test/model/CardBrand.spec.js
-rw-r--r--  0 0      0        1015 Dec 12 10:58 package/test/model/CatalogCategory.spec.js
-rw-r--r--  0 0      0        2296 Dec 12 10:58 package/test/model/CatalogDiscount.spec.js
-rw-r--r--  0 0      0         748 Dec 12 10:58 package/test/model/CatalogDiscountType.spec.js
-rw-r--r--  0 0      0        1303 Dec 12 10:58 package/test/model/CatalogIdMapping.spec.js
-rw-r--r--  0 0      0         798 Dec 12 10:58 package/test/model/CatalogInfoRequest.spec.js
-rw-r--r--  0 0      0        1294 Dec 12 10:58 package/test/model/CatalogInfoResponse.spec.js
-rw-r--r--  0 0      0        4473 Dec 12 10:58 package/test/model/CatalogInfoResponseLimits.spec.js
-rw-r--r--  0 0      0        4351 Dec 12 10:58 package/test/model/CatalogItem.spec.js
-rw-r--r--  0 0      0        2268 Dec 12 10:58 package/test/model/CatalogItemModifierListInfo.spec.js
-rw-r--r--  0 0      0         763 Dec 12 10:58 package/test/model/CatalogItemProductType.spec.js
-rw-r--r--  0 0      0        4202 Dec 12 10:58 package/test/model/CatalogItemVariation.spec.js
-rw-r--r--  0 0      0        1269 Dec 12 10:58 package/test/model/CatalogModifier.spec.js
-rw-r--r--  0 0      0        1564 Dec 12 10:58 package/test/model/CatalogModifierList.spec.js
-rw-r--r--  0 0      0         813 Dec 12 10:58 package/test/model/CatalogModifierListSelectionType.spec.js
-rw-r--r--  0 0      0        1356 Dec 12 10:58 package/test/model/CatalogModifierOverride.spec.js
-rw-r--r--  0 0      0        4887 Dec 12 10:58 package/test/model/CatalogObject.spec.js
-rw-r--r--  0 0      0        1045 Dec 12 10:58 package/test/model/CatalogObjectBatch.spec.js
-rw-r--r--  0 0      0         738 Dec 12 10:58 package/test/model/CatalogObjectType.spec.js
-rw-r--r--  0 0      0         743 Dec 12 10:58 package/test/model/CatalogPricingType.spec.js
-rw-r--r--  0 0      0        2618 Dec 12 10:58 package/test/model/CatalogQuery.spec.js
-rw-r--r--  0 0      0        1325 Dec 12 10:58 package/test/model/CatalogQueryExact.spec.js
-rw-r--r--  0 0      0        1169 Dec 12 10:58 package/test/model/CatalogQueryItemsForModifierList.spec.js
-rw-r--r--  0 0      0        1078 Dec 12 10:58 package/test/model/CatalogQueryItemsForTax.spec.js
-rw-r--r--  0 0      0        1336 Dec 12 10:58 package/test/model/CatalogQueryPrefix.spec.js
-rw-r--r--  0 0      0        1613 Dec 12 10:58 package/test/model/CatalogQueryRange.spec.js
-rw-r--r--  0 0      0        1690 Dec 12 10:58 package/test/model/CatalogQuerySortedAttribute.spec.js
-rw-r--r--  0 0      0        1034 Dec 12 10:58 package/test/model/CatalogQueryText.spec.js
-rw-r--r--  0 0      0        2279 Dec 12 10:58 package/test/model/CatalogTax.spec.js
-rw-r--r--  0 0      0        1260 Dec 12 10:58 package/test/model/CatalogV1Id.spec.js
-rw-r--r--  0 0      0        4129 Dec 12 10:58 package/test/model/ChargeRequest.spec.js
-rw-r--r--  0 0      0        1700 Dec 12 10:58 package/test/model/ChargeRequestAdditionalRecipient.spec.js
-rw-r--r--  0 0      0        1269 Dec 12 10:58 package/test/model/ChargeResponse.spec.js
-rw-r--r--  0 0      0        3364 Dec 12 10:58 package/test/model/Checkout.spec.js
-rw-r--r--  0 0      0         688 Dec 12 10:58 package/test/model/Country.spec.js
-rw-r--r--  0 0      0        3076 Dec 12 10:58 package/test/model/CreateCheckoutRequest.spec.js
-rw-r--r--  0 0      0        1324 Dec 12 10:58 package/test/model/CreateCheckoutResponse.spec.js
-rw-r--r--  0 0      0        1653 Dec 12 10:58 package/test/model/CreateCustomerCardRequest.spec.js
-rw-r--r--  0 0      0        1344 Dec 12 10:58 package/test/model/CreateCustomerCardResponse.spec.js
-rw-r--r--  0 0      0        3132 Dec 12 10:58 package/test/model/CreateCustomerRequest.spec.js
-rw-r--r--  0 0      0        1324 Dec 12 10:58 package/test/model/CreateCustomerResponse.spec.js
-rw-r--r--  0 0      0        2075 Dec 12 10:58 package/test/model/CreateOrderRequest.spec.js
-rw-r--r--  0 0      0        1905 Dec 12 10:58 package/test/model/CreateOrderRequestDiscount.spec.js
-rw-r--r--  0 0      0        3200 Dec 12 10:58 package/test/model/CreateOrderRequestLineItem.spec.js
-rw-r--r--  0 0      0        1127 Dec 12 10:58 package/test/model/CreateOrderRequestModifier.spec.js
-rw-r--r--  0 0      0        1833 Dec 12 10:58 package/test/model/CreateOrderRequestTax.spec.js
-rw-r--r--  0 0      0        1291 Dec 12 10:58 package/test/model/CreateOrderResponse.spec.js
-rw-r--r--  0 0      0        1832 Dec 12 10:58 package/test/model/CreateRefundRequest.spec.js
-rw-r--r--  0 0      0        1302 Dec 12 10:58 package/test/model/CreateRefundResponse.spec.js
-rw-r--r--  0 0      0         693 Dec 12 10:58 package/test/model/Currency.spec.js
-rw-r--r--  0 0      0        4361 Dec 12 10:58 package/test/model/Customer.spec.js
-rw-r--r--  0 0      0        1260 Dec 12 10:58 package/test/model/CustomerGroupInfo.spec.js
-rw-r--r--  0 0      0        1083 Dec 12 10:58 package/test/model/CustomerPreferences.spec.js
-rw-r--r--  0 0      0         846 Dec 12 10:58 package/test/model/DeleteCatalogObjectRequest.spec.js
-rw-r--r--  0 0      0        1653 Dec 12 10:58 package/test/model/DeleteCatalogObjectResponse.spec.js
-rw-r--r--  0 0      0         840 Dec 12 10:58 package/test/model/DeleteCustomerCardRequest.spec.js
-rw-r--r--  0 0      0        1098 Dec 12 10:58 package/test/model/DeleteCustomerCardResponse.spec.js
-rw-r--r--  0 0      0         816 Dec 12 10:58 package/test/model/DeleteCustomerRequest.spec.js
-rw-r--r--  0 0      0        1070 Dec 12 10:58 package/test/model/DeleteCustomerResponse.spec.js
-rw-r--r--  0 0      0        1172 Dec 12 10:58 package/test/model/Device.spec.js
-rw-r--r--  0 0      0        1641 Dec 12 10:58 package/test/model/Error.spec.js
-rw-r--r--  0 0      0         718 Dec 12 10:58 package/test/model/ErrorCategory.spec.js
-rw-r--r--  0 0      0         698 Dec 12 10:58 package/test/model/ErrorCode.spec.js
-rw-r--r--  0 0      0         743 Dec 12 10:58 package/test/model/InventoryAlertType.spec.js
-rw-r--r--  0 0      0        2564 Dec 12 10:58 package/test/model/ItemVariationLocationOverrides.spec.js
-rw-r--r--  0 0      0        2088 Dec 12 10:58 package/test/model/ListAdditionalRecipientReceivableRefundsRequest.spec.js
-rw-r--r--  0 0      0        1834 Dec 12 10:58 package/test/model/ListAdditionalRecipientReceivableRefundsResponse.spec.js
-rw-r--r--  0 0      0        2028 Dec 12 10:58 package/test/model/ListAdditionalRecipientReceivablesRequest.spec.js
-rw-r--r--  0 0      0        1761 Dec 12 10:58 package/test/model/ListAdditionalRecipientReceivablesResponse.spec.js
-rw-r--r--  0 0      0        1283 Dec 12 10:58 package/test/model/ListCatalogRequest.spec.js
-rw-r--r--  0 0      0        1542 Dec 12 10:58 package/test/model/ListCatalogResponse.spec.js
-rw-r--r--  0 0      0        1056 Dec 12 10:58 package/test/model/ListCustomersRequest.spec.js
-rw-r--r--  0 0      0        1566 Dec 12 10:58 package/test/model/ListCustomersResponse.spec.js
-rw-r--r--  0 0      0         810 Dec 12 10:58 package/test/model/ListLocationsRequest.spec.js
-rw-r--r--  0 0      0        1319 Dec 12 10:58 package/test/model/ListLocationsResponse.spec.js
-rw-r--r--  0 0      0        1798 Dec 12 10:58 package/test/model/ListRefundsRequest.spec.js
-rw-r--r--  0 0      0        1542 Dec 12 10:58 package/test/model/ListRefundsResponse.spec.js
-rw-r--r--  0 0      0        1848 Dec 12 10:58 package/test/model/ListTransactionsRequest.spec.js
-rw-r--r--  0 0      0        1602 Dec 12 10:58 package/test/model/ListTransactionsResponse.spec.js
-rw-r--r--  0 0      0        4350 Dec 12 10:58 package/test/model/Location.spec.js
-rw-r--r--  0 0      0         743 Dec 12 10:58 package/test/model/LocationCapability.spec.js
-rw-r--r--  0 0      0         723 Dec 12 10:58 package/test/model/LocationStatus.spec.js
-rw-r--r--  0 0      0         713 Dec 12 10:58 package/test/model/LocationType.spec.js
-rw-r--r--  0 0      0        1188 Dec 12 10:58 package/test/model/Money.spec.js
-rw-r--r--  0 0      0        2438 Dec 12 10:58 package/test/model/Order.spec.js
-rw-r--r--  0 0      0        4064 Dec 12 10:58 package/test/model/OrderLineItem.spec.js
-rw-r--r--  0 0      0        2606 Dec 12 10:58 package/test/model/OrderLineItemDiscount.spec.js
-rw-r--r--  0 0      0         783 Dec 12 10:58 package/test/model/OrderLineItemDiscountScope.spec.js
-rw-r--r--  0 0      0         778 Dec 12 10:58 package/test/model/OrderLineItemDiscountType.spec.js
-rw-r--r--  0 0      0        1882 Dec 12 10:58 package/test/model/OrderLineItemModifier.spec.js
-rw-r--r--  0 0      0        2044 Dec 12 10:58 package/test/model/OrderLineItemTax.spec.js
-rw-r--r--  0 0      0         753 Dec 12 10:58 package/test/model/OrderLineItemTaxType.spec.js
-rw-r--r--  0 0      0        3183 Dec 12 10:58 package/test/model/Refund.spec.js
-rw-r--r--  0 0      0         713 Dec 12 10:58 package/test/model/RefundStatus.spec.js
-rw-r--r--  0 0      0        1076 Dec 12 10:58 package/test/model/RegisterDomainRequest.spec.js
-rw-r--r--  0 0      0        1318 Dec 12 10:58 package/test/model/RegisterDomainResponse.spec.js
-rw-r--r--  0 0      0         793 Dec 12 10:58 package/test/model/RegisterDomainResponseStatus.spec.js
-rw-r--r--  0 0      0        1159 Dec 12 10:58 package/test/model/RetrieveCatalogObjectRequest.spec.js
-rw-r--r--  0 0      0        1656 Dec 12 10:58 package/test/model/RetrieveCatalogObjectResponse.spec.js
-rw-r--r--  0 0      0         828 Dec 12 10:58 package/test/model/RetrieveCustomerRequest.spec.js
-rw-r--r--  0 0      0        1340 Dec 12 10:58 package/test/model/RetrieveCustomerResponse.spec.js
-rw-r--r--  0 0      0         846 Dec 12 10:58 package/test/model/RetrieveTransactionRequest.spec.js
-rw-r--r--  0 0      0        1373 Dec 12 10:58 package/test/model/RetrieveTransactionResponse.spec.js
-rw-r--r--  0 0      0        2737 Dec 12 10:58 package/test/model/SearchCatalogObjectsRequest.spec.js
-rw-r--r--  0 0      0        1902 Dec 12 10:58 package/test/model/SearchCatalogObjectsResponse.spec.js
-rw-r--r--  0 0      0         698 Dec 12 10:58 package/test/model/SortOrder.spec.js
-rw-r--r--  0 0      0         748 Dec 12 10:58 package/test/model/TaxCalculationPhase.spec.js
-rw-r--r--  0 0      0         733 Dec 12 10:58 package/test/model/TaxInclusionType.spec.js
-rw-r--r--  0 0      0        3912 Dec 12 10:58 package/test/model/Tender.spec.js
-rw-r--r--  0 0      0        1531 Dec 12 10:58 package/test/model/TenderCardDetails.spec.js
-rw-r--r--  0 0      0         793 Dec 12 10:58 package/test/model/TenderCardDetailsEntryMethod.spec.js
-rw-r--r--  0 0      0         768 Dec 12 10:58 package/test/model/TenderCardDetailsStatus.spec.js
-rw-r--r--  0 0      0        1345 Dec 12 10:58 package/test/model/TenderCashDetails.spec.js
-rw-r--r--  0 0      0         703 Dec 12 10:58 package/test/model/TenderType.spec.js
-rw-r--r--  0 0      0        3201 Dec 12 10:58 package/test/model/Transaction.spec.js
-rw-r--r--  0 0      0         743 Dec 12 10:58 package/test/model/TransactionProduct.spec.js
-rw-r--r--  0 0      0        3132 Dec 12 10:58 package/test/model/UpdateCustomerRequest.spec.js
-rw-r--r--  0 0      0        1324 Dec 12 10:58 package/test/model/UpdateCustomerResponse.spec.js
-rw-r--r--  0 0      0        1741 Dec 12 10:58 package/test/model/UpdateItemModifierListsRequest.spec.js
-rw-r--r--  0 0      0        1400 Dec 12 10:58 package/test/model/UpdateItemModifierListsResponse.spec.js
-rw-r--r--  0 0      0        1619 Dec 12 10:58 package/test/model/UpdateItemTaxesRequest.spec.js
-rw-r--r--  0 0      0        1336 Dec 12 10:58 package/test/model/UpdateItemTaxesResponse.spec.js
-rw-r--r--  0 0      0        1377 Dec 12 10:58 package/test/model/UpsertCatalogObjectRequest.spec.js
-rw-r--r--  0 0      0        1646 Dec 12 10:58 package/test/model/UpsertCatalogObjectResponse.spec.js
-rw-r--r--  0 0      0        1625 Dec 12 10:58 package/test/model/V1AdjustInventoryRequest.spec.js
-rw-r--r--  0 0      0        2758 Dec 12 10:58 package/test/model/V1BankAccount.spec.js
-rw-r--r--  0 0      0        2299 Dec 12 10:58 package/test/model/V1CashDrawerEvent.spec.js
-rw-r--r--  0 0      0        5784 Dec 12 10:58 package/test/model/V1CashDrawerShift.spec.js
-rw-r--r--  0 0      0        1204 Dec 12 10:58 package/test/model/V1Category.spec.js
-rw-r--r--  0 0      0        2124 Dec 12 10:58 package/test/model/V1CreateRefundRequest.spec.js
-rw-r--r--  0 0      0        2426 Dec 12 10:58 package/test/model/V1Discount.spec.js
-rw-r--r--  0 0      0        3196 Dec 12 10:58 package/test/model/V1Employee.spec.js
-rw-r--r--  0 0      0        2235 Dec 12 10:58 package/test/model/V1EmployeeRole.spec.js
-rw-r--r--  0 0      0        2901 Dec 12 10:58 package/test/model/V1Fee.spec.js
-rw-r--r--  0 0      0        1312 Dec 12 10:58 package/test/model/V1InventoryEntry.spec.js
-rw-r--r--  0 0      0        4073 Dec 12 10:58 package/test/model/V1Item.spec.js
-rw-r--r--  0 0      0        1209 Dec 12 10:58 package/test/model/V1ItemImage.spec.js
-rw-r--r--  0 0      0        4536 Dec 12 10:58 package/test/model/V1Merchant.spec.js
-rw-r--r--  0 0      0        1097 Dec 12 10:58 package/test/model/V1MerchantLocationDetails.spec.js
-rw-r--r--  0 0      0        1766 Dec 12 10:58 package/test/model/V1ModifierList.spec.js
-rw-r--r--  0 0      0        2279 Dec 12 10:58 package/test/model/V1ModifierOption.spec.js
-rw-r--r--  0 0      0        1217 Dec 12 10:58 package/test/model/V1Money.spec.js
-rw-r--r--  0 0      0        7002 Dec 12 10:58 package/test/model/V1Order.spec.js
-rw-r--r--  0 0      0        1304 Dec 12 10:58 package/test/model/V1OrderHistoryEntry.spec.js
-rw-r--r--  0 0      0        1643 Dec 12 10:58 package/test/model/V1Page.spec.js
-rw-r--r--  0 0      0        2206 Dec 12 10:58 package/test/model/V1PageCell.spec.js
-rw-r--r--  0 0      0        6810 Dec 12 10:58 package/test/model/V1Payment.spec.js
-rw-r--r--  0 0      0        1547 Dec 12 10:58 package/test/model/V1PaymentDiscount.spec.js
-rw-r--r--  0 0      0        1824 Dec 12 10:58 package/test/model/V1PaymentItemDetail.spec.js
-rw-r--r--  0 0      0        4470 Dec 12 10:58 package/test/model/V1PaymentItemization.spec.js
-rw-r--r--  0 0      0        1566 Dec 12 10:58 package/test/model/V1PaymentModifier.spec.js
-rw-r--r--  0 0      0        2217 Dec 12 10:58 package/test/model/V1PaymentTax.spec.js
-rw-r--r--  0 0      0        1264 Dec 12 10:58 package/test/model/V1PhoneNumber.spec.js
-rw-r--r--  0 0      0        2441 Dec 12 10:58 package/test/model/V1Refund.spec.js
-rw-r--r--  0 0      0        2233 Dec 12 10:58 package/test/model/V1Settlement.spec.js
-rw-r--r--  0 0      0        1791 Dec 12 10:58 package/test/model/V1SettlementEntry.spec.js
-rw-r--r--  0 0      0        3920 Dec 12 10:58 package/test/model/V1Tender.spec.js
-rw-r--r--  0 0      0        3006 Dec 12 10:58 package/test/model/V1Timecard.spec.js
-rw-r--r--  0 0      0        2028 Dec 12 10:58 package/test/model/V1TimecardEvent.spec.js
-rw-r--r--  0 0      0        1374 Dec 12 10:58 package/test/model/V1UpdateModifierListRequest.spec.js
-rw-r--r--  0 0      0        2147 Dec 12 10:58 package/test/model/V1UpdateOrderRequest.spec.js
-rw-r--r--  0 0      0        3492 Dec 12 10:58 package/test/model/V1Variation.spec.js
-rw-r--r--  0 0      0         822 Dec 12 10:58 package/test/model/VoidTransactionRequest.spec.js
-rw-r--r--  0 0      0        1077 Dec 12 10:58 package/test/model/VoidTransactionResponse.spec.js
-rw-r--r--  0 0      0         247 Dec 12 10:58 package/test/support/accounts.js
-rw-r--r--  0 0      0         832 Dec 12 10:58 package/test/support/setup.js
-rw-r--r--  0 0      0         544 Dec 12 10:58 package/travis-ci/accounts.enc

CreateCheckoutRequest constructFromObject method issue

I believe there is a mismatch between the docs and the code in the CreateCheckoutRequest module.
The docs, and other methods in this sdk, frame every method as a constructor function that can accept a POJO as a single constructor argument to the method.

https://github.com/square/connect-javascript-sdk/blob/master/docs/CreateCheckoutRequest.md

The default export from CreateCheckoutRequest breaks with this. It accepts two parameters, idempotency_key and order, and doesn't accept any of the other documented properties.

var exports = function(idempotencyKey, order) {
  var _this = this;

  _this['idempotency_key'] = idempotencyKey;
  _this['order'] = order;

There is a helper method on this class called constructFromObject that almost works as an undeseriable alternative, but I'm getting a runtime error when I use it. It looks like an issue converting the (required) line_items sub-property from the order property. I guess it's trying to wrap the order in another CreateOrderRequest without checking to see if it's already an CreateOrderRequest object.

This all seems like a big miscommunication since it doesn't align with the intention of the documentation. I like the idea of keeping the implemention in line with the documentation as this issue was a time sink for me and I can see it hindering other developers as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.