Download the PHP package nexusvc/ccg-sales-api without Composer
On this page you can find all versions of the php package nexusvc/ccg-sales-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ccg-sales-api
CCG Sales API
CCG Sales API is a PHP-Library to communicate to Cost Containment Group - Development and Production Endpoints. CCG Sales API is maintained by NexusVC, LLC. and is a stand-alone community contributed library.
Documentation
Documentation is currently pending. Simple usage examples are provided below.
Installation
You can install ccg-sales-api via composer or by downloading the source.
Via Composer:
ccg-sales-api is available on Packagist as the
nexusvc/ccg-sales-api
package:
Versions
ccg-sales-api
uses a modified version of Semantic Versioning for all changes. See this document for details.
Quickstart
Authenticating
List Product Categories
List Products in Category
List Product Verification Types
Will list the accepted verification types. This method will be used for future changes including capturing modified voice scripts based on the order
object.
Create Payable Token - Payment Method
Payable is a payment method that can either be a debit/credit card and/or a bank account. The library will determine the type based on the params passed when instantiating a new payable. It will also validate against common formats. Once a payable is attached to the Order
object it will automatically be encrypted and will always return a tokenized format.
Selecting Products
Products can be attached to the order object similar to a payable. You can filter products by passing params as shown in section List Products in Category but you may also filter those returned items using a collection and then using the addToOrder()
method on the product will push that product into the order object. You may also use addProduct($product)
method on the order object to directly push a product.
Creating an Applicant
When building the order you must attach 1 or more applicants. First, create a new applicant and push that applicant to the order similar to pushing a product. You may use the addToOrder()
method on the applicant directly or the addApplicant($applicant)
method on the order object. You may also attach contactable objects to an applicant using the addContactable($contact)
method on the applicant. Currently supported contact methods are phone
,email
,address
.
Contactable object(s) will validate against common formats and USPS Address System.
Voice Verification & Attaching Audio
Fetching the voice verification script, parsing for variables within script, and updating script variables to generate complete voice verification.
Esign Verification Invite (Optional: $callbackUrl)
Once you are ready to request an esign invite you may do so using the verification type esign
and the invite($callbackUrl)
method. The $callbackUrl
param is optional but will allow CCG Server to instantly POST
back to referenced url upon successful esign completion. This is the perfered method for push notify of completion.
Esign Verification Status (Optional: $callbackUrl)
You may check a status of an esign
verification by using a $callbackUrl
option when requesting the invite or by using the status()
method. The $callbackUrl
param is optional but will allow CCG Server to instantly POST
back to referenced url upon successful esign completion. TThis is the perfered method for push notify of completion.
Charge Order - Enrollment
Once your order is built with applicants
,products
,payable
, & verification
objects you may complete the enrollment by calling the charge()
method on the order. This method will validate the order schema, restructure the order object to CCG compatiable POST
params.
Order
The order object on the main class can be accessed via $ccg->order
. The order object will contain the applicants
,products
,verifications
,payable
objects. You may need to make reference to the order object as shown above with methods like addToOrder()
on specific objects. You may also output the entire order via the toArray()
method. Here is an example of an order returned as an array.
Example output array as JSON:
Schema Validation & Formatting
Built into the library is a schema validator and schema formatter. This is usually handled behind the scenes but can be access if necessary. You would use these to validate required structure(s) and/or output the order
in a current
or deprecated
format for CCG endpoints. Currently a real life example would be choosing version1
schema when POST
to the esign invite. It will recreate the order
object.
Schema: Version 1
You will notice some of the key
name(s) change from the above order
output and the payable token is now decrypted since currently CCG does not accept the encrypted token. This is the currently accepted order
schema.
All versions of ccg-sales-api with dependencies
guzzlehttp/guzzle Version ^6.3
illuminate/encryption Version ~5.0
nesbot/carbon Version ~1.20
zendframework/zend-soap Version ^2.8