Payflow Pro get the list of transaction made by customer - payflowpro

I need to get the list of transaction made for the customer. It should include both settled and unsettled transaction. I am having the following parameters such as reference transaction ID, name, email. Is there possibility to achieve it?

Related

How to write to a document and read the id of it within a single transaction in Firestore?

I am doing the user authentication where I have this case:
Read from vendor_type document and if it returns null(doesn't exist) then continue the transaction,
Create new user using .auth().createUserWithEmailAndPassword(email,password),
Read the new users ID,
Write to vendor_type document some of the new user's detail such as name, surname, userId -->> userId is the problem, how can I create a user and get the ID within a single transaction, can I even do that? ,
Take the newly created ID of the user, and create a new vendor document with that ID.
So far I don't have any code to post because I don't know if this is even gonna work so I didn't start. If you have any idea how to implement this, please let me know. The main issue is getting the user ID while still in the transaction.
At the time of writing, it is not possible to combine in one transaction the creation of a user through the createUserWithEmailAndPassword() method from the Auth service AND a write to the Firestore service.
They are two different services offered by Firestore and therefore you cannot combined calls to these two different services in one transaction.

How to trigger a cloud function when a date stored in a firestore doc property arrives

I'm building a multisided app where people can sell and buy food. Thats the shortest summarize possible.
When an user make a food order to a restaurant and this order has been marked as dispatched, the app generates a comission on the restaurant profile in firestore.
When the commission is created it triggers a background firebase cloud function that check if the restaurant has an active billing cycle, if not, it creates one like this:
billingCycle: {
openDate: 'the moment where the fee was created',
endDate: '4th day after' //
}
This object its created in the user profile (with correct date) and works ok!
Now I want to emit an invoice when the date of the endDate prop value arrives, here comes the question.
How can I trigger a function when the date of the endDate meet?
I was thinking in moving that decition to the app. That way the app detects when its time to trigger while is using it, but what if the user is not?
How can I trigger the firebase cloud function for emit the invoice independent the interaction of the user with the client app?
I've researched a lot to find an answer but I didn't find anything related so any kind of help is so much appreciated.
*This is the first time Im using FCF.
You can use an onUpdate trigger on documents that may get updated that way. Write code in the function that checks, on every update, if the dates match in the document. If the dates match, emit the invoice, then update the document again with a flag value that indicates the invoice is emitted.
You will also have to use that new flag to determine not to emit the invoice again on further updates (otherwise your function will send an invoice every time it's updated, when the dates match - this boolean will indicate that it already happened).

How to store only node specific off-ledger custom data in corda?

I created custom table in corda using QueryableState. e.g. IOUStates table.
I can able to see the custom information getting stored in this kind of table.
but i observed that if party A and Party B is doing the transaction then this
custom information gets stored at both the places , e.g. IOUStates
table getting created at nodeA ledger as well as nodeB's ledger.
and custom information is stored in partyA's and PartyB's ledger.
My Question is :-
If some Transaction is getting processed from PartyA's node , then
I want to store part of the transaction's data i.e. custom data ONLY at partyA's Ledger.* level . i.e. off-Ledger of partA only.
It should not be shared with partyB.
In simple case , how to store Only node specific off ledger custom data ?
Awaiting for some reply...
Thanks.
There's a number of ways to achieve this:
Don't use Corda at all! If the data is truly off-ledger then why are you using Corda? Instead, store it in a separate database. Of course you can "JOIN" it with on-ledger data if required, as the on-ledger data is stored in a SQL database.
Similar to point one except you can use the jdbcSession() functionality of the ServiceHub to create a custom table in the node's database. This table can easily be accessed from within your flows.
Create a ContractState object that only has one participant: the node that wants to store the data. I call this a "unilateral" state, i.e. a state that only one party ever stores.
Most importantly, if you don't want to share some data with a counter-party then it should never be disclosed inside a corda state object or attachment that another party might see. Instead:
inside your flows, you can use the data encapsulated within the shared state object (e.g. the IOU) to derive the private data
alternatively if the data is supplied when the flow begins then store the private data locally using one of the methods above

How to fetch email marketing insights data from Marketo using API?

I am trying to fetch "Email Performance Report" from the platform
using API to analyze the KPI's like CTR etc by type of the email
(newsletter,email marketing etc).
I went through the documentation, however I didn't find endpoint from
which I can fetch the same.
Does anyone know if there is a way to get this information?
There is no endpoint to query reports directly. However, the good news is, that the “things” that make up an “Email Performance Report”, namely: email delivery, bounce, open and click are available to query via the API.
This means that you have to build the report yourself, but you can fetch the dataset to work on.
These “things” are called activity types (activity measured on a Lead) and can be fetched by querying against the Get Lead Activities endpoint, which is also mentioned as the Query in the API docs.
It sits at the GET /rest/v1/activities.json url and you have to pass a nextPageToken and the activityTypeIds as query parameters.
The nextPageToken indicates a datetime. Activities after that date will be returned by the call. To obtain one, you have to make a call to GET /rest/v1/activities/pagingtoken.json, where you have to specify the earliest datetime to retrieve activities from. See more about Paging Tokens.
To figure out the value of activityTypeIds, you first need to get the internal Ids of the activity types you are interested in. In order to do so, you have to query the GET /rest/v1/activities/types.json endpoint and look for the activity types with names like Send Email, Email Delivered, Email Bounced, Unsubscribe Email, Open Email and Click Email. (I don't know if these Ids are changing from instance to instance, but in ours these are from #6 to #11).
Once you have all of these bits at hand, you can make your request like that:
GET https://<INSTANCE_ID>.mktorest.com/rest/v1/activities.json?activityTypeIds=<TYPE_ID>&nextPageToken=<NEXTPAGE_TOKEN>&access_token=<ACCESS_TOKEN>
The result it gives is an array with items like below. Items can be filtered to specific email based on the primaryAttributeValue property and processed further accordingly.
{
"id":7370416,
"marketoGUID":"7170506",
"leadId":291305,
"activityDate":"2017-12-17T00:00:00Z",
"activityTypeId":11,// #11 = `Click Email`
"campaignId":1790,
"primaryAttributeValueId":1638,
"primaryAttributeValue":"EMAIL_NAME",// Name of the Email as seen in Marketo
"attributes":[
// …
]
}

Cancel transaction in Google analytics (add negative transaction)

I have a transaction with very big revenue. I'd like to delete this transaction, using this link: https://support.google.com/analytics/answer/1037443?hl=ru
But I can't understand, what data import type I should choose and And what variables should be passed.
We are going to use Google Analytics hit builder for this purpose.
Follow the steps:
Step 1: You need to have edit permission for the GA property you are trying to do this.
Step 2: Gather transaction data of that particular transaction including shipping and tax.
Step 3: Navigate to hit builder - https://ga-dev-tools.appspot.com/hit-builder
Step 4: Authorize it with your email.
Step 5: Create negative transaction in hit builder.
As you are already having a transaction, you need to apply negative values of the transaction with the same transaction ID.
v=1 // Version.
&tid=xxxxxx // Add your tracking ID here
&t=transaction // Transaction as hit type
&ti=xxxxx // Transaction ID
&tr=-xxx // Negative transaction revenue
&ts=-xx //Negative transaction Shipping
&tt=-xx //Negative transaction tax
&cu=XXX //Currency code
You can use any string as client ID.
Fill up the values by adding parameters and your hit will look something like this.
Once this is filled up, click on 'Validate Hit'
If the hit is validated, click on 'Send to Google Analytics'
Note: It will take some time for data to show up.
I have used this on a test account where I had added the transaction using hit builder, never really faced any situation where I need to do it on live. Let me know if this works.

Resources