Giter Club home page Giter Club logo

shopify-private-apis's People

Contributors

bdunlap avatar martinamps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shopify-private-apis's Issues

Question: Still working?

I'm glad someone has done the hard work to research this technique. I was wondering if someone would be so kind to let me know if it still works? Thanks

user agent string issues

I am getting an error page when trying to login. Shopify will not allow me to login using this app it seems.
I am debugging.

You’re using version 49.0.2623.111 of Chrome, which is not supported by Shopify. You can update to the latest version by selecting "Update Google Chrome" from your browser’s toolbar and restarting Chrome. If you continue using the current version some features may not work correctly.

When I upload to a server I the token cant be set

Im getting a really weird error. I've been programming this in localhost so far and it worked out fine, but when I upload it to the server I couldn't use it anymore. The error came out that "Failed to set token." Does this have something to do with the server permissions or am I doing something wrong? Has anyone stumbled upon this error?

discount creation does not work anymore

Just wanted to put it out there. The creation of the discount does not work anymore. I managed to get the get function to work by changing the way the CSRF token get's parsed, but that's about it.

'Exception' with message 'Failed to set token '

{
EDIT:

Issue resolved after syncing repo.
this line changed.
meta name="csrf-token" content="(.*)" /

}
The CSRF token is unable to be set any longer using this application.

this may have to do with filter_var in the set token function. (I have not fully debugged.)

Also, Shopify Plus accounts now have the ability to use the Discounts API.

Shopify may have also closed the door on this "feature" as it is not offered to accounts that are not Plus accounts.

Get the Shopify Admin Login Screen

Using the code below I'm getting the login screen, but the strange thing is that it DID work once and I saw the discount within Shopify. I'm logged in, but every time I hit my example.php script I get the login screen now. Any ideas?
-Aaron

<?php

require 'shopify.php';

$api = new \Shopify\PrivateAPI('[email protected]', 'AdminPassword', 'https://mystore.myshopify.com/admin');

if (!$api->isLoggedIn() && !$api->login()) {
    echo '<p>invalid credentials</p>';
} else {
    # Create a 5% discount coupon
    $new_discount = ['discount' => [
        'applies_to_id' => '',
        'code' => 'automatic_coupon',
        'discount_type' => 'percentage',
        'value' => 5,
        'usage_limit' => 1,
        'starts_at' => date('Y-m-d\TH:i:sO', mktime(0, 0, 0)),
        'ends_at' => null,
        'applies_once' => false
    ]];

    # Set the CSRF token for the POST request
    try { $api->setToken('https://mystore.myshopify.com/admin/discounts/new'); } 
    catch (\Exception $ex) { }

    $do_discount = $api->doRequest('POST', 'discounts.json', $new_discount);

    print_r($do_discount);
}

image

Error: "Failed to set token"

Hello Im getting an error while trying to use the POST method, each time it returns "Failed to set token" Ive tried many ways of solving this with the ideas posted before, but with no luck. I can actually use the get but I cant use the post, apparently the token is not being made. Any ideas why? Here si part of the code:

try { $api_shopify->setToken('https://myshop.myshopify.com/admin/discounts/new'); } catch (\Exception $ex) { echo "Error: " . $ex} $responseOrderShopify = $api_shopify->doRequest('POST', 'orders.json', $MLOrder);

I tried with the url https://myshop.myshopify.com/admin/draft_orders/new

And I get this error:

Error: exception 'Exception' with message 'Failed to set token' in /home/mysite/public_html/mysite.com/app/Plugin/Shopify/Controller/InstallController.php:1026

Also on the print for $responseOrderShopify I get the webadmin login. Im not sure if Im doing anything wrong here? Could someone help me ? :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.