Skip to content

Instantly share code, notes, and snippets.

@heerdt
Created February 7, 2025 11:43
Show Gist options
  • Save heerdt/82b118ab4cd70548df61224fb7934df1 to your computer and use it in GitHub Desktop.
Save heerdt/82b118ab4cd70548df61224fb7934df1 to your computer and use it in GitHub Desktop.
<?php
/*************************************************************************
* Create an RDR for every source for a shop, useful for testing.
* Bypasses duplicate check.
*
* Usage: php rdr_create.php [shop_id]
*******************************************************************************/
require 'GCI/bootstrapcli.php';
$shop_finder = new EtsyModel_Shop_ShopFinder();
$shop_id = (string)$argv[1];
$request_source_map = new DataType_RegulatoryDataRequest_Source();
$shop = $shop_finder->findByShopId($shop_id);
$shop->Data()->setRDRDuplicateCreationException(true);
// Request all sources
$request_source_map = new DataType_RegulatoryDataRequest_Source();
$sources = $request_source_map->getAllValues();
$regulatory_data_request_id = (new \Etsy\Web\Shop\Regulatory\Data\Request\RequestService())->startRequest($shop_id, $shop->user_id, $sources);
echo "\n";
echo "Created RDR:\n";
echo "regulatory_data_request_id: {$regulatory_data_request_id}\n";
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment