No description on approve page when I use the PayPal REST API - api

Using the PayPal REST API, I'm passing in this to new payments:
URL: https://api.paypal.com/v1/payments/payment
Request:
{
"intent":"sale",
"payer":{
"payment_method":"paypal"
},
"redirect_urls":{
"return_url":"[return_path]",
"cancel_url":"[cancel_path]"
},
"transactions":[
{
"amount":{
"total":"19.95",
"currency":"USD",
"details":{
"subtotal":"19.95"
}
},
"description":"[product description]"
}
]
}
But on the PayPal approve page I see no any order info. In "Your order summary" section at the left I see no description, no total, no subtotal, nothing.
Screenshot: http://goo.gl/dxoicB
But I expect to see there at lest smth...
How can I make individual items with descriptions in the REST API checkout? Or what I'm doing wrong? It seems I've read the whole Developers Guide, but there is nothing about it.
And another thing: when I done with order, in transaction details also is no any technical info about order.
Screenshot: http://goo.gl/i4iGHZ
There is no technical information allows us to understand what site and what product was sold there.

You have to specify the item_list on transactions to get order summary.
Example request data
{
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://return.url",
"cancel_url": "http://cancel.url"
},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1.00",
"currency": "USD",
"quantity": 1
}]
},
"amount": {
"currency": "USD",
"total": "1.00"
},
"description": "This is the payment description."
}]
}
Refer:
https://developer.paypal.com/webapps/developer/docs/api/#transaction-object
https://github.com/paypal/rest-api-sdk-nodejs/blob/master/samples/payment/create_with_paypal.js#L16

Related

Can I create Quotes without specifying UnitAmount

We are generating Quotes from our application using Xero API. We have created our Line Item in Poducts and Services and added price there.
From the API, we do not wish to send Price again, as this is already in Xero. We wish to send LineItem code and perhaps account (Sell vs Purchase) and let Xero use the price.
Can anyone let us know if there is a way to accomplish this, without having to query Xero for the Products and Services prices to build the Quote?
Thank you for your help.
Request:
{
  "Quotes": [
    {
      "Contact": {
        "ContactID": "a852a44c-3d8f-4c4b-a628-3a2c2121b9b1"
      },
      "LineItems": [
        {
          "ItemCode": "BOOK",
          "Description": "BlaBla",
          "Quantity": 1
        }
      ],
      "Date": "2022-12-20",
      "Reference": "Event Name"
    }
  ]
}
Response (error 400):
{
"ErrorNumber": 10,
"Type": "ValidationException",
"Message": "A validation exception occurred",
"Elements": [
{
"Reference": "Event Name",
"Contact": {
"ContactID": "a852a44c-3d8f-4c4b-a628-3a2c2121b9b1"
},
"LineItems": [
{
"Description": "BlaBla",
"ItemCode": "BOOK",
"Quantity": 1.0
}
],
"Date": "\/Date(1671494400000)\/",
"ValidationErrors": [
{
"Message": "Unit Amount cannot be empty"
}
]
}
]
}

2022: Get LinkedIn Posts via Access Token

I have been looking for an updated version of how to retrieve my own posts from LinkedIn via an access token which I have received from completing a three-legged OAuth process.
I have reviewed: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?view=li-lms-unversioned&tabs=http#permissions- but its now showing as legacy.
As it seems, LinkedIn unfortunately no longer wants us to retrieve this kind of content:
"Find Posts by authors is only supported for organization authors.
Finding by member authors is not supported."
Source
Neither a good, nor a solution within the LinkedIn-TOS (I assume) would be to use a webscraper. I have seen some solutions online but they are all very pricey in my opinion (and you never know if they get shut down by LinkedIn)
{
"activity": "urn:li:activity:12345657",
"content": {
"contentEntities": [
{
"entity": "urn:li:article:0",
"entityLocation": "https://www.example.com/content.html",
"thumbnails": [
{
"imageSpecificContent": {},
"resolvedUrl": "https://www.example.com/image.jpg"
}
]
}
],
"description": "content description",
"title": "Test Share with Content"
},
"created": {
"actor": "urn:li:person:A8xe03Qt10",
"time": 1471967236000
},
"distribution": {
"linkedInDistributionTarget": {}
},
"id": "6173878065928642560",
"lastModified": {
"actor": "urn:li:person:A8xe03Qt10",
"time": 1471967237000
},
"owner": "urn:li:organization:123456789",
"text": {
"text": "Test Share!"
}
}

Zoho Recruit API Register / Login Candidate

Could someone guide me an idea of how to create the registration and login for candidates with the Recruit api? I'm making a flutter app and I need my candidates to register and log in trow the app and see the job opening, post jobs.
At the moment I created the user with [POST] https://recruit.zoho.com/recruit/v2/Candidates
{
"data": [
{
"Email": "mail#gmail.com",
"First_Name": "TheName",
"Last_Name": "TheLastName",
"Mobile": "000000000",
"Expected_Salary": "8000000",
"Country": "PY",
"Departamento": "Central",
"C_I": "37114594",
"Ciudad_de_residencia": "City",
"$Password":"myPassWord199**"
}
],
"trigger": [
"approval",
"workflow",
"blueprint"
]
}
Works Well, got success
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2022-06-15T20:47:23-04:00",
"Modified_By": {
"name": "Admin",
"id": "00000000000000"
},
"Created_Time": "2022-06-15T20:47:23-04:00",
"id": "00000000000000",
"Created_By": {
"name": "Admin",
"id": "00000000000000"
}
},
"message": "record added",
"status": "success"
}
]
}
But If I try to log in in the web version (for testing the new candidate) don't work, but if it see the dashboard, the user exist. Need to add something else?
Basically I need a register api and a login one for the created record of the candidate.
Any help will be awesome, Thanks

Not Found error when charging Square API

The Square REST API docs state that I should get a list of my locations and then use a returned location code when I call the transactions endpoint (to charge a credit card). I am doing exactly this but the returned error says that the merchant has no location with the supplied ID.
I have tried this with and without the location_id in the JSON sent to the transactions endpoint, since it is a path variable. Same result. I have also seen on Square's API FAQ that the usual cause of a 404 not found is the card nonce being created wrong, but this response clearly says the location ID is not valid.
I have tested this with Postman and JSON and I can see that the location code is correct. Here are my calls and the responses:
This is a GET request:
https://connect.squareup.com/v2/locations
And here is the response:
{
"locations": [
{
"id": "FPVPFZ4DXXXXX",
"name": "MyCompany",
"address": {
"address_line_1": "123 Candy Lane",
"address_line_2": "",
"locality": "Smithfield",
"administrative_district_level_1": "RI",
"postal_code": "02917",
"country": "US"
},
"timezone": "America/Los_Angeles",
"capabilities": [
"CREDIT_CARD_PROCESSING"
]
},
{
"id": "4FHNAN1WXXXXX",
"name": "MyCompany2",
"address": {
"address_line_1": "567 Smith Street",
"address_line_2": "",
"locality": "Greenville",
"administrative_district_level_1": "RI",
"postal_code": "02828-2910",
"country": "US"
},
"timezone": "America/Los_Angeles",
"capabilities": [
"CREDIT_CARD_PROCESSING"
]
}
]
}
I modified the returned IDs a bit in the above example.
Next I make a call to charge a card to this uri:
https://connect.squareup.com/v2/locations/FPVPFZ4DXXXXX/transactions
With this body:
{
"note":"",
"idempotency_key":"azsxdcfvrtrewsdf",
"location_id":"FPVPFZ4DXXXXX",
"shipping_address":{
"address_line_1":"123 My Street",
"address_line_2":null,
"locality":"Greenville",
"administrative_district_level_1":"RI",
"postal_code":"02828",
"country":"US"
},
"billing_address":{
"address_line_1":"123 My Street",
"address_line_2":null,
"locality":"Greenville",
"administrative_district_level_1":"RI",
"postal_code":"02828",
"country":"US"
},
"card_nonce":"CBASEPPW7fjdUHe-3jP6ZZ4kvE0gAQ",
"reference_id":"RT-12345678",
"amount_money":{
"amount":12500,
"currency":"USD"
},
"delay_capture":true,
"buyer_email_address":"jim#xxxxxxxxxx.net",
"customer_id":"JIM"
}
And I get this response:
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "NOT_FOUND",
"detail": "This merchant does not have a location with the ID `FPVPFZ4DXXXXX`.",
"field": "location_id"
}
]
}
So the location ID matches exactly the ID returned by the locations endpoint.
Can someone familiar with this API help me out? Square's docs and support is sadly lacking.
I think the issue here is that you have tried to use your sandbox credentials (sandbox-sq0idp-defoUOlu...) to charge against your production location FPVPFZXXXXX. If you call ListLocations with your sandbox credentials, you should get a different location that you can then do sandbox charges with.

Send small amounts to PayPal API

I'm using the PayPal API to handle payments on my website. A product has the following prices :
exclusive of tax : 0.083€
vat rate : 20%
all taxes included : 0.10€
In the API, we have to send the items of an order with the exclusive of tax unit price and the vat rate.
Here is my request :
{
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"transactions": [
{
"amount": {
"currency": "EUR",
"total": "99.60",
"details": {
"subtotal": "83.00",
"tax": "16.60"
}
},
"item_list": {
"items": [
{
"quantity": "1000",
"name": "My product",
"price": "0.08",
"currency": "EUR",
"sku": "1-20140407123511492"
}
]
}
}
]
}
As you can see, since PayPal accepts only prices with a maximum of 2 decimals, there is an error in the final calculation (0.003€ multiplied by the quantity).
In the end, I have the following error :
{"name":"VALIDATION_ERROR","details":[{"field":"transactions","issue":"Item amount must add up to specified amount subtotal (or total if amount details not specified)"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"132eaa3f14cce"}
So, how can we handle small prices with the PayPal API ?
Thanks.