Hi guys!
I want to set my order to be Pending (Unpaid) and try to do it like this:
// $id is known and I only set the follow variables:
$pendingExpiresAt = '2024-06-21T13:55:13+00:00'; // php Iso 8601
$reason = "PARTNER_ACTION_REQUIRED";
postQueryWithVariablesAsync(
'mutation paymentSessionPending($id: ID!, $pendingExpiresAt: DateTime!, $reason: PaymentSessionStatePendingReason!) {
paymentSessionPending(id: $id, pendingExpiresAt: $pendingExpiresAt, reason: $reason) {
paymentSession {
id
state
nextAction {
action
context {
... on PaymentSessionActionsRedirect {
redirectUrl
}
}
}
}
userErrors {
field
message
}
}
}',
[
'id' => "gid://shopify/PaymentSession/$id",
'reason' => [
'code' => $reason,
'merchantMessage' => 'Waiting payment to be approved.',
],
],
$this->rateLimits->graphqlSleepFunction(queryCost: 13)
);
And as result I got strange response:
“message”: “Variable $pendingExpiresAt of type DateTime! was provided invalid value”,
“explanation”: “Expected value to not be null”
“message”:“Variable $reason of type PaymentSessionStatePendingReason! was provided invalid value”,
“explanation”:“Expected “{
“code”=>“PARTNER_ACTION_REQUIRED”,
“merchantMessage”=>“Waiting payment to be approved.”
}” to be one of: BUYER_ACTION_REQUIRED, PARTNER_ACTION_REQUIRED, NETWORK_ACTION_REQUIRED”}]}}]}
Any ideas what I am doing wrong?
Regards!