Latest 0.4.2
Homepage https://github.com/Vend/VendRegisterExtension
License MIT
Platforms ios 8.0

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Inputs

Data is provided to the extension in a JSON format. Here is an example payload:

{
  "payload": {
    "sale": {
      "identifier": "654321-1234-4321-1234-654321",
      "lineItems": [{
        "unitTax": "45",
        "name": "Shoes",
        "quantity": "1",
        "taxIdentifier": "AAAAAAA-BBBB-DDDD-CCCC-AAAAAAA",
        "unitPrice": "300",
        "identifier": "123456-AAAA-BBBB-CCCC-DDDDDDD"
      }],
      "customer": {
        "identifier": "123456-ABCD-ABCD-ABCD-00000000"
      },
      "totals": {
        "toPay": "345",
        "paid": "0",
        "price": "345",
        "tax": "45"
      }
    },
    "retailer": {
      "domainPrefix": "aTestStore",
      "identifier": "123456-1234-1234-1234-123456"
    }
  },
  "version": 1
}

Outputs

The simplest way to send data back to VendRegister is to use the VendRegisterExtensionOperation enum which
provides a helper to create a valid NSExtensionItem.

Otherwise, you must create a valid NSExtensionItem that contains a dictionary with the following format:

{
  "operation" : "addLineItems",
  "version" : 1,
  "parameters" : [
    {
      "unitTax": "45",
      "name": "Shoes",
      "quantity": "1",
      "taxIdentifier": "AAAAAAA-BBBB-DDDD-CCCC-AAAAAAA",
      "unitPrice": "300",
      "identifier": "123456-AAAA-BBBB-CCCC-DDDDDDD"
    }
  ]
}

Please note that the NSExtensionItem is not expecting a JSON object but instead an NSDictionary representation of that object and that the decimal numbers are represented as strings.

Requirements

Installation

VendRegisterExtension is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "VendRegisterExtension"

Author

TomCarey

License

VendRegisterExtension is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "VendRegisterExtension",
    "version": "0.4.2",
    "summary": "A collection of helpers to make extensions for VendRegister",
    "description": "The VendRegisterExtension pod is a set of helpers to enable third-parties to quickly and easily createnextensions for VendRegister.nnPlease contact [email protected] for support.",
    "homepage": "https://github.com/Vend/VendRegisterExtension",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "TomCarey",
    "source": {
        "git": "https://github.com/Vend/VendRegisterExtension.git",
        "tag": "0.4.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "VendRegisterExtension/Classes/**/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This