fnklabs/monger

1.0.0 2015-01-07 13:08 UTC

This package is not auto-updated.

Last update: 2022-11-21 23:31:03 UTC


README

Read more about project at Monger

##Create Client instance

$logger       = new Logger("test");
$curlAdapter  = new CurlAdapter($logger),
$mongerClient = new MongerClient(
                                "https://monger.fnklabs.com", 
                                "USER_TOKEN", 
                                "USER_ACCESS_TOKEN_WITH_WRITE_SCOPE", 
                                "YOUR_APPLICATION_NAME",
                                "YOUR_APPLICATION_VERSION",
                                $curlAdapter,
                                $logger
               );

##Register new customer

$mongerClient->newCustomer(
            "CUSTOMER_INTERNAL_ID",
            "CUSTOMER_INITIALS",
            "CUSTOMER_EMAIL",
            "CUSTOMER_PHONE_NUMBER",
            CUSTOMER_GENDER,
            "CUSTOMER_COUNTRY",
            "CUSTOMER_CITY",
            "CUSTOMER_AGE",
            new \DateTime(),
            ["TAG_1", "TAG_2"]
        );

##Register customer's new activity

$mongerClient->newActivity("CUSTOMER_INTERNAL_ID", "ACTIVITY_NAME", new \DateTime());

##Register customer's new payment

$mongerClient->newPayment("CUSTOMER_INTERNAL_ID", "PAYMENT_INTERNAL_ID", PURCHASE_AMOUNT, new \DateTime());

##Additional info

  • You can find example at MongerClientTest
  • To retrieve access to Monger Service visit page Monger