Shopify APP API - api

$shopify = shopify\client( $shop, $app_settings->api_key, $shop_data->access_token, false );
$products = $shopify('GET', '/admin/products.json', array('published_status' => 'published'));`
I am getting the following response by printing the $shopify:
Closure Object
(
[static] => Array
(
[base_uri] => https://4f4b14c3eb5464ae238dd6cf4b88bce6:c2608b7067c5bf96028876023114b68c#pilibaba.myshopify.com/
[oauth_token] => c2608b7067c5bf96028876023114b68c
[private_app] => 2f996f1bd2a0f4fb343703555c89a234
)
[parameter] => Array
(
[$method_uri] =>
[$query] =>
[$payload] =>
[&$response_headers] =>
[$request_headers] =>
[$curl_opts] =>
)
)
after that accessing the $product i am getting the following error.
Fatal error:
Uncaught phpish\shopify\CurlException: [3] malformed in /*****/shopify_app/shopify_app.php on line 36 thrown in /******/shopify_app/shopify.php on line 67
Is it a problem with my access token? as i do have all the store permission while installing the app.
I did research for this error by didnt find any help either from shopify support team.

change keys of your url:
apikey = c2608b7067c5bf96028876023114b68c
access_token = 4f4b14c3eb5464ae238dd6cf4b88bce6
https://c2608b7067c5bf96028876023114b68c:4f4b14c3eb5464ae238dd6cf4b88bce6#pilibaba.myshopify.com/admin/shop.json

Related

In laravel 10 using passport , Login Get Erro

TypeError: Cannot access offset of type string on string in file
D:\kr_dev\Projects\lara10\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php
on line 89
config(['auth.guards.superusers-api' => 'superusers']);
Auth::guard('superusers-api')->login($user,true);
or
config(['auth.guards.superusers-api' => 'superusers']);
Auth::guard('superusers-api')->attempt(['email' => $dto->email, 'password' => $dto->password], true);
also not working
how i make succesfull login

UnSupportedEntityException when trying to create/render records containing slug extension

I am trying to implement slugs in my bundle, but when i try to create a record and run my message consumer i get the following error:
Unexpected exception occurred during Direct URL generation ["exception" => Oro\Bundle\RedirectBundle\Exception\UnsupportedEntityException { …}] ["processor" => "Oro\Bundle\RedirectBundle\Async\DirectUrlProcessor","message_id" => "oro.6256de2124b630.96491198","message_body" => ["createRedirect" => true,"id" => [3],"class" => "Phpro\OroBundleBlogBundle\Entity\BlogPostCategory"],"message_properties" => ["oro.message_queue.client.topic_name" => "oro.redirect.generate_direct_url.entity","oro.message_queue.client.queue_name" => "oro.default","oro.security.token" => "organizationId=1;userId=1;userClass=Oro\Bundle\UserBundle\Entity\User;roles=ROLE_ADMINISTRATOR"],"message_headers" => ["content_type" => "application/json","message_id" => "oro.6256de2124b630.96491198","timestamp" => "1649860129","priority" => "2"],"elapsed_time" => "34 ms","memory_usage" => "107.57 MB"]
The slugs are stored, but the use of the get_slug_urls_for_prototypes twig filter results in the following error An exception has been thrown during the rendering of a template (""). Again because of the UnsupportedEntityException
Am i missing some configuration?
As mentioned in the OroCommerce documentation the entity must implement the interface to support slugs. Make sure you fulfilled this requirement.

Getting the "The provided value for the 'redirect_uri' is not valid" error when I try to get the access token

When I try to get the token I get the error:
The provided value for the 'redirect_uri' is not valid. The value must exactly match the redirect URI used to obtain the authorization code.
My redirect uri exactly matches so I don't understand why it is happening.
$TOKEN_ENDPOINT = 'https://login.microsoftonline.com/common/oauth2/v2.0/token';
$params = array(
'grant_type' => 'authorization_code',
'code' => $azureCode,
'clientId' => '7c09ab71-***-****-****-53d7c4438112',
'clientSecret' => 'bnot*******20*[',
'redirect_uri' => 'https://testing.****.com/outlookOauthCallback.php',
'urlAuthorize' => $AUTHORIZATION_ENDPOINT,
'urlAccessToken' => $TOKEN_ENDPOINT,
'urlResourceOwnerDetails' => '',
'scope' => 'Calendars.ReadWrite User.Read'
);
$response = $client->getAccessToken($TOKEN_ENDPOINT, 'authorization_code', $params);
(Trust me the part I turned into stars is exactly the same because I copy pasted)
Even in the response where I returned the params it is exactly the same:
Array
(
[grant_type] => authorization_code
[code] => M51b1b*****-daeec54627b2
[clientId] => 7c09ab71-a*****d7c4438112
[clientSecret] => bnotxds&*&QB***cVLF20*[
[redirect_uri] => https://testing.****.com/outlookOauthCallback.php
[urlAuthorize] => https://login.microsoftonline.com/common/oauth2/v2.0/authorize
[urlAccessToken] => https://login.microsoftonline.com/common/oauth2/v2.0/token
[urlResourceOwnerDetails] =>
[scope] => Calendars.ReadWrite User.Read
)
So how can it still be giving me this error? What am I missing here?
You need specify the redirect_uri in the request url. Something like
var href = 'login.microsoftonline.com/common/oauth2/…'; href += client_id + '&resource=webdir.online.lync.com&redirect_uri=' + window.location.href;

omnipay payment wall integration -Error

I tried to implement paymentwall payment gateway integration with Laravel using omnipay library.After setting setApiType, setPublicKey and setPrivateKey and trying to call the API, its getting the response "Public key is missed or invalid" from payment wall gateway.
Actually this error is happened due to passing parameter public key as public_Key instead of public_key from the omnipay library.
The following is the response
[request:protected] => Omnipay\PaymentWall\Message\PurchaseRequest Object
(
[endPoint:protected] => https://api.paymentwall.com/api
[parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[apiType] => 0
[publicKey] => hjghjghsdfsc5464564564e56456
[privateKey] => gfh4567686786787hfjfhgfgfgh
[amount] => 10.00
[currency] => USD
[accountId] =>
[description] => test Pay
[email] => test#gmail.com
[clientIp] => 112.133.236.158
[browserDomain] => test.com
[card] => Omnipay\Common\CreditCard Object
[response:protected] => Omnipay\PaymentWall\Message\Response Object
*RECURSION*
[zeroAmountAllowed:protected] => 1
[negativeAmountAllowed:protected] =>
)
[data:protected] => Array
(
[type] => Error
[object] => Error
[error] => Public key is missed or invalid
[code] => 2111
[log] =>
)
)
Public key is missed or invalid
As I commented in the issue that you raised on github:
This is working for everyone else. Are you sure there isn't really an issue with your keys? Can you check that there are no spurious newlines, etc, in your key as provided to the library?
The correct name for the public key parameter within Omnipay is publicKey. The correct name within the paymentwall library is public_key. A check of the code appears to indicate that the parameter naming is correct. The Omnipay publicKey parameter is correctly passed to the paymentwall library as public_key.

$facebook->getSignedRequest(); return the correct value in iframe while return null on my server side

i am building a fan gate for my site to give out some coupon.
here is my code:
<?php
require_once 'facebook.php';
$app_id = "xxxxxxxxxxxxxxx";
$app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
print_r($_REQUEST);
$signed_request = $facebook->getSignedRequest();
echo "<pre>";
print_r($facebook->getSignedRequest());
echo "</pre>";
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
$like_status = $signed_request["page"]["liked"];
print_r($facebook);
?>
I find that the return value of $facebook->getSignedRequest(); is different when i am visiting my apps via apps.facebook.com/xxxxxxxxxxxxxxxxxxxxxx/ and when i am visiting www.coupon.mysite.com/facebook/index.php
via apps.facebook.com/xxxxxxxxxxxxxxxxxxxxxx/:
Facebook Object ( [appId:protected] => 15255288xxxxxxxx [appSecret:protected] => XXXXXXXXXXXXXXXXXXXX[user:protected] => [signedRequest:protected] => Array ( [algorithm] => HMAC-SHA256 [issued_at] => xxxxxxxxxxxxx[user] => Array ( [country] => hk [locale] => en_US [age] => Array ( [min] => 21 ) ) ) [state:protected] => [accessToken:protected] => [fileUploadSupport:protected] => )
via www.coupon.mysite.com/facebook/index.php:
Facebook Object ( [appId:protected] => xxxxxxxxxxxxxxxxxxx[appSecret:protected] => xxxxxxxxxxxxxxxxxx[user:protected] => [signedRequest:protected] => [state:protected] => [accessToken:protected] => [fileUploadSupport:protected] => )
so the fan gate wont work because $facebook->getSignedRequest(); always return null in my server side. I have do the searching for this problem for some days already and still dont understand what is the problem.
Any help is very much appreciated.
^ ... continue from the comments:
First of all, if you do this, your users will hate you; secondly, that plugin is bit of a scam - all it does is uses cookies to store if user has liked a page - but if you delete your cookies, you will be locked out of the content because you won't be able to like the page again. Furthermore, it won't work without Javascript.
All the plugin does is it hooks into the "like" action when user clicks on the like button via
FB.Event.subscribe('edge.create', function(href, response){});
facebook graph api determine if user likes url