My web developer is struggling to integrate SagePay into my Wordpress website - opayo

I have 3 questions as of now, please consider and reply point wise, thank you..
I understand the use of Encryption Password (56071ba432970392) and i'm using it to construct the "crypt" field.
But please let me know if the "Encryption key" and "Integration Password" are necessary in the "Form method", as i do not see it's reference in the Form integration protocol guide (https://www.sagepay.co.uk/file/25041/download-document/FORM_Integration_and_Protocol_Guidelines_270815.pdf?token=xecgCPxo3AAFu8UiqobWCsfHOZwMz44crX7lYbBHdvM)
2. In the above guide, in page no. 10 / annex. 3.0 / Step 2 > There are 4 hidden fields to be sent to sagepay in url and below is the exact data which is sent but with 5080 error code.
include("lib/sagepay.php");
$key = '56071ba432970392';
$paymentString = "VendorTxCode=abc123&Amount=$amount&Currency=GBP&Description=$description&BillingSurname=$lname&BillingFirstnames=$fname&BillingAddress1=$address&BillingCity=$city&BillingPostCode=$zip&BillingCountry=$country&DeliverySurname=$lname&DeliveryFirstnames=$fname&DeliveryAddress1=$address&DeliveryCity=$city&DeliveryPinCode=$zip&DeliveryCountry=$country&SuccessURL=https://www.life-changing-adventures.com/success&FailureURL=https://www.life-changing-adventures.com/failure";
<input type="hidden" name="VPSProtocol" value="3.00">
<input type="hidden" name="TxType" value="PAYMENT">
<input type="hidden" name="Vendor" value="lifechangingadv">
<input type="hidden" name="Crypt" value='<?php echo SagepayUtil::encryptAes($paymentString, $key); ?>'>
------------------------------
In the sagepay online support page (https://www.sagepay.co.uk/support/error-codes/5080-error-form-transaction-registration-failed)
for 5080 error, it says "You will need to log into your Sage pay account. Once you have logged in select the transactions tab, and then the Invaild sub screen from the options on the left."
But as attached, the "invalid" tab screen is empty from the start, so i cannot figure out the reason.

The encryption key is accessed via your MySagePay admin user (uses the same username as your vendorname).
5080 error - https://www.opayo.co.uk/support/error-codes?keyword=5080
If your encryption is not being done as expected you will receive this error. If you are encrypting correctly you will reach the Opayo payment process. The invalid tab only populates when you have done this and have then passed an invalid character in a field for example.

Related

Laravel 9 : Date data null or not

I'm here to ask you a question for my Laravel 9 project if it's possible please :) !
I made an authentication with a user table. There is a column where you can check if the user verified his/her email or not. If he/she does, there is a datetime. If not, the column is null.
I would like to make a div in the profile section where there is an information for the user about the verification. If the verification is done, green information with the message "Good your email is verified", if not there is a red information with "Email not verified".
I tried this but it doesn't work, it stays on "NOT VERIFIED" however there is a datetime in this session user.
Do you know why ? Or how can I fix it ?
Thanks a lot !
Code
Data structure
#if(Auth()->user()->isVerified)
<div style="color:green">Good email is verified</div>
#else
<div style="color:red">Email not verified</div>
#endif
Please try using this
{{ auth()->user()->isVerified == null ? 'Not Verified' : 'Verified' }}
Try following
#if(Auth::check())
#if(Auth()->user()->isVerified)
<div style='color:green'>Good your email is verified</div>
#else
<div style='color:red'>Email not verified</div>
#endif
#endif
In Laravel there is a default method to determine if an email is verified or not. isVerified field is not necessary to check it.
checkout this answer Laravel check if user email verified

Verifying the presence of an option in a list?

I'm writing automated tests using Cucumber and SitePrism. One test adds a user role to a list, and I'm having trouble verifying the presence of the role (to verify it's successfully assigned) in the final steps.
The gherkin is...
Scenario: Assigning roles to a user
Given I have reached the user edit view in the admin
When I click the Assign Roles tab
And select the first value in the Add Role dropdown
And click Add role
Then I should receive the message of save successful
And the role should be present in the current role list
...With And the role should be present in the current role list being the step I'm having trouble with. After the And click Add role step executes, the HTML for the list appears as such...
<dd>
<select id="current-role-a02322d1-8add-4234-aeca-02d3fca2a239" class="current-role" name="role_id" multiple="multiple">
<option title="System Administrator Role" value="1">Administrator</option>
</select>
</dd>
This one I'm stuck on. What do I set the element as on the page model, and what do I write in my step definitions to verify the presence of <option title="System Administrator Role" value="1">Administrator</option> and make the step fail if it's not present? I would prefer to be checking for value="1" instead of the title or text.
Thank you in advance for the help!
Define a method on your page model that will extract the value that you are trying to assert. This method will contain the element definition and then .text or .value at the end of your element definition. Here you can use value = "1" or title.
In your step definition, call the method and assert that the returned value is equal to "Administrator".

BlogEngine.net Comments Remove Email Requirement

I can't see the point of making an email address mandatory for people posting comments when they can make up a dummy address. How do I remove it?
The /User controls/CommentView.ascx user control is responsible for validating comments. If you remove the following line it will no longer be required.
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail" ErrorMessage="<%$Resources:labels, required %>" Display="dynamic" ValidationGroup="AddComment" />
I would recommend you verify with whatever backend you are using that leaving that value out will not break any other functionality. One thing I know relies on the email address is the gravatar code so you should probably check it as well.
This is a really interesting and informative post. Good job! keep it up, hope to read your other updates. Thanks for this nice sharing
taxi in doha
taxi in doha qatar

How do I implement Post-redirect-get on Google App Engine with Python?

I am developing an online bidding system on Google App Engine with Python. Regarding the post-redirect-get mechanism, I've been googling a while and still have no clear idea of how to implement it. Suppose:
HTML:
<form action="/test" method="post">
...
<input type="submit" value="Submit" />
</form>
Python:
# Collect data from the posted form
...
# Save data into datastore
...
# Prepare template values
tempalteValues = { ... }
path = os.path.join(os.path.dirname(__file__), 'templates/', 'responseMessage.html')
handler.response.out.write(template.render(path, templateValues))
# Then what?
I have two questions:
1) After rendering the response message file, what should I do next? That is, how to implement the 'GET'?
2) Another strategy I can think of is: If the post is supposed to happen only once (e.g., product purchasing with a unique order number), can I set a flag in the entity indicating that the form has been submitted and the following posts will be ignored if the flag is set? Is this feasible or even correct?
(Note: because the order number is generated by the system, the entity has to be saved before the form submission in order to get that number)
Thanks in advance.
What you are looking for is building a Restful service something like this:
class BiddingHandler(webapp2.RequestHandler):
def get(self):
#Get code goes here for this handler
def post(self):
#code that gets your posted data and processes it
def delete(self):
#code to delete something
app = webapp2.WSGIApplication([('/bidding', BiddingHandler)])
Looking at the above if you wanted to do a redirect after making a post in the last line of your post instead of rendering a template you would simply redirect the user to the get part of the handler with the following line:
self.response.redirect('/bidding')
What I have shown you above is the correct way to implement it. Writing to the datastore and reading from it for every request would mean more overhead and costs.

Magento contact form customizations

I'm trying to add a couple fields to the contact form so that my customers can indicate the year make and model of their vehicle when writing.
I have just upgraded my Magento installation from 1.4.3 to 1.7.0.1. My previous contact form was a hack job and this time I'm trying to get it working the right way. Reading all around, I tried adding <input type="text" size="15" value="" id="model_ext" name="bike_model_ext" class="required-entry input-text"> to the form.phtml in my template and then in the transaction email template in admin, {{var data.model_ext}}. But that doesn't work. I ensured that the template in the back end is correct by manipulating the text. I also know the form.phtml is correct, as I see elements when they change.
So then I overloaded the controller handling the contact form. I confirmed my controller is handling it (it came with a echo "it works"; die();) And in there, I'm looking for the POST data of the extra form element names, but here, too, I'm having troubles getting access to the data. Looking around the net, I tried this:
$comment = $this->getRequest()->getPost('comment');
$extras=Array( "year","make","model","model_ext" );
foreach($extras as $field)
$comment .= "\n$field:\t".$this->getRequest()->getPost($field);
$this->getRequest()->setParam('comment', $comment);
parent::postAction();
But again, it is like my variables do not exist. Here, again, I know my code is being executed, because when I get anything wrong in there, the contact form crashes to an error message.
I'll be on it again in the morning, but hope that there is something easy I'm missing that someone here with more experience can help me with.
EDIT: ANSWERED I was using the ID to key in for the variables, needs to instead be the name.
An answer for those interested by this fix.
The $_POST and $_GET value generated by a form use name and not id.
In this situation you have to use bike_model_ext instead of model_ext.
Kind Regards,

Resources