Can we enable Save Card option with Pay By Link [POST] method - global-payments-api

I'm working on Global Payments system and trying to achieve Pay By Link http post method to generate the link and share with customer to pay at their convenient time. In the sandbox url below request body is working fine.
{
"SHA1HASH": "606ab12bb09f5e68b1d72ce26622650d485583fd",
"TIMESTAMP": "20210612042252",
"MERCHANT_ID": "somehotel",
"ACCOUNT": "internet",
"ORDER_ID": "5ef1c1ce6da546069998744bdce3d8c9",
"AMOUNT": "2000",
"CURRENCY": "EUR",
"AUTO_SETTLE_FLAG": "1",
"COMMENT1": "Email Channel",
"HPP_VERSION": "2",
"HPP_LANG": "en",
"HPP_CUSTOMER_EMAIL": "somebody#gmail.com",
"HPP_CUSTOMER_PHONENUMBER_MOBILE": "91|9999999999",
"HPP_BILLING_STREET1": "Flat 123",
"HPP_BILLING_STREET2": "House 456",
"HPP_BILLING_STREET3": "Unit 4",
"HPP_BILLING_CITY": "Halifax",
"HPP_BILLING_POSTALCODE": "W5 9HR",
"HPP_BILLING_COUNTRY": "826",
"HPP_SHIPPING_STREET1": "Apartment 852",
"HPP_SHIPPING_STREET2": "Complex 741",
"HPP_SHIPPING_STREET3": "House 963",
"HPP_SHIPPING_CITY": "Chicago",
"HPP_SHIPPING_STATE": "IL",
"HPP_SHIPPING_POSTALCODE": "50001",
"HPP_SHIPPING_COUNTRY": "840",
"HPP_ADDRESS_MATCH_INDICATOR": "FALSE",
"HPP_CHALLENGE_REQUEST_INDICATOR": "NO_PREFERENCE",
"BILLING_CODE": "59|123",
"BILLING_CO": "GB",
"SHIPPING_CODE": "50001|Apartment 852",
"SHIPPING_CO": "US",
"CUST_NUM": "6e027928-c477-4689-a45f-4e138a1f208a",
"VAR_REF": "Acme Corporation",
"PROD_ID": "SKU1000054",
"MERCHANT_RESPONSE_URL": "https://www.example.com/responseUrl",
"SUPPLEMENTARY_DATA": "Custom Value"
}
Is there a way to enable Save Card option. I tried providing the below flags as seen on another payment reference, but the response started giving hash error.
Request Body included below
"CARD_STORAGE_ENABLE": "1",
"OFFER_SAVE_CARD": "1",
"PAYER_EXIST": "0",
"PAYER_REF": "376a2598-412d-4805-9f47-c177d5605853",
"PMT_REF": "ca46344d-4292-47dc-9ced-e8a42ce66977",
And the response from server
{
"resultCode":508,
"internalErrorCode":61000,
"errorMessage":"Incorrect hash. Please check your code and the Developers Documentation."
}
Is this a restriction by purpose or are we passing wrong flags? Please help!

These are the two sections from the developer portal describing how to generate the hash:
Card Payments: https://developer.globalpay.com/hpp/card-payments#generate-hash
Card Storage: https://developer.globalpay.com/hpp/card-storage#generate-hash

Related

BigCommerce Orders API: unable to update

I'm trying to update an existing order in the store using PUT requests to the V2 orders API:
https://api.bigcommerce.com/stores/{$$.env.store_hash}/v2/orders/{id}
According to the docs, I should be able to update the following:
customer_id, status_id, Add a new product, Add a custom product, billing_address
The only thing I have success changing is the status_id. I can use the example body provided at the bottom of the documentation page:
{
"status_id": 1,
"billing_address": {
"first_name": "Trisha",
"last_name": "McLaughlin",
"company": "",
"street_1": "123 Main Street",
"street_2": "",
"city": "Anywhere",
"state": "Some State",
"zip": "12345",
"country": "United States",
"country_iso2": "US",
"phone": "",
"email": "elsie#example.com"
}
}
I get a 200 OK response with no body. But in the store only the status changes. If I intentionally misspell a field, then I get an error response, which suggests to me that the body is correctly formatted, but ignored.
Can anyone provide an example of a body that updates billing address or adds a new product which the API will act on?
I'm generating the PUT requests with Postman currently, but will move to PHP later.
Thanks.
Edit:
This is an example of a request I tried for adding an existing product, also accepted but doesn't work.
{
"products": [{
"product_id": 111,
"quantity": 5
}]
}
Edit 2: To provide more context, the orders I'm trying to update already have existing products and have been 'paid for' (the products are free). I've tried adding products that are already in the order as well as new ones. I've tried this on orders with various status as well. Also, the orders are processed by guest accounts, so the customer_id field is 0. I have not tried doing this with a registered account order. Could any of these things be causing the issue?
Edit 3: For anyone else wandering by, this appears to be a bug that is associated with downloadable products. Please see the comment chain under the accepted answer for details.
Add a new product:
{
"products": [{
"name": "Poster",
"quantity": 5,
"price_inc_tax": 12.45,
"price_ex_tax": 10.12
}]
}
Add an existing product: Make sure to update the product_id to one that is in the store.
{
"products": [{
"product_id": 187,
"quantity": 5,
"price_inc_tax": 12.45,
"price_ex_tax": 10.12
}]
}
It will return a 200. Then query the Order Products to see a list of products on the order.
To update a billing address this structure works:
{
"billing_address": {
"first_name": "Jane",
"last_name": "Doe",
"company": "",
"street_1": "455 Main Street",
"street_2": "",
"city": "Austin",
"state": "Texas",
"zip": "78751",
"country": "United States",
"country_iso2": "US",
"phone": "",
"email": "rick#sanchez.com"
}
}
Customer id needs to match a customer id that exists in the store. To get a list of customers use the customers endpoint.
{
"customer_id": 20
}
According to this page:
https://developer.bigcommerce.com/api-reference/b3A6MzU5MDQ3MzE-update-an-order
it states:
"The status will include one of the (string, options) - values defined under Order Statuses. This value is read-only. Do not attempt to modify or set this value in a POST or PUT operation."
It appears you cannot update the order status from the api...

Branch.io event logging

I am following the below link for logging ecommerce event in branch.io
https://github.com/BranchMetrics/branch-deep-linking-public-api#logging-commerce-events
I am using the same request as mentioned in the link.
but the details are not getting captured in branch.io dashboard.
I am getting "branch_view_enabled": false as a response.
Please help me out if there is any issue in settings ? or explicitly I will have to do something for seeing the events in the dashboard.
A response will be highly appreciated!
I tried it like this
new BranchEvent("Event Name")
.addCustomDataProperty("Key", "Value")
.logEvent(this);
And it shows the event name on the branch dashboard under summary. And my log shows that internally it was targeting the v2. I am sending it through android
https://api.branch.io/v2/event/custom
This is Jackie from Branch.
We are not yet supporting v2/events for commerce yet which is why you weren't able to track it on the dashboard.
Moving forward, please use v1 event request following our official documentation here. I've also included a sample commerce request for your information. In the meantime, we will update the commerce information on our github page so as not to cause any confusion.
curl -X POST https://api.branch.io/v1/event \
-d '{
"branch_key": "your_Branch_key",
"identity": "222",
"event": "purchase",
"metadata": {
"hello": "world",
"custom_data": "this"
},
"commerce_data": {
"revenue": 50.0,
"currency": "USD",
"transaction_id": "foo-transaction-id",
"shipping": 0.0,
"tax": 5.0,
"affiliation": "foo-affiliation",
"products": [
{
"sku": "foo-sku-1",
"name": "foo-item-1",
"price": 45.00,
"quantity": 1,
"brand": "foo-brand",
"category": "Electronics",
"variant": "foo-variant-1"
},
{
"sku": "foo-sku-2",
"price": 2.50,
"quantity": 2
}
]
}
}'
Hope this helps. Please feel free to contact us directly if you have any other questions or issues at support#branch.io.
Best,
Jackie

HERE Places API: not all items have PVID

I'm using HERE Places API.
Firstly I'm doing a search.
For Example this query :
https://places.cit.api.here.com/places/v1/discover/search?q=Test&at=35.6111,-97.5467&r=500&size=1&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid&pretty
According to this documentation (Link) If I add show_refs=pvid to query string, in result I will get external id which I can use to query lookup endpoint.
But in result I get next response :
{
"results": {
"next": "https://places.cit.api.here.com/places/v1/discover/search;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmb2Zmc2V0PTEmc2l6ZT0x?at=35.6111%2C-97.5467&q=Test&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"items": [
{
"position": [
35.60369,
-97.51761
],
"distance": 2756,
"title": "Southwest Test & Balance",
"averageRating": 0,
"category": {
"id": "business-services",
"title": "Business & Services",
"href": "https://places.cit.api.here.com/places/v1/categories/places/business-services?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.cit.data.here.com/p/d/places2_stg/icons/categories/02.icon",
"vicinity": "200 NW 132nd St<br/>Oklahoma City, OK 73114",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"id": "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
"authoritative": true
}
]
},
"search": {
"context": {
"location": {
"position": [
35.6111,
-97.5467
],
"address": {
"text": "Oklahoma City, OK 73134<br/>USA",
"postalCode": "73134",
"city": "Oklahoma City",
"county": "Oklahoma",
"stateCode": "OK",
"country": "United States",
"countryCode": "USA"
}
},
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/loc-dmVyc2lvbj0xO3RpdGxlPU9rbGFob21hK0NpdHk7bGF0PTM1LjYxMTE7bG9uPS05Ny41NDY3O2NpdHk9T2tsYWhvbWErQ2l0eTtwb3N0YWxDb2RlPTczMTM0O2NvdW50cnk9VVNBO3N0YXRlQ29kZT1PSztjb3VudHk9T2tsYWhvbWE7Y2F0ZWdvcnlJZD1jaXR5LXRvd24tdmlsbGFnZTtzb3VyY2VTeXN0ZW09aW50ZXJuYWw;context=c2VhcmNoQ29udGV4dD0x?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg"
}
}
}
In response no object references
Is it a bug or not every place has this external id?
I am responding as member of the team around HERE Places API.
Yes, not every place has a pvid. That is why I would suggest using the Sharing Id instead. I realize that the documentation should be improved to clarify that.
The Sharing Ids can be obtained by adding show_refs=sharing to either your search query or a place details request. It can be found in the field references. Once you have the sharing id you can you the lookup endpoint as you intended.
Take a look at:
https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
and
https://places.cit.api.here.com/places/v1/places/8409q8yy-6af3c3e50bcb4f859686797b2be5773d;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
On those two examples, the only difference is the placeId.
In the docs, there's not a single reference saying that the external identifier is required or existant for every place.
Since it represents an external identifier, I believe we could assume that it's not required.
And it's what we just saw with your place (8403fv6k-d1b2fde0616e0326e321a54b88cd9f53): this one don't have any external identifier.
Based on your comments, what you need is the information about a place.
So, after you run your first query, you should get something like:
{
title: "Southwest Test & Balance",
position: [],
id: "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
href: "https://[...]"
}
With this ID, you could access it:
places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD0zYTFlZjg5ZS02ZTY5LTUxYmEtYWFkYS1kY2UwZWMyNDdkMDBfMTUwNzEzNjUxNjI5N182NjExXzc2OTgmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
Or directly using the href information.
This response already is giving you the ID and URL to access all the info of a single place.
You don't need any other external ID or reference.

BigCommerce API - Undefined Resource Property - Banners :: item_id

I am working with the BigCommerce API for the Banners resource, but I do not know the usage/definition for one of the properties - specifically: item_id
The usage documentation shows the following as the JSON response:
{
"id": "1",
"name": "Grand Closing Sale",
"page": "home_page",
"content": "Thanks for shopping with us.",
"date_to": "1393218000",
"item_id": "0",
"visible": "0",
"location": "top",
"date_from": "1391576400",
"date_type": "custom",
"date_created": "1392073898"
},
The property documentation however makes no reference to item_id (and also has other various typos and unlinked properties).
What is item_id?
Is it maybe supposed to be catorbrandid, which says "ID for the brand or category."
Thanks in advance!

How can I get a list of all the projects in our Rally instance via the REST API?

How can I query our Rally instance for all of our available projects?
Output from REST call https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Name,Projects&pretty=true
...
"Workspaces": [
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1376977801.js",
"_objectVersion": "10",
"_refObjectName": "Workspace 1",
"Name": "Workspace 1",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1462743357.js",
"_objectVersion": "8",
"_refObjectName": "Bugzilla Workspace",
"Name": "Bugzilla Workspace",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
...
Update #2
The user account being used for the API calls is indeed a subscription admin. I tried a few things with our admin to try and narrow down the problem as to what is occurring and noted a few things:
The projects that are getting returned in the call, are not projects that the api user is a team member of
When we assigned a story to the api user and refreshed the result of the REST call, the projects that were returned in every workspace were identical and seemed to be all of the projects from the given workspace of the project that we assigned the story from. For example, I've pasted the top part of a return: http://khayes.privatepaste.com/cfc730dcf8
It appears this particular REST call has a bug in it.
This should be possible by querying on type 'Subscription'. Make sure you include Workspaces and Projects (and any other data you might want like Name) in your Fetch.
https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true
The results should look something like this:
{
_ref: "/subscription/1.js",
_refObjectName: "My Subscription",
Workspaces: [
_ref: "/workspace/2.js"
_refObjectName: "My Workspace",
Projects: [
{
_ref: "/project/3.js"
_refObjectName: "Project 1"
}
]
]
}
The REST URL would look like this
https://rally1.rallydev.com/slm/webservice/1.29/subscription?fetch=Workspaces,Name,Projects
I tried in postman with basic authentication: username and password of rally:
All APIs are inter related : let us see step by step and always notice the _ref in your response.
Step 1: First you want the subscription.
https://rally1.rallydev.com/slm/webservice/v2.0/subscription?fetch=Workspaces,Name,Projects
It will return subscription ID suppose it is X.
Step 2: Find the workspaces in that subscription. Put X value as subscription shown below.
https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/X/Workspaces
It will return the workspace id. Let us say it Y.
Step 3: Find the projects in the workspace.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/Y/Projects?fetch=ObjectID
There will be URLs in the response which refers to your projects associated to your workspace.
OR,
if you know your workspace ID then use below api: your_WS_id= your workspace ID in below request. just replace this.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/your_WS_ID/Projects?fetch=Name
I hope it helps.