We are using AIM module for our website. In first call we are using AUTH_ONLY. If everything is okay then we are using PRIOR_AUTH_CAPTURE to capture the amount. The Problem here is we need to update the Invoice number in the second call (PRIOR_AUTH_CAPTURE). How can we achieve this ? because "priorAuthCapture" method accepts only transaction id and amount as parameters.
Is there any other function is there in Authorize.net AIM to update the Invoice number after the payments successful ?
$transaction->invoice_num = $generatedInvoiceID;
Such functionality does not exist. The AUTH_ONLY essentially is the transaction. The PRIOR_AUTH_CAPTURE just completes it by officially stating you wish to capture those funds. But the details already presented during the AUTH_ONLY cannot be changed.
In Cybersource if you enter a default value of 0 with prior auth capture, it will capture the original amount of the transaction. Change 0 to the actual dollar amount if you want to capture less than the original amount. If you wish to capture more than the original amount you will need to complete a new authorization or new authorization and capture.
Related
I have a table called 'Alunos' and one column called 'Presente' and it's a boolean value, which is set 'true'. And if a student didn't attend class, it changes to 'false'.
I need to know, how to make this value return 'true' automatically when changed the day.
Example: today is 9/10/19 and the value of the column is false. When it changes the day - 10/10/19 - it should return true. (its initial value)
How could I do that? Any tips?
Also, after doing that, I want to create a report or dashboard about this data, a monthly report for example. Do you have any tip for it as well?
Hope I made me clear.
Thanks
You should not change any existring value.
Here is what you should do.
Create 1 entry for everyday, with default value set to true or false.
Change the value based on user attendance.
Use enum instead of true/false.
This will make sure
You can see past trend.
you can have complex pattern like if holiday have new value than true and false.
If you are adamant on using single value per user, have a lambda function triggered by cloudwatch event everyday, which resets the value. But it will cause significant number of write everyday, instead of doing that you can check if value is expired and update only if expired.
this can solve your problem:
Time to Live (TTL) for Amazon DynamoDB lets you define when items in a table expire so that they can be automatically deleted from the database. TTL is provided at no extra cost as a way to reduce storage usage and reduce the cost of storing irrelevant data without using provisioned throughput.
and here is an example to set up TTL
I am using facebook graph api where I periodically call: https://graph.facebook.com/cnn/posts?access_token=accesstoken
I don't want to get repeat posts the second time I make the call so I would like to filter the call to get anything after either a certain post Id or after a created_time. Is this possible?
I have tried using date_range= but it did not work plus it only allowed me to search by date but not time.
Use timebased paging: https://developers.facebook.com/docs/graph-api/using-graph-api/#paging
The correct parameter would be since and until. Just store the timestamp of the last post and use it in your next call.
I am looking to hide specific field from a content type for a particular period of time to authenticated user in drupal 8.
For example - From article content type , body field should be visible after a specific date for authenticated user.
There is a module called scheduler that publish the node for particular period of time. I believe that there is no module that would do the same for the special field (at least I am not aware of it).
The simplest solution that I can think of is that you create two date fields for a selected content type (start and end date) or use one date range field. Than in twig template use the if statement that would check if current date is bigger than start date and lower than end date. I suggest using timestamp format to avoid any unexpected results. Inside the if statement put the code that render field/field value and you will get the expected result.
I have a sample loan usecase, where I have two states:
Invoice State, and
Loan State.
Loan State is created by passing Invoice State as input.
Now as Corda follows UTXO model, when I do the default vault query, the Invoice state is not showed as it's consumed now.
To solve this, there are two possible ways:
Either, I query on all states i.e consumed and unconsumed.
Or, I
can maintain a status at Invoice state and mark the status to
something as Invoice paid after consuming it to create Loan State (So this is more like evolving state, something like bitcoin where balance is always getting transferred.).
Something like this:
Can anybody please recommend what would be the correct architecture decision?
Your Invoice should have a 'state' field with and enum of at least 'UNPAID' and 'PAID'
Your 'payInvoice' command should have the following inputs and outputs:
inputs:
Invoice - state=UNPAID
outputs
Invoice - state=PAID
Loan
The verify function should check that the inputs and outputs for this command are as above.
After which the 'UNPAID' invoice state is spent and cannot be used again.
I hope that makes sense.
Check out the 'MeteringInvoiceCommands.Pay' method in the following code. This is similar to what you need, but in this case, it is checking that a payment is produced as well as the input state is 'ISSUED' and output state is 'PAID'
https://gitlab.com/cordite/cordite/blob/master/cordapps/metering-contracts-states/src/main/kotlin/io/cordite/metering/contract/MeteringInvoiceContract.kt
I agree with bartman250. The second example makes the most sense in my view as it keeps options open in a more obvious way.
Let's say for example, for some reason the invoice needs to be reset to unpaid because there is a chargeback on a credit card, having the invoice as unconsumed works well.
The issue of worrying about it being consumed again can be handled by ensuring that the loan contract only consumes invoices that are marked as unpaid. We do something very similar with a purchase order in the letter of credit demo found here.
Having the invoice available to be queried from the vault as unconsumed is also the default query mode. It also provides the advantage of ensuring we're dealing with the latest version of the state by default.
The second example above is the best in my view.
Basically, if you hold an Enum on the Invoice with all the different states - i.e. UNPAID, PAID, REJECTED etc. You can then evolve this state in your flows.
You can then use the contract verify function for the 'paid command to check that a loan state has been created.
I'm currently building a staffing CRM in Oracle Apex for my company and we have a lead generation form that allows recruiters to add any sales leads.
Once a recruiter adds a lead the page sends an email to the assigned sales person.
Now here's my issue, I need to get APEX.MAIL to ignore any null email address fields on the form page since management wants to be able to assign up to 3 sales people to receive that lead, though they may only assign 1 or 2.
How can I make APEX.MAIL ignore the page item for the sales email if the field is null.
Right now the "To" line is p_to=> :P3_SALESMAN
How I want it to look is p_to=> :P3_SALESMAN, :P3_SALESMAN2, :P3_SALESMAN,3,
But if :P3_SALESMAN2 or :P3_SALESMAN3 are null, I want APEX.MAIL to ignore them.
Or would that even cause a problem is the field is null?
You don't indicate how you are calling APEX.MAIL...
Since APEX.MAIL is a PLSQL pkg, one suggestion is to write a wrapper PLSQL pkg that will look at the parameters you pass in (P3_SALESMAN1.2,3...) and use If Else logic to evaluate the fields as null or not and then determine whether to call the APEX.MAIL pkg.
Writing in-line PLSQL in APEX quickly becomes a maintenance and reusability headache, so you should think about always using a PLSQL stored Proc/Func to encapsulate your logic and call it from the page.
Like Joe mentioned, using stored procedure is better than writing in-line pl/sql, which I learnt the hard way.
About building the list of email addresses, I can't think of another way, but to use if-else condition, and adding email addresses to a string, if they exist and passing the final string to p_to in APEX_MAIL.