Changeset 2212575
- Timestamp:
- 12/16/2019 12:39:25 AM (6 years ago)
- Location:
- xcoobee/trunk
- Files:
-
- 13 edited
-
CHANGELOG (modified) (1 diff)
-
includes/sdk/API.md (modified) (37 diffs)
-
includes/sdk/src/XcooBee/Core/Api/Api.php (modified) (4 diffs)
-
includes/sdk/src/XcooBee/Core/Api/Consents.php (modified) (4 diffs)
-
includes/sdk/src/XcooBee/Core/Configuration.php (modified) (3 diffs)
-
includes/sdk/src/XcooBee/Http/Client.php (modified) (1 diff)
-
includes/sdk/src/XcooBee/Store/CachedData.php (modified) (5 diffs)
-
includes/sdk/src/XcooBee/XcooBee.php (modified) (3 diffs)
-
includes/sdk/test/src/XcooBee/Core/Api/ConsentsTest.php (modified) (11 diffs)
-
includes/sdk/test/src/XcooBee/Core/Api/UsersTest.php (modified) (4 diffs)
-
includes/sdk/test/src/XcooBee/Store/CachedDataTest.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
xcoobee.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xcoobee/trunk/CHANGELOG
r2183457 r2212575 21 21 * update cache directory to be inside WP instance 22 22 23 = 1.6.5 - 2019-12-15 = 24 * autodetect security and make cache optional 25 -
xcoobee/trunk/includes/sdk/API.md
r2183457 r2212575 3 3 - [Call limits](#call-limits) 4 4 - [Logs](#logs) 5 - [PGP Secret and password](# pgp)5 - [PGP Secret and password](#about-pgp-secret-and-password) 6 6 - [Responses](#responses) 7 7 - [Success package](#success-package) … … 32 32 - [UserMessage](#usermessage-2) 33 33 - [System API](#system-api) 34 - [ping](#ping )35 - [addEventSubscription](#add -event-subscription)36 - [listEventSubscriptions](#list -event-subscriptions)37 - [deleteEventSubscription](#delete -event-subscription)38 - [triggerEvent](#trigger -event)39 - [handleEvents](#handle -events)40 - [getEvents](#get -events)34 - [ping](#pingconfig) 35 - [addEventSubscription](#addeventsubscriptionarrayofeventandhandlerpairs-campaignid-config) 36 - [listEventSubscriptions](#listeventsubscriptionscampaignid-config) 37 - [deleteEventSubscription](#deleteeventsubscriptionarrayofeventnames-campaignid-config) 38 - [triggerEvent](#triggereventtype-config) 39 - [handleEvents](#handleeventsevents) 40 - [getEvents](#geteventsconfig) 41 41 - [Consent Administration API](#consent-administration-api) 42 - [getCampaignInfo](#get-campaign-info) 43 - [listCampaigns](#list-campaigns) 44 - [getDataPackage](#get-data-package) 45 - [listConsents](#list-consents) 46 - [getConsentData](#get-consent-data) 47 - [getCookieConsent](#get-cookie-consent) 48 - [requestConsent](#request-consent) 49 - [confirmConsentChange](#confirm-consent-change) 50 - [declineConsentChange](#decline-consent-change) 51 - [confirmDataDelete](#confirm-data-delete) 52 - [setUserDataResponse](#set-user-data-response) 53 - [registerConsents](#register-consents) 54 - [getCampaignIdByRef](#get-campaign-id) 42 - [getCampaignInfo](#getcampaigninfocampaignid-config) 43 - [listCampaigns](#listcampaignsconfig) 44 - [getDataPackage](#getdatapackageconsentid-config) 45 - [listConsents](#listconsentsfilters-config) 46 - [getConsentData](#getconsentdataconsentid-config) 47 - [getCookieConsent](#getcookieconsentxid-campaignid-config) 48 - [requestConsent](#requestconsentxid-refid-campaignid-config) 49 - [confirmConsentChange](#confirmconsentchangeconsentid-config) 50 - [declineConsentChange](#declineconsentchangeconsentid-config) 51 - [confirmDataDelete](#confirmdatadeleteconsentid-config) 52 - [setUserDataResponse](#setuserdataresponsemessage-requestref-filename-targeturl-eventhandler-config) 53 - [registerConsents](#registerconsentsfilename-targets-reference-campaignid-config) 54 - [getCampaignIdByRef](#getcampaignidbyrefcampaignref-config) 55 - [shareConsents](#shareconsentscampaignref-campaignid-consentids-config) 56 - [dontSellData](#dontselldataemail-config) 55 57 - [User API](#user-api) 56 - [getUsePublicKey](#get -user-public-key)57 - [sendUserMessage](#send -user-message)58 - [getConversations](#get -conversations)59 - [getConversation](#get -conversation)58 - [getUsePublicKey](#getuserpublickeyxid-config) 59 - [sendUserMessage](#sendusermessagemessage-reference-config) 60 - [getConversations](#getconversationsconfig) 61 - [getConversation](#getconversationuserid-config) 60 62 - [Bee API](#bee-api) 61 - [listBees](#list -bees)62 - [uploadFiles](#upload -files)63 - [takeOff](#take -off)63 - [listBees](#listbeessearchtext-config) 64 - [uploadFiles](#uploadfilesfiles-endpoint-config) 65 - [takeOff](#takeoffbees-options-subscriptions-config) 64 66 - [Inbox API](#inbox-api) 65 - [listInbox](#list -inbox)66 - [getInboxItem](#get -inbox-item)67 - [deleteInboxItem](#delete -inbox-item)67 - [listInbox](#listinboxconfig) 68 - [getInboxItem](#getinboxitemmessageid-config) 69 - [deleteInboxItem](#deleteinboxitemmessageid-config) 68 70 - [Troubleshooting](#troubleshooting) 69 71 … … 87 89 88 90 89 # About PGP Secret and password {#pgp}91 # About PGP Secret and password 90 92 91 93 All PGP data is optional to the configuration object. If you do not supply it, … … 381 383 For example: `$pingResult = $sdk->system->ping();` 382 384 383 ## ping([config]) {#ping}385 ## ping([config]) 384 386 385 387 Can be called to see whether current configuration will connect to XcooBee system. This will return an error if your API user does not have a public PGP key on its profile. … … 398 400 399 401 400 ## addEventSubscription(arrayOfEventAndHandlerPairs[, campaignId, config]) {#add-event-subscription}402 ## addEventSubscription(arrayOfEventAndHandlerPairs[, campaignId, config]) 401 403 402 404 You can register subscriptions to hooks by calling the addEventSubscription function and providing the event (as specified in this document) and handler pairs `eventname: handler`. … … 436 438 437 439 438 ## listEventSubscriptions([campaignId, config]) {#list-event-subscriptions}440 ## listEventSubscriptions([campaignId, config]) 439 441 440 442 list current subscriptions. … … 454 456 455 457 456 ## deleteEventSubscription(arrayOfEventNames[, campaignId, config]) {#delete-event-subscription}458 ## deleteEventSubscription(arrayOfEventNames[, campaignId, config]) 457 459 458 460 delete existing subscriptions. … … 474 476 475 477 476 ## triggerEvent(type[, config]) {#trigger-event}478 ## triggerEvent(type[, config]) 477 479 478 480 Trigger test event to configured campaign webhook. The structure will be the same as real event (with encrypted payload and HMAC signature). … … 524 526 525 527 526 ## getEvents([config]) {#get-events}528 ## getEvents([config]) 527 529 528 530 In cases where you are not able to use direct webhook posts to your sites, for example you are in development or your system cannot be accessed via the Internet directly, you can pull your events from XcooBee. … … 552 554 For example: `$campaigns = $sdk->consents->listCampaigns();` 553 555 554 ## getCampaignInfo([campaignId, config]) {#get-campaign-info}556 ## getCampaignInfo([campaignId, config]) 555 557 get basic info on campaign (setup, datatypes and options). The information will not return the users registered with the campaign. 556 558 … … 569 571 - status 400 if error 570 572 571 ## listCampaigns([config]) {#list-campaigns}573 ## listCampaigns([config]) 572 574 get all user campaigns 573 575 … … 585 587 - status 400 if error 586 588 587 ## getDataPackage(consentId[, config]) {#get-data-package}589 ## getDataPackage(consentId[, config]) 588 590 589 591 When data is hosted for you at XcooBee you can request the data package each time you need to use it. You will need to provide `consentId`. This call will only respond to authorized call source. … … 600 602 standard response object 601 603 - status 200 if success: 602 - result will contain requested data object604 - result will contain array of data objects 603 605 The SDK will decrypt this for you if it has access to PGP keys otherwise you have to decrypt this object 604 606 - status 400 if error 605 607 606 ## listConsents([statuses, config]) {#list-consents} 607 608 Query for list of consents for a given campaign. Company can get general consentId for any consent that was created as part of a campaign. This is a multi-page recordset. Data returned: consentId, creation date, expiration date, xcoobeeId 609 610 possible response/filter for status: 608 ## listConsents([statuses, config]) 609 610 Query for list of consents for a given campaign. Company can get general consentId for any consent that was created as part of a campaign. This is a multi-page recordset. 611 612 options: 613 614 ``` 615 filters => optional: array of different filters, if not specified all will be returned 616 config => optional: the config object 617 ``` 618 619 example: 620 ``` 621 $filters = [ 622 'search' => 'Cool', 623 'country' => 'US', 624 'province' => 'California', 625 'city' => 'Los Angeles', 626 'dateFrom' => '2019-01-01', 627 'dateTo' => '2019-12-31', 628 'statuses' => ['expired', 'rejected'], 629 'consentTypes' => ['perform_contract', 'perform_a_service'], 630 'dataTypes' => ['first_name', 'middle_name', 'last_name'], 631 ]; 632 ``` 633 634 `search` - filters out consents with name or campaign description, that include passed string 635 `country` - country code of consent owner 636 `province` - country province of consent owner 637 `city` - city of consent owner 638 `dateFrom` - string date. Min date, when consent was created 639 `dateTo` - string date. Max date, when consent was created 640 641 possible `statuses`: 611 642 612 643 pending, active, updating, offer, cancelled, expired, rejected 613 644 614 options: 615 616 ``` 617 statuses => optional: array of numbers, one of the valid consent statuses, if not specified all will be returned 618 config => optional: the config object 619 ``` 620 621 ### response 622 623 standard response object 624 - status 200 if success: 625 - result will contain consent data object: consent_id, status_id, date_c, date_e, xcoobee_id 626 - status 400 if error 627 628 ## getConsentData(consentId[, config]) {#get-consent-data} 645 possible `consentTypes`: 646 647 missing, perform_contract, perform_a_service, deliver_a_product, order_fullfillment, shipping, billing, subscription, support, support_a_service, support_a_product, warranty, create_custom_service_and_product, create_custom_service, create_custom_product, travel, deliver_itiniary_changes, government_services, emergency_services, law_enforcement, health_care_services, care_delivery, health_billing, emergency_request, product_announcement, product_information, survey, marketing, promotion, data_aggregation, anonymized_data_aggregation, company_information, press_releaseases, financial_reports, website_tracking, web_application_tracking, mobile_device_tracking, iot_device_tracking, payment_processing, donation, private_consent, employee_administration, employee_management, contractor_management, training, it_administration, supplier_screening, other 648 649 possible `dataTypes`: 650 651 first_name, middle_name, last_name, name_prefix, name_suffix, xcoobee_id, email, alternate_email, phone, alternate_phone, street1, street2, city, state, postal_code, country, date_of_birth, image, ethnicity_race, genetic_data, biometric_data, bank_account_description, bank_name, bank_routing_number, bank_swift, bank_isfc, bank_account_number, bank_iban, paypal_email, payment_token, government_document_references, government_id, location_data, health_record, emergency_medical_record, physical_health_record, dental_record, mental_health_record, health_metrics, internet_access_record, ip_address, device_identifiers, browser_details, meter_reading, party_affiliation, religion, sexual_orientation, criminal_conviction, membership, application_cookie, usage_cookie, statistics_cookie, advertising_cookie, social_posts, twitter_handle, family_members, friends, colleagues, custom, other1, other2, other3, other4, other5, other6, other7, other8, other9 652 653 ### response 654 655 standard response object 656 - status 200 if success: 657 - result will contain consent data objects 658 - status 400 if error 659 660 ## getConsentData(consentId[, config]) 629 661 630 662 Query for a specific consent given. Company can get consent definition for any consent that was created. The data normally has three areas: Who, what data types, what the uses are, how long. … … 644 676 - status 400 if error 645 677 646 ## getCookieConsent(xid[, campaignId, config]) {#get-cookie-consent}678 ## getCookieConsent(xid[, campaignId, config]) 647 679 648 680 This is a shortcut mechanism to query the XcooBee system for existing user consent for consent type `Website Tracking (1400), Web Application Tracking (1410)` for specific use data types (`application cookie (1600), usage cookie (1610), and advertising cookie (1620)`). We will retrieve only active consent for the cookies on the website identified in the campaign Id and return whether user has agreed to any cookies. … … 670 702 - status 400 if error 671 703 672 ## requestConsent(xid[, refId, campaignId, config]) {#request-consent}704 ## requestConsent(xid[, refId, campaignId, config]) 673 705 674 706 Sends out the consent or consent and data request to a specific user using the data in the campaign. The campaign definition determines what data (only consent or consent + data) we will ask from the user. … … 692 724 693 725 694 ## confirmConsentChange(consentId[, config]) {#confirm-consent-change}726 ## confirmConsentChange(consentId[, config]) 695 727 Use this call to confirm that data has been changed in company systems according to change requested by user. 696 728 … … 709 741 710 742 711 ## declineConsentChange(consentId[, config]) {#decline-consent-change}743 ## declineConsentChange(consentId[, config]) 712 744 Use this call to open dispute on consent. 713 745 … … 725 757 - status 400 if error 726 758 727 ## confirmDataDelete(consentId[, config]) {#confirm-data-delete}759 ## confirmDataDelete(consentId[, config]) 728 760 Send by company to confirm that data has been purged from company systems 729 761 … … 742 774 743 775 744 ## setUserDataResponse(message, requestRef, filename, targetUrl, eventHandler[, config]) {#set-user-data-response}776 ## setUserDataResponse(message, requestRef, filename, targetUrl, eventHandler[, config]) 745 777 746 778 Companies can respond to user data requested via this call. Standard hiring points will be deducted for this. The call will send a `message` to user's communication center. You also need to send a file with user's data in order to close data request. … … 764 796 765 797 766 ## registerConsents([filename, targets, reference, campaignId, config]) {#register-consents}798 ## registerConsents([filename, targets, reference, campaignId, config]) 767 799 768 800 Generally register/save consents that you received outside of XcooBee. 769 801 770 802 a) You may have already a list of consents that you have obtained from user but wish to use XcooBee as a system of record so you can manage them through XcooBee. 771 b) Or, you would like for XcooBee to verify the consent that you have in your corporate system. 803 b) Or, you would like for XcooBee to verify the consent that you have in your corporate system. 772 804 773 805 You can upload a list of emails for your campaign and, if your campaign is setup for it, XcooBee will validate the consent for you with the users. … … 778 810 options: 779 811 ``` 780 filename => optional: pointer to the csv file which contains list of targets. 812 filename => optional: pointer to the csv file which contains list of targets. 781 813 targets => optional: list of users whose consents we need to register 782 814 … … 793 825 date_received => date when a consent was received, optional, we'll use current date as default 794 826 date_expires => date when a consent expires, optional, we'll set expiration date based on campaign's settings if missing 827 contract_ref => unique reference provided to allow match specific consent 795 828 ``` 796 829 … … 798 831 ``` 799 832 [ 800 [ 'target' => 'example@test.com' ],833 [ 'target' => 'example@test.com', 'contract_ref' => 'refId123' ], 801 834 [ 'target' => 'someTestXid', 'date_expires' => '2019-06-14T08:35:35.866Z' ], 802 835 ] … … 808 841 it must be a csv format where each line represents target, file should not contain headers 809 842 810 | target | date_received | date_expires | 811 |------------------|--------------------------|--------------------------| 812 | example@test.com | 2019-06-14T08:35:35.866Z | 2019-06-14T08:35:35.866Z | 813 | ~someTestXid | 2019-06-14T08:35:35.866Z | 2019-06-14T08:35:35.866Z | 814 815 ### response 816 817 You should save the refId that is returned from XcooBee. This is your reference to the consent for lookup purposes. 818 XcooBee does not save the actual email of the user for the consent record, it uses a one way hash pattern. XcooBee technology is unable to resolve consent record via email until user has created an account. Thus, you should save the refId returned. This is the only link between data stored in your system and XcooBee consent. 843 | target | date_received | date_expires | contract_ref | 844 |------------------|--------------------------|--------------------------|--------------------------| 845 | example@test.com | 2019-06-14T08:35:35.866Z | 2019-06-14T08:35:35.866Z | qwerty123 | 846 | ~someTestXid | 2019-06-14T08:35:35.866Z | 2019-06-14T08:35:35.866Z | qwerty456 | 847 848 ### response 849 850 You should save the refId that is returned from XcooBee. This is your reference to the consent for lookup purposes. 851 XcooBee does not save the actual email of the user for the consent record, it uses a one way hash pattern. XcooBee technology is unable to resolve consent record via email until user has created an account. Thus, you should save the refId returned. This is the only link between data stored in your system and XcooBee consent. 819 852 820 853 When you submit multiple records via array object or file, the refId returned is only the **prefix** to the final reference for each consent. The final reference Id can be determined by the ordinal position (zero based index) of the record you submitted `refId-[ordinal position]`. Thus if you have a reference Id of `3657f2c0-d6a7-4a83-88db-0ad8ac4ca4e9` and you submitted two records, the final reference Id for each of the consent records would be: 821 854 822 - `3657f2c0-d6a7-4a83-88db-0ad8ac4ca4e9- 0` for first record823 - `3657f2c0-d6a7-4a83-88db-0ad8ac4ca4e9- 1` for second record etc.855 - `3657f2c0-d6a7-4a83-88db-0ad8ac4ca4e9-1` for first record 856 - `3657f2c0-d6a7-4a83-88db-0ad8ac4ca4e9-2` for second record etc. 824 857 825 858 … … 830 863 - status 400 if error 831 864 832 ## getCampaignIdByRef(campaignRef[, config]) {#get-campaign-id}865 ## getCampaignIdByRef(campaignRef[, config]) 833 866 get campaign id by it's reference 834 867 … … 847 880 - status 400 if error 848 881 882 ## shareConsents(campaignRef[, campaignId, consentIds, config]) 883 Creates new consents based on existing ones on behalf of other company 884 885 options: 886 ``` 887 campaignRef => the campaign reference which consents will be shared with 888 campaignId => the campaign id which consents will be shared from 889 consentIds => the consent ids which will be shared 890 config => optional: the config object 891 ``` 892 893 Either `campaignId` or `consentIds` should be provided. 894 895 ### response 896 897 standard response object 898 - status 200 if success: 899 - result will contain reference 900 - status 400 if error 901 902 ## dontSellData(email[, config]) 903 904 Set `Do Not Sell` flag for user. Consents for this user won't be shared between campaigns for 1 year. After expiration, it should be extended. 905 906 options: 907 ``` 908 email => the email of user, that flag should be set for 909 config => optional: the config object 910 ``` 911 912 ### response 913 914 standard response object 915 - status 200 if success: 916 - result will contain true 917 - status 400 if error 918 849 919 850 920 # User API … … 853 923 For example: `$conversations = $sdk->users->getConversations();` 854 924 855 ## getUserPublicKey(xid[, config]) {#get-user-public-key}925 ## getUserPublicKey(xid[, config]) 856 926 857 927 Retrieves a user's public PGP key as published on their public profile. If the user chose to hide it or the user is not known, it returns `null`. … … 871 941 public PGP or empty string 872 942 873 ## sendUserMessage(message, reference, [config]) {#send-user-message}943 ## sendUserMessage(message, reference, [config]) 874 944 This function allows you to send a message to users. You can communicate issues regarding consent, ticket and data request this way. It will create a threaded discussion for the user and for you and append to it this message. 875 945 … … 892 962 - status 400 if error 893 963 894 ## getConversations([config]) {#get-conversations}964 ## getConversations([config]) 895 965 This function allows you to get a list of discussions with users regarding breaches, consents and so on. 896 966 … … 906 976 - status 400 if error 907 977 908 ## getConversation(userId[, config]) {#get-conversation}978 ## getConversation(userId[, config]) 909 979 This function allows you to get full discussion with selected user. 910 980 … … 933 1003 934 1004 935 ## listBees([searchText, config]) {#list-bees}1005 ## listBees([searchText, config]) 936 1006 937 1007 This function will help you search through the bees in the system that your account is able to hire. This is a simple keyword search interface. … … 950 1020 - status 400 if error 951 1021 952 ## uploadFiles(files[, endpoint, config]) {#upload-files}1022 ## uploadFiles(files[, endpoint, config]) 953 1023 954 1024 You use the uploadFiles function to upload files from your server to XcooBee. You can upload multiple files and you can optionally supply an outbox endpoint. If you have an outbox endpoint you do not need to call the [`takeOff()`](#take-off) function as the endpoint already specifies all processing parameters. If your subscription allows you can configure the outbox endpoints in the XcooBee UI. … … 968 1038 - status 400 if error 969 1039 970 ## takeOff(bees, options[, subscriptions, config]) {#take-off}1040 ## takeOff(bees, options[, subscriptions, config]) 971 1041 972 1042 You normally use this as follow up call to [`uploadFiles()`](#upload-files). This will start your processing. You specify the bee(s) that you want to hire and the parameter that are needed for the bee to work on your file(s). If you want to be kept up to date you can supply subscriptions. Please note that subscriptions will deduct points from your balance and will cause errors when your balance is insufficient. … … 1119 1189 For example: `$inboxItems = $sdk->inbox->listInbox();` 1120 1190 1121 ## listInbox([config]) {#list-inbox}1191 ## listInbox([config]) 1122 1192 1123 1193 This method will present a paged list of inbox items that you can download. The listing will be for the user connected to you API key. You cannot check any other user's inbox using this method. You can return up to 100 items in one call. … … 1148 1218 1149 1219 1150 ## getInboxItem(messageId[, config]) {#get-inbox-item}1220 ## getInboxItem(messageId[, config]) 1151 1221 1152 1222 This method will return a file and file meta tags. Upon first downloaded, the `downloadDate` for the item will be populated. … … 1165 1235 1166 1236 1167 ## deleteInboxItem(messageId[, config]) {#delete-inbox-item}1237 ## deleteInboxItem(messageId[, config]) 1168 1238 1169 1239 This method will delete a file that corresponds to your messageid. If the file does not exist, an error will be returned. … … 1191 1261 1192 1262 Once you have exceeded your call limits, your call will return status `429` too many requests. Please update your subscription or contact support. 1193 -
xcoobee/trunk/includes/sdk/src/XcooBee/Core/Api/Api.php
r2126380 r2212575 14 14 /** @var GraphQLClient */ 15 15 protected $_client; 16 16 17 17 /** @var XcooBee */ 18 18 protected $_xcoobee; 19 19 20 20 public function __construct(XcooBee $xcoobee) 21 21 { … … 50 50 $config = \XcooBee\Models\ConfigModel::createFromData($config); 51 51 } 52 52 53 53 return $this->_client->request($query, $variables, [ 54 54 'Content-Type' => 'application/json', 55 55 ], $config); 56 56 } 57 57 58 58 /** 59 59 * Get default Campaign 60 60 */ 61 protected function _getDefaultCampaignId() 61 protected function _getDefaultCampaignId() 62 62 { 63 return $this->_xcoobee->get Store()->getStore(CachedData::CONFIG_KEY)->campaignId;63 return $this->_xcoobee->getConfig()->campaignId; 64 64 } 65 65 66 66 /** 67 67 * Get Campaign id 68 * 68 * 69 69 * @param String $campaignId 70 70 * @param array $config 71 * 71 * 72 72 * @return String 73 * 73 * 74 74 * @throws XcooBeeException 75 75 */ … … 82 82 return $config['campaignId']; 83 83 } 84 84 85 85 if ($campaignId = $this->_getDefaultCampaignId()) { 86 86 return $campaignId; 87 87 } 88 88 89 89 throw new XcooBeeException('No "campaignId" provided'); 90 90 } 91 91 92 92 /** 93 93 * Get page size. … … 104 104 } 105 105 106 $cachedPageSize = $this->_xcoobee->get Store()->getStore(CachedData::CONFIG_KEY)->pageSize;106 $cachedPageSize = $this->_xcoobee->getConfig()->pageSize; 107 107 108 108 return is_null($cachedPageSize) || $cachedPageSize > self::MAX_PAGE_SIZE ? self::MAX_PAGE_SIZE : $cachedPageSize; -
xcoobee/trunk/includes/sdk/src/XcooBee/Core/Api/Consents.php
r2126380 r2212575 271 271 * list all consents 272 272 * 273 * @param int $statusId274 * @param array $config 275 * 276 * @return Response 277 * 278 * @throws XcooBeeException 279 */ 280 public function listConsents($ statusIds = [], $config = [])281 { 282 $query = 'query listConsents($userId: String!, $statuses: [ConsentStatus], $ first: Int, $after: String) {283 consents(campaign_owner_cursor: $userId, statuses : $statuses, first : $first , after: $after) {273 * @param array $filters 274 * @param array $config 275 * 276 * @return Response 277 * 278 * @throws XcooBeeException 279 */ 280 public function listConsents($filters = [], $config = []) 281 { 282 $query = 'query listConsents($userId: String!, $statuses: [ConsentStatus], $consentTypes: [ConsentType], $dataTypes: [ConsentDatatype], $dateFrom: String, $dateTo: String, $search: String, $country: String, $province: String, $city: String, $first: Int, $after: String) { 283 consents(campaign_owner_cursor: $userId, statuses : $statuses, consent_types: $consentTypes, data_types: $dataTypes, date_from: $dateFrom, date_to: $dateTo, search: $search, country: $country, province: $province, city: $city, first: $first, after: $after) { 284 284 data { 285 consent_cursor, 286 consent_status, 287 user_xcoobee_id, 288 date_c, 289 date_e, 285 consent_cursor 286 user_cursor 287 user_display_name 288 user_xcoobee_id 289 campaign_cursor 290 campaign_status 291 consent_name 292 consent_description 293 consent_status 294 consent_type 295 consent_source 296 consent_details { 297 datatype 298 marker 299 share_hash 300 } 301 date_c 302 date_e 303 date_u 304 date_approved 305 date_deleted 306 update_confirmed 307 deletion_confirmed 308 request_data_types 309 request_data_sections { 310 section_fields { 311 datatype 312 } 313 } 314 is_data_request 315 user_email_mask 290 316 } 291 317 page_info { … … 296 322 }'; 297 323 298 $statuses = []; 299 foreach ($statusIds as $statusId) { 300 $statuses[] = $this->_getConsentStatus($statusId); 301 } 302 303 return $this->_request($query, [ 304 'statuses' => $statuses ? : null, 324 $variables = [ 305 325 'userId' => $this->_getUserId($config), 306 326 'first' => $this->_getPageSize($config), 307 327 'after' => null, 308 ], $config); 328 ]; 329 330 if (array_key_exists('search', $filters)) { 331 $variables['search'] = $filters['search']; 332 } 333 334 if (array_key_exists('country', $filters)) { 335 $variables['country'] = $filters['country']; 336 } 337 338 if (array_key_exists('province', $filters)) { 339 $variables['province'] = $filters['province']; 340 } 341 342 if (array_key_exists('city', $filters)) { 343 $variables['city'] = $filters['city']; 344 } 345 346 if (array_key_exists('dateFrom', $filters)) { 347 $dateString = $filters['dateFrom']; 348 try { 349 $from = new \DateTime($dateString); 350 $variables['dateFrom'] = $dateString; 351 } catch (\Exception $e) { 352 throw new XcooBeeException("Invalid date string '$dateString' provided"); 353 } 354 } 355 356 if (array_key_exists('dateTo', $filters)) { 357 $dateString = $filters['dateTo']; 358 try { 359 $from = new \DateTime($dateString); 360 $variables['dateTo'] = $dateString; 361 } catch (\Exception $e) { 362 throw new XcooBeeException("Invalid date string '$dateString' provided"); 363 } 364 } 365 366 if (array_key_exists('statuses', $filters)) { 367 $availableStatuses = [ 368 'pending', 369 'active', 370 'updating', 371 'offer', 372 'cancelled', 373 'expired', 374 'rejected' 375 ]; 376 foreach ($filters['statuses'] as $status) { 377 if (!in_array($status, $availableStatuses)) { 378 throw new XcooBeeException("Invalid status '$status' provided"); 379 } 380 } 381 382 $variables['statuses'] = $filters['statuses']; 383 } 384 385 if (array_key_exists('consentTypes', $filters)) { 386 $availableTypes = [ 387 'missing', 'perform_contract', 'perform_a_service', 'deliver_a_product', 'order_fullfillment', 'shipping', 388 'billing', 'subscription', 'support', 'support_a_service', 'support_a_product', 'warranty', 389 'create_custom_service_and_product', 'create_custom_service', 'create_custom_product', 'travel', 390 'deliver_itiniary_changes', 'government_services', 'emergency_services', 'law_enforcement', 391 'health_care_services', 'care_delivery', 'health_billing', 'emergency_request', 'product_announcement', 392 'product_information', 'survey', 'marketing', 'promotion', 'data_aggregation', 'anonymized_data_aggregation', 393 'company_information', 'press_releaseases', 'financial_reports', 'website_tracking', 'web_application_tracking', 394 'mobile_device_tracking', 'iot_device_tracking', 'payment_processing', 'donation', 'private_consent', 395 'employee_administration', 'employee_management', 'contractor_management', 'training', 'it_administration', 396 'supplier_screening', 'other', 397 ]; 398 foreach ($filters['consentTypes'] as $type) { 399 if (!in_array($type, $availableTypes)) { 400 throw new XcooBeeException("Invalid type '$type' provided"); 401 } 402 } 403 404 $variables['consentTypes'] = $filters['consentTypes']; 405 } 406 407 if (array_key_exists('dataTypes', $filters)) { 408 $availableDataTypes = [ 409 'first_name', 'middle_name', 'last_name', 'name_prefix', 'name_suffix', 'xcoobee_id', 410 'email', 'alternate_email', 'phone', 'alternate_phone', 'street1', 'street2', 'city', 411 'state', 'postal_code', 'country', 'date_of_birth', 'image', 'ethnicity_race', 'genetic_data', 412 'biometric_data', 'bank_account_description', 'bank_name', 'bank_routing_number', 'bank_swift', 413 'bank_isfc', 'bank_account_number', 'bank_iban', 'paypal_email', 'payment_token', 414 'government_document_references', 'government_id', 'location_data', 'health_record', 415 'emergency_medical_record', 'physical_health_record', 'dental_record', 'mental_health_record', 416 'health_metrics', 'internet_access_record', 'ip_address', 'device_identifiers', 'browser_details', 417 'meter_reading', 'party_affiliation', 'religion', 'sexual_orientation', 'criminal_conviction', 'membership', 418 'application_cookie', 'usage_cookie', 'statistics_cookie', 'advertising_cookie', 'social_posts', 419 'twitter_handle', 'family_members', 'friends', 'colleagues', 'custom', 'other1', 'other2', 'other3', 420 'other4', 'other5', 'other6', 'other7', 'other8', 'other9' 421 ]; 422 foreach ($filters['dataTypes'] as $type) { 423 if (!in_array($type, $availableDataTypes)) { 424 throw new XcooBeeException("Invalid data type '$type' provided"); 425 } 426 } 427 428 $variables['dataTypes'] = $filters['dataTypes']; 429 } 430 431 return $this->_request($query, $variables, $config); 309 432 } 310 433 … … 392 515 393 516 // Try to decrypt the data. 394 if ($response->code === 200 && !empty($response->result->data_package->data)) { 395 try { 396 $decryptedData = $this->_encryption->decrypt($response->result->data_package->data); 397 398 if ($decryptedData !== null) { 399 $response->result->data_package->data = $decryptedData; 400 } 401 } catch (EncryptionException $e) { 402 // Do nothing, we will pass on the data as it is. 517 if ($response->code === 200 && !empty($response->result->data_package)) { 518 foreach ($response->result->data_package as $key => $dataPackage) { 519 try { 520 $decryptedData = $this->_encryption->decrypt($dataPackage->data); 521 522 if ($decryptedData !== null) { 523 $response->result->data_package[$key]->data = $decryptedData; 524 } 525 } catch (EncryptionException $e) { 526 // Do nothing, we will pass on the data as it is. 527 } 403 528 } 404 529 } … … 470 595 } 471 596 472 protected function _getXcoobeeIdByConsent($consentId, $config = []) 473 { 474 $consent = $this->getConsentData($consentId, $config = []); 475 if (!empty($consent->result->consent)) { 476 return $consent->result->consent->user_xcoobee_id; 477 } 478 479 return false; 480 } 481 482 protected function _getConsentStatus($statusId) 483 { 484 if ($statusId === null) { 485 return null; 486 } 487 488 $availableStatus = [ 489 'pending', 490 'active', 491 'updating', 492 'offer', 493 'cancelled', 494 'expired', 495 'rejected' 496 ]; 497 498 if (array_key_exists($statusId, $availableStatus)) { 499 return $availableStatus[$statusId]; 500 } 501 502 throw new XcooBeeException('invalid "statusId" provided'); 597 /** 598 * Share consents to another campaign 599 * 600 * @param string $campaignRef 601 * @param string $campaignId 602 * @param array $consetnIds 603 * @param array $config 604 * @return Response 605 * @throws XcooBeeException 606 */ 607 public function shareConsents($campaignRef, $campaignId = null, $consentIds = [], $config = []) 608 { 609 if (!$campaignId && !$consentIds) { 610 throw new XcooBeeException('Either campaignId or consentIds should be provided'); 611 } 612 613 $query = 'mutation shareConsents($config: ShareConsentsConfig!){ 614 share_consents(config: $config){ 615 ref_id 616 } 617 }'; 618 619 return $this->_request($query, [ 620 'config' => [ 621 'campaign_reference' => $campaignRef, 622 'campaign_cursor' => $campaignId, 623 'consent_cursors' => $consentIds, 624 ] 625 ], $config); 626 } 627 628 /** 629 * Set or extend `Do Not Sell Data` flag 630 * 631 * @param string $email 632 * @param array $config 633 * 634 * @return Response 635 * @throws XcooBeeException 636 */ 637 public function dontSellData($email, $config = []) 638 { 639 if (!$email) { 640 throw new XcooBeeException('No "email" provided'); 641 } 642 643 $query = 'mutation dontSellData($email: String!) { 644 do_not_sell_data(email: $email) { 645 user_email 646 } 647 }'; 648 649 $response = $this->_request($query, ['email' => $email], $config); 650 if ($response->code !== 200) { 651 return $response; 652 } 653 654 $response = new Response(); 655 $response->code = 200; 656 $response->result = true; 657 658 return $response; 503 659 } 504 660 } -
xcoobee/trunk/includes/sdk/src/XcooBee/Core/Configuration.php
r2126380 r2212575 11 11 /** @var XcooBee */ 12 12 protected $_xcoobee; 13 13 14 /** @var ConfigModel */ 15 protected $_config = null; 16 14 17 public function __construct(XcooBee $xcoobee) 15 18 { 16 19 $this->_xcoobee = $xcoobee; 17 20 } 18 21 19 22 /** 20 23 * Set configuration data … … 24 27 public function setConfig(ConfigModel $config) 25 28 { 29 $this->_config = $config; 30 26 31 $savedConfig = $this->_xcoobee->getStore()->getStore(CachedData::CONFIG_KEY); 27 32 if($savedConfig != $config){ … … 37 42 public function getConfig() 38 43 { 44 if ($this->_config !== null) { 45 return $this->_config; 46 } 47 39 48 return $this->_xcoobee->getStore()->getStore(CachedData::CONFIG_KEY); 40 49 } -
xcoobee/trunk/includes/sdk/src/XcooBee/Http/Client.php
r2126380 r2212575 71 71 72 72 if($token === null){ 73 $config = $ store->getStore(CachedData::CONFIG_KEY);73 $config = $this->_xcoobee->getConfig(); 74 74 $token = $this->_fetchToken($config); 75 75 $store->setStore(CachedData::AUTH_TOKEN_KEY, $token); -
xcoobee/trunk/includes/sdk/src/XcooBee/Store/CachedData.php
r2183457 r2212575 17 17 protected static $_instance = null; 18 18 19 protected $_store ;19 protected $_store = null; 20 20 21 public function __construct(FileSystem $driver )21 public function __construct(FileSystem $driver = null) 22 22 { 23 $this->_store = new Pool($driver); 23 if ($driver !== null) { 24 $this->_store = new Pool($driver); 25 } 24 26 } 25 27 … … 54 56 return new FileSystem([]); 55 57 } catch (\Exception $ex) { 56 throw new XcooBeeException('Couldn\'t init cache driver. Add correct permission to SDK directory'); 58 // in case we weren't able to use filesystem, don't use cache at all 59 return null; 57 60 } 58 61 } … … 67 70 public function setStore($key, $value) 68 71 { 72 if ($this->_store === null) { 73 return null; 74 } 75 69 76 $item = $this->_store->getItem(md5($key)); 70 77 $this->_store->save($item->set($value)); … … 79 86 public function getStore($key) 80 87 { 88 if ($this->_store === null) { 89 return null; 90 } 91 81 92 $item = $this->_store->getItem(md5($key)); 82 93 return $item->get(); … … 88 99 public function clearStore() 89 100 { 101 if ($this->_store === null) { 102 return null; 103 } 104 90 105 $this->_store->clear(); 91 106 } -
xcoobee/trunk/includes/sdk/src/XcooBee/XcooBee.php
r2126380 r2212575 33 33 /** @var CachedData */ 34 34 private $_store; 35 35 36 36 public function __construct() 37 37 { … … 73 73 $this->configuration->clearConfig(); 74 74 } 75 75 76 76 /** 77 77 * Get CachedData … … 81 81 public function getStore() 82 82 { 83 84 83 return $this->_store; 85 84 } -
xcoobee/trunk/includes/sdk/test/src/XcooBee/Core/Api/ConsentsTest.php
r2126380 r2212575 123 123 } 124 124 125 public function testListConsents ()125 public function testListConsents_WithoutFilters() 126 126 { 127 127 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ … … 133 133 ->method('_request') 134 134 ->will($this->returnCallback(function ($query, $params) { 135 $this->assertEquals([' statuses' => null, 'userId' => 'testUser', 'first' => true, 'after' => null], $params);135 $this->assertEquals(['userId' => 'testUser', 'first' => true, 'after' => null], $params); 136 136 })); 137 137 … … 142 142 * @expectedException \XcooBee\Exception\XcooBeeException 143 143 */ 144 public function testListConsents_invalidDateFrom() 145 { 146 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 147 '_request' => true, 148 '_getPageSize' => true, 149 '_getUserId' => 'testUser' 150 ]); 151 152 $consentsMock->listConsents(['dateFrom' => 'invalid_date']); 153 } 154 155 /** 156 * @expectedException \XcooBee\Exception\XcooBeeException 157 */ 158 public function testListConsents_invalidDateTo() 159 { 160 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 161 '_request' => true, 162 '_getPageSize' => true, 163 '_getUserId' => 'testUser' 164 ]); 165 166 $consentsMock->listConsents(['dateTo' => 'invalid_date']); 167 } 168 169 /** 170 * @expectedException \XcooBee\Exception\XcooBeeException 171 */ 144 172 public function testListConsents_invalidStatus() 145 173 { 146 174 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 147 175 '_request' => true, 176 '_getPageSize' => true, 148 177 '_getUserId' => 'testUser' 149 178 ]); 150 179 151 $consentsMock->listConsents(['testStatus']); 152 } 153 154 public function testListConsents_withStatus() 155 { 156 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 157 '_request' => true, 158 '_getConsentStatus' => 'testStatus', 180 $consentsMock->listConsents(['statuses' => ['testStatus']]); 181 } 182 183 /** 184 * @expectedException \XcooBee\Exception\XcooBeeException 185 */ 186 public function testListConsents_invalidConsentType() 187 { 188 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 189 '_request' => true, 190 '_getPageSize' => true, 191 '_getUserId' => 'testUser' 192 ]); 193 194 $consentsMock->listConsents(['consentTypes' => ['testType']]); 195 } 196 197 /** 198 * @expectedException \XcooBee\Exception\XcooBeeException 199 */ 200 public function testListConsents_invalidDataType() 201 { 202 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 203 '_request' => true, 204 '_getPageSize' => true, 205 '_getUserId' => 'testUser' 206 ]); 207 208 $consentsMock->listConsents(['dataTypes' => ['testType']]); 209 } 210 211 public function testListConsents_withFilters() 212 { 213 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 214 '_request' => true, 159 215 '_getUserId' => 'testUser', 160 216 '_getPageSize' => true, … … 163 219 ->method('_request') 164 220 ->will($this->returnCallback(function ($query, $params) { 165 $this->assertEquals(['statuses' => ['testStatus'], 'userId' => 'testUser', 'first' => true, 'after' => null], $params); 166 })); 167 168 $consentsMock->listConsents(['testStatus']); 169 } 170 171 public function testListConsents__UseConfig() 172 { 173 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 174 '_request' => true, 175 '_getUserId' => 'testUser', 176 '_getPageSize' => true, 177 ]); 178 $consentsMock->expects($this->once()) 179 ->method('_request') 180 ->will($this->returnCallback(function ($query, $params, $config) { 181 $this->assertEquals(['statuses' => null, 'userId' => 'testUser', 'first' => true, 'after' => null], $params); 182 $this->assertEquals(['apiKey' => 'testapikey', 'apiSecret' => 'testapisecret'], $config); 183 })); 184 185 $consentsMock->listConsents([], [ 186 'apiKey' => 'testapikey', 187 'apiSecret' => 'testapisecret' 221 $this->assertEquals([ 222 'search' => 'Cool', 223 'country' => 'US', 224 'province' => 'California', 225 'city' => 'Los Angeles', 226 'dateFrom' => '2019-01-01', 227 'dateTo' => '2019-12-31', 228 'statuses' => ['expired', 'rejected'], 229 'consentTypes' => ['perform_contract', 'perform_a_service'], 230 'dataTypes' => ['first_name', 'middle_name', 'last_name'], 231 'userId' => 'testUser', 232 'first' => true, 233 'after' => null, 234 ], $params); 235 })); 236 237 $consentsMock->listConsents([ 238 'search' => 'Cool', 239 'country' => 'US', 240 'province' => 'California', 241 'city' => 'Los Angeles', 242 'dateFrom' => '2019-01-01', 243 'dateTo' => '2019-12-31', 244 'statuses' => ['expired', 'rejected'], 245 'consentTypes' => ['perform_contract', 'perform_a_service'], 246 'dataTypes' => ['first_name', 'middle_name', 'last_name'], 188 247 ]); 189 248 } … … 639 698 200, 640 699 (object) [ 641 'data_package' => (object) [ 642 'data' => 'encrypted data package' 700 'data_package' => [ 701 (object) [ 702 'data' => 'encrypted data package' 703 ] 643 704 ] 644 705 ] … … 656 717 657 718 $response = $consentsMock->getDataPackage('testConsentId'); 658 $this->assertEquals('{"test": true}', $response->result->data_package ->data);719 $this->assertEquals('{"test": true}', $response->result->data_package[0]->data); 659 720 } 660 721 … … 665 726 200, 666 727 (object) [ 667 'data_package' => (object) [ 668 'data' => 'encrypted data package' 728 'data_package' => [ 729 (object) [ 730 'data' => 'encrypted data package' 731 ] 669 732 ] 670 733 ] … … 682 745 683 746 $response = $consentsMock->getDataPackage('testConsentId'); 684 $this->assertEquals('encrypted data package', $response->result->data_package ->data);747 $this->assertEquals('encrypted data package', $response->result->data_package[0]->data); 685 748 } 686 749 … … 691 754 200, 692 755 (object) [ 693 'data_package' => (object) [ 694 'data' => 'encrypted data package' 756 'data_package' => [ 757 (object) [ 758 'data' => 'encrypted data package' 759 ], 695 760 ] 696 761 ] … … 708 773 709 774 $response = $consentsMock->getDataPackage('testConsentId'); 710 $this->assertEquals('encrypted data package', $response->result->data_package ->data);775 $this->assertEquals('encrypted data package', $response->result->data_package[0]->data); 711 776 } 712 777 … … 742 807 $this->assertEquals(null, $consentsMock->getCampaignIdByRef("testRef")->result); 743 808 } 809 810 public function testShareConsents() 811 { 812 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 813 '_request' => $this->_createResponse(200, true) 814 ]); 815 $consentsMock->expects($this->once()) 816 ->method('_request') 817 ->will($this->returnCallback(function ($query, $params, $config) { 818 $this->assertEquals([ 819 'config' => [ 820 'campaign_reference' => 'campaignRef', 821 'campaign_cursor' => 'campaignId', 822 'consent_cursors' => [], 823 ] 824 ], $params); 825 })); 826 827 $consentsMock->shareConsents('campaignRef', 'campaignId'); 828 } 829 830 /** 831 * @expectedException \XcooBee\Exception\XcooBeeException 832 */ 833 public function testShareConsents_InvalidArguments() 834 { 835 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, []); 836 $consentsMock->shareConsents('campaignRef'); 837 } 838 839 public function testDontSellData() 840 { 841 $consentsMock = $this->_getMock(\XcooBee\Core\Api\Consents::class, [ 842 '_request' => $this->_createResponse(200, true), 843 ]); 844 $consentsMock->expects($this->once()) 845 ->method('_request') 846 ->will($this->returnCallback(function ($query, $params) { 847 $this->assertEquals(['email' => 'test@test.email'], $params); 848 })); 849 850 $consentsMock->dontSellData('test@test.email'); 851 } 744 852 } -
xcoobee/trunk/includes/sdk/test/src/XcooBee/Core/Api/UsersTest.php
r2126380 r2212575 15 15 ]); 16 16 $usersMock->expects($this->once()) 17 ->method('_request')18 ->will($this->returnCallback(function ($query, $params) {19 $this->assertEquals(['first' => true, 'after' => null, 'userId' => 'testuserId'], $params);20 }));17 ->method('_request') 18 ->will($this->returnCallback(function ($query, $params) { 19 $this->assertEquals(['first' => true, 'after' => null, 'userId' => 'testuserId'], $params); 20 })); 21 21 22 22 $usersMock->getConversation('testuserId'); … … 30 30 ]); 31 31 $usersMock->expects($this->once()) 32 ->method('_request')33 ->will($this->returnCallback(function ($query, $params, $config) {34 $this->assertEquals(['first' => true, 'after' => null, 'userId' => 'testuserId'], $params);35 $this->assertEquals(['apiKey' => 'testapikey', 'apiSecret' => 'testapisecret'], $config);36 }));32 ->method('_request') 33 ->will($this->returnCallback(function ($query, $params, $config) { 34 $this->assertEquals(['first' => true, 'after' => null, 'userId' => 'testuserId'], $params); 35 $this->assertEquals(['apiKey' => 'testapikey', 'apiSecret' => 'testapisecret'], $config); 36 })); 37 37 38 38 $usersMock->getConversation('testuserId', [ … … 176 176 ->will($this->returnCallback(function ($query, $params) { 177 177 $this->assertEquals(['config' => [ 178 'message' => 'test message',179 'reference_cursor' => 'testconsentId',180 'note_type' => 'consent',181 'user_cursor' => 'testuserID',182 ]], $params);178 'message' => 'test message', 179 'reference_cursor' => 'testconsentId', 180 'note_type' => 'consent', 181 'user_cursor' => 'testuserID', 182 ]], $params); 183 183 })); 184 184 … … 197 197 ->will($this->returnCallback(function ($query, $params) { 198 198 $this->assertEquals(['config' => [ 199 'message' => 'test message',200 'reference_cursor' => 'testTicketId',201 'note_type' => 'ticket',202 'user_cursor' => 'testuserID',203 ]], $params);199 'message' => 'test message', 200 'reference_cursor' => 'testTicketId', 201 'note_type' => 'ticket', 202 'user_cursor' => 'testuserID', 203 ]], $params); 204 204 })); 205 205 -
xcoobee/trunk/includes/sdk/test/src/XcooBee/Store/CachedDataTest.php
r2126380 r2212575 22 22 } 23 23 24 public function testSetStore_StoreIsNull() 25 { 26 $store = new Store(); 27 $this->assertEquals(null, $store->getStore('key')); 28 } 29 24 30 public function testGetStore() 25 31 { … … 27 33 Store::getInstance()->setStore('key', 'value'); 28 34 $this->assertEquals('value', Store::getInstance()->getStore('key')); 35 } 36 37 public function testGetStore_StoreIsNull() 38 { 39 $store = new Store(); 40 $this->assertEquals(null, $store->getStore('key', 'value')); 29 41 } 30 42 … … 39 51 $this->assertNull(Store::getInstance()->getStore('key2')); 40 52 } 53 54 public function testClearStore_StoreIsNull() 55 { 56 $store = new Store(); 57 $this->assertEquals(null, $store->getStore('key', 'value')); 58 $this->assertEquals(null, $store->getStore('key')); 59 } 41 60 } -
xcoobee/trunk/readme.txt
r2183457 r2212575 3 3 Tags: xcoobee, privacy, cookie, gdpr, ccpa, consent, security 4 4 Requires at least: 4.4.0 5 Tested up to: 5. 2.46 Stable tag: 1.6. 45 Tested up to: 5.3.0 6 Stable tag: 1.6.5 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
xcoobee/trunk/xcoobee.php
r2183457 r2212575 5 5 * Author URI: https://www.xcoobee.com/ 6 6 * Description: Connects your website to the XcooBee privacy network and enables secure password recovery and login. Base library for XcooBee GDPR and CCPA Add-ons. 7 * Version: 1.6. 47 * Version: 1.6.5 8 8 * Author: XcooBee 9 9 * License: GPLv3 … … 14 14 * 15 15 * Requires at least: 4.4.0 16 * Tested up to: 5. 2.416 * Tested up to: 5.3.0 17 17 * 18 18 * @package XcooBee
Note: See TracChangeset
for help on using the changeset viewer.