The title is the Paypal NVP API's error message. API is TransactionSearch.
In my PHP code, if I set the search parameters "STATUS" => "Reversed", The API return this result:
'TIMESTAMP' => '2016-03-23T02:32:41Z',
'CORRELATIONID' => '77fcf63ee550e',
'ACK' => 'SuccessWithWarning',
'VERSION' => '109.0',
'BUILD' => '18316154',
'L_ERRORCODE0' => '11002',
'L_SHORTMESSAGE0' => 'Search warning',
'L_LONGMESSAGE0' => 'The number of results were truncated. Please change your search parameters if you wish to see all your results.',
'L_SEVERITYCODE0' => 'Warning'
But, If I not add the search parameters "STATUS", API return success!
so, I want to know how to set search parameters that I can get right result with "STATUS" => "Reversed"
do you have many reversed transactions? I ask because the maximum number of transactions that can be returned from a TransactionSearch API call is 100. In this case looks like the API response has more than 100 hits. Try to reduce the data range or look for other status and see if you still get the error. Anyway here you can find the technical reference guide for this API: https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
Related
i am trying to learn aws sns service to send sms from my web application.
I am working on localhost.
$params = array(
'credentials' => array(
'key' => 'iam_key',
'secret' => 'iam_secret',
),
'region' => 'ap-south-1', // < your aws from SNS Topic region
'version' => 'latest',
'http' => ['verify'=>false]
);
$sns = \Aws\Sns\SnsClient::factory($params);
$msgattributes = [
'AWS.SNS.SMS.SenderID' => [
'DataType' => 'String',
'StringValue' => 'Klassroom',
],
'AWS.SNS.SMS.SMSType' => [
'DataType' => 'String',
'StringValue' => 'Transactional',
]
];
$payload = array(
'Message' => "HK test",
"PhoneNumber" => "1234567890",
'MessageAttributes' => $msgattributes
);
$result = $sns->publish($payload);
i want to send sms directly on number. this code is giving this error
Fatal error: Uncaught exception 'Aws\Sns\Exception\SnsException' with message 'Error executing "Publish" on "https://sns.ap-south-1.amazonaws.com"; AWS HTTP error: Client error: POST https://sns.ap-south-1.amazonaws.com resulted in a 400 Bad Request response: Sender InvalidPara (truncated...) InvalidParameter (client): Invalid parameter: PhoneNumber Reason: +1234567890 is not valid to publish to - Sender InvalidParameter Invalid parameter: PhoneNumber Reason: +1234567890 is not valid to publish to 13e181c2-a20f-5e77-9c8e-d38c55c50266 ' exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: POST https://sns.ap-south-1.amazonaws.com resulted in a 400 Bad Request
i don't know why....
I believe a phone number for AWS has to include the country code.
For instance if my phone number is (999) 365-6721 it would be +19993656721 (for US)
I had the exact same issue even though I called the API with a valid phone number prefixed with correct country code (for example +57xxxxxxxxxx).
Then I figured out after running through some threads on the internet that it was only because of the incorrect REGION_CODE (for example us-west-1 instead of us-east-1) used during the instantiation of SNSClient class.
#Bean
public AmazonSNS snsClient() {
return AmazonSNSClientBuilder.standard().withRegion("us-east-1").withCredentials(new AWSStaticCredentialsProvider(credentials())).build();
}
Refer to the link to find the right region code for your case.
You need to use the region that supported SMS for AWS SNS.
More information: https://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
SMS Sandbox Mode
When you start off using SNS for the first time for sending SMS, it starts in the so called 'Sandbox Mode'.
In this mode, you must verify the phone numbers that you intend to use.
If you are using SMS in Sandbox Mode and try to send an SMS via SNS to an unverified number, you will get the error
This prevents unsolicited text messaging.
If you try to create an SMS subscription to an SNS topic without a phone number that's been verified you will indeed receive the error:
Enter a valid mobile number
The phone number is valid. You just need to verify it first, as described above, before you can create this subscription in SNS
Of course, the same principle applies, when you're trying to achieve this via code.
I am using PHP curl to post to https://api.pinterest.com/v1/boards/?access_token=mysecrettoken
I have two parameters, name and description that are being posted.
$data = array( 'name' => 'API Test', 'description' => 'Please ignore just a test' );
What I get back from Pinterest is NULL. It does create the board on Pinterest but I really need to know if it was successful and I need the board id.
What I would expect would be something like below. Which is what I get when using the API explorer.
root:{} 1 item data:{} 3 items url:https://www.pinterest.com/mrnickpowers/api-test/ id:73183631383926646 name:API Test
My curl function for posting works with other endpoints. Anyone have a clue what might be happening here?
Thanks,
Nick
Due to the May 2015 updates my application cannot use the login with LinkedIn option, this is the snippet I'm using:
$linkedinService->request('/people/~:(first-name,last-name,email-address)?format=json')
When I use the web console it returns the correct data, but if I dump the result from the app I get this:
array (size=5)
'errorCode' => int 0
'message' => string 'Unknown field {~%3A%28first-name%2Clast-name%2Cemail-address%29} in resource {Root}' (length=83)
'requestId' => string 'asdfghjk' (length=10)
'status' => int 400
'timestamp' => int 1435742730817
Update:
The exact curl request is: (with access token)
https://api.linkedin.com/v1//people/~%3A%28first-name%2Clast-name%2Cemail-address%29?format=json&oauth2_access_token=
If I paste that in the web console I get
Could not find person based on: ~%3A%28first-name%2Clast-name%2Cemail-address%29
But if I urldecode it first and paste it in it returns the correct data
Hi I got the same problem. I find out that it is URL Problem. In request uri don't use // double slash like you did in your example m/v1//people/.
I know its been you have posted here but someone else can get benefit of it.
I'm trying to tame the PayPal API with moderate success. I use PHP for sending the request and processing the response. So far I've managed to compose a valid array containing the request parameters and send it to the Paypal for validation. The request goes through validation and returns transaction token as expected. Here's my array:
$requestParams = array(
'RETURNURL' => 'http://www.myurl.com/#success',
'CANCELURL' => 'http://www.myurl.com/#cancel',
'PAYMENTREQUEST_0_AMT' => 30,
'PAYMENTREQUEST_0_SHIPPINGAMT' => '10',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_ITEMAMT' => '20',
'ALLOWNOTE' => 1,
'L_PAYMENTREQUEST_0_NAME1' => 'Black kitten',
'L_PAYMENTREQUEST_0_DESC1' => 'Nice and fluffy cute guy',
'L_PAYMENTREQUEST_0_QTY1' => '1',
'L_PAYMENTREQUEST_0_AMT1' => '10',
'L_PAYMENTREQUEST_0_NAME0' => 'Ginger kitten',
'L_PAYMENTREQUEST_0_DESC0' => 'Super cute ginger dude',
'L_PAYMENTREQUEST_0_QTY0' => '1',
'L_PAYMENTREQUEST_0_AMT0' => '10'
);
THE QUESTION
I want to send the same request but to form a recurring payment. Which means I want to charge the user's PayPal account every month. I was surfing throught PayPal API docs, but the way it's written seems super confusing for me and provides no answers whatsoever.
Maybe I should just insert another parameter to the $requestParams or maybe I should compose a completely different array or what? Please assist!
I actually just wrote an article about this a few days ago. It's a pretty quick run-through of the process so if you have more questions let me know, but I'd definitely recommend taking a look as it lays out everything you'll need to do, and it does it with my class library which makes this all very simple for you.
One of the way to implement recurring payment is using Express Checkout with creation of Billing Agreement and Reference Transactions. You can find details in official documentation here and here.
Currently when attempting a coupon (POST) at resource "/coupon.json" we are getting the following return JSON:
Response Code:
{"status":400,"message":"The field 'id' cannot be written to. Please remove it from your request before trying again."}
The "ID" field is obviously no where in our code but we are still receiving this error.
In to this addition we thought it might be from the "applies_to" as that object resource contains an "ids" element but we disabled that and still received the same effect.
At this time it is our best guess that this is a bug on the server side that is registering incoming JSON for the coupon resource with an "ID" point on it.
Question: Is creating a coupon currently possible?
It is possible to create coupons. I got it working both from a php script and using the developer playground at https://developer.bigcommerce.com/console
$coupon = array('name' => 'FJKDJFKD', 'type' => 'percentage_discount', 'amount' => 50.0, 'code' => 'JFKDFE', 'enabled' => true, 'applies_to' => array('entity' => 'products', 'ids' => array(32)), 'shipping_methods' => array());
print_r($coupon);
Screenshots from the playground -