Using Codeigniter Payments - codeigniter

How to properly use the $this->payments->payment_action(); function?
All I get is this:
object(stdClass)#137 (5) {
["type"]=>
string(14) "local_response"
["status"]=>
string(7) "failure"
["response_code"]=>
string(3) "000"
["response_message"]=>
string(32) "The method called does not exist"
["details"]=>
string(27) "No further details provided"
}

As per the question, You are receiving some objects.
For ex: Here i'm just printing the object content. If you ant to store in db, then you can do with $obj.
$obj = $this->payments->payment_action();
echo "Type = ".$obj->type;
echo "Status= ".$obj->status;
echo "Response code= ".$obj->response_code;
echo "Response Message= ".$obj->response_message;
echo "Details= ".$obj->details;

Related

strapi.JS GRAPHQL ERROR "Expected value of type \"StringFilterInput\", found \”anna\”.”,

I'm try GraphQL with strapi.JS and get error in http://localhost:1337/graphql
Very similar work well previously in other website. I'm try before changing other user nothing work.
Here full error:
{
"error": {
"errors": [
{
"message": "Expected value of type \"StringFilterInput\", found \"ann.bystry\".",
"locations": [
{
"line": 2,
"column": 58
}
],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"exception": {
"stacktrace": [
"GraphQLError: Expected value of type \"StringFilterInput\", found \"ann.bystry\".",
" at isValidValueNode (/Users/ann.bystry/annblogstry/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js:118:25)",
" at Object.StringValue (/Users/ann.bystry/annblogstry/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js:93:14)",
" at Object.enter (/Users/ann.bystry/annblogstry/node_modules/graphql/language/visitor.js:323:29)",
" at Object.enter (/Users/ann.bystry/annblogstry/node_modules/graphql/utilities/TypeInfo.js:370:25)",
" at visit (/Users/ann.bystry/annblogstry/node_modules/graphql/language/visitor.js:243:26)",
" at validate (/Users/ann.bystry/annblogstry/node_modules/graphql/validation/validate.js:69:24)",
" at validate (/Users/ann.bystry/annblogstry/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/requestPipeline.js:185:39)",
" at processGraphQLRequest (/Users/ann.bystry/annblogstry/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/requestPipeline.js:90:34)",
" at runMicrotasks (<anonymous>)",
" at processTicksAndRejections (internal/process/task_queues.js:95:5)",
" at async processHTTPRequest (/Users/ann.bystry/annblogstry/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/runHttpQuery.js:183:30)",
" at async /Users/ann.bystry/annblogstry/node_modules/apollo-server-koa/dist/ApolloServer.js:82:59",
" at async bodyParser (/Users/ann.bystry/annblogstry/node_modules/koa-bodyparser/index.js:95:5)",
" at async cors (/Users/ann.bystry/annblogstry/node_modules/#koa/cors/index.js:98:16)",
" at async returnBodyMiddleware (/Users/ann.bystry/annblogstry/node_modules/#strapi/strapi/lib/services/server/compose-endpoint.js:52:18)",
" at async policiesMiddleware (/Users/ann.bystry/annblogstry/node_modules/#strapi/strapi/lib/services/server/policy.js:28:5)"
]
}
}
}
]
}
}
welcome to Stackoverflow, glad to see you are starting out with Strapi!
If I understand right, you are referring to V4, if you used V3 before, then as #xadm pointed out you likely are providing incorrect input for your GraphQL query filters.
You can always find the definition (the parameters it accepts and the format of them) for StringFilterInput and any other types by clicking on the green "DOCS" label on the right hand side of your GraphQL Playground (Screenshot below):
With this in mind you may want to try querying with the below query (replacing posts with the Collection Type you are searching for)
*also note the " eq: in username filter
query {
posts(filters: { author: { username: { eq: "ann.bystry" } } }) {
data {
id
attributes {
title
# query other fields here
}
}
}
}
Friendly suggestion for future - when you ask a question it is always useful to paste in any relevant code samples and versions of the frameworks/packages you are using :)
Best of luck!

how to check if youtube url exist or not in laravel?

I want to check if entered URL exist on YouTube or not before saving that URL in my database
I am using this code
$url = 'https://www.youtube.com/watch?v=KeaoSIKaxeg';
if(preg_match('/http:\/\/www\.youtube\.com\/watch\?v=[^&]+/', $url))
{
dd('match');
}
else
{
dd('not match');
}
I have tried everything but nothing works. It always returns 'not match' even if the URL is valid.
$headers = get_headers('http://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=KeaoSIKaxeg');
if (!strpos($headers[0], '200')) {
echo "The YouTube video you entered does not exist";
}
You're trying to match against http://, not https://:
$url = 'https://www.youtube.com/watch?v=KeaoSIKaxeg';
if(preg_match('/https:\/\/www\.youtube\.com\/watch\?v=[^&]+/', $url)) {
dd('match');
}
else {
dd('not match');
}

Get single data from session array - CodeIgniter

I want to get single value from the flashdata array in the view which is sent from the controller.
controller:
$post=array(
'author_id'=>$this->input->post('author'),
'title'=>$this->input->post('post_title'),
'subtitle'=>$this->input->post('post_subtitle'),
'post'=>$this->input->post('textarea1'),
'image'=>$this->upload->file_name,
);
$this->session->set_flashdata('postdata',$post);
view
<?php var_dump($this->session->flashdata('postdata'))?>
The above gave me the following result.
array(5) { ["author_id"]=> string(1) "6" ["title"]=> string(3) "uyk" ["subtitle"]=> string(26) "Full-Stack Web Development" ["post"]=> string(1) "u" ["image"]=> string(0) "" }
How can I get only single value like title or subtitle?
What about this $this->session->userdata['postdata']['title']

How to remove a specific value from an array stored in a ruby hash

I am getting this in my error list :
#error_messages = {
:password=>["can't be blank", "Password is required."],
:"addresses.firstname"=>["can't be blank","Firstname is required."],
:"addresses.city"=>["can't be blank", "city is required."]
}
Here I want to remove the value "can't be blank" value from this hash so that I will get the validation error messages which was included by me.
is it possible to remove "can't be blank" value from above hash list and I will get this in result :
#error_messages = {
:password=>["Password is required."],
:"addresses.firstname"=>["Firstname is required."],
:"addresses.city"=>["city is required."]
}
How to remove a specific value from a hash list(want to remove a specific value not a complete key,value pair).
Yes, possible.
#error_messages = {
:password=>["can't be blank", "Password is required."],
:"addresses.firstname"=>["can't be blank","Firstname is required."],
:"addresses.city"=>["can't be blank", "city is required."]
}
#error_messages.each do |_,v|
v.delete( "can't be blank" )
end
#error_messages
# => {:password=>["Password is required."],
# :"addresses.firstname"=>["Firstname is required."],
# :"addresses.city"=>["city is required."]}

Doctrine repository findOneBy print sql. why? how can I disable this?

$rep = $em->getRepository('Entities\User');
$user = $rep->findOneBy(array('email'=>'d*****e#s*****o.com'));
print output:
SELECT t0.uid AS uid1, t0.email AS email2, t0.password AS password3, t0.name AS name4, t0.surname AS surname5, t0.matrikel AS matrikel6, t0.status AS status7, t0.registration_time AS registration_time8, t0.gid AS gid9 FROM user t0 WHERE t0.email = ? LIMIT 1 array(1) { [0]=> string(21) "d*****e#s*****o.com" } array(1) { [0]=> string(6) "string" }
I just wanna the entity, not print output. Where can I disable this?
You probably have the Echo SQL Logger enabled. Turn it off.

Resources