Skip to content

MalikMohsin1/HostedCheckout.PHP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Mercury Hosted Checkout Sample PHP Integration

Are you coding for commerce? Connect with our experts on Worldpay ONE.

  • Code tested on MacBook PRO running Apache/2.2.26 and PHP/5.4.30
  • This sample code is not a full integration to Hosted Checkout. It does provide sample calls to InitializePayment and VerifyPayment that will be a portion of the full integration.
  • Because no card data is actually entered the call to VerifyPayment will not return all of the information after real data is entered in the HostedCheckout card input form.
  • You will need to replace the [Merchant ID] and [Password] placeholders in SampleIntegration.php with real values found in the integration guide prior to making the call or you will receive 'Authenticate Failed'.

SampleIntegration.php

SampleIntegration.php provides a few short examples of how to use a MercuryHCClient object to send requests and how to get the response data. The SampleIntegration.php page also (when viewed in a browser) prints the raw request and response data.

All types exposed by the HostedCheckoutAPI are returned by MercuryHCClient->getTypes();

new MercuryHCClient('[Merchant ID]', '[Password] ');
Note:
  • you do not need add the [Merchant ID] and [Password] in the requests, because it automatically added to the request through the class constructor.

MercuryHCClient Class

MercuryHCClient class (contained in MercuryHCClient.php) is used to send requests to Mercury's Hosted Checkout API.

MercuryHCClient

Each method takes an associative array of request parameters, as demonstrated in SampleIntegration.php.

MercuryHCClient uses PHP's SoapClient which requires PHP 5+ and the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default.

© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.

Disclaimer: This software and all specifications and documentation contained herein or provided to you hereunder (the "Software") are provided free of charge strictly on an "AS IS" basis. No representations or warranties are expressed or implied, including, but not limited to, warranties of suitability, quality, merchantability, or fitness for a particular purpose (irrespective of any course of dealing, custom or usage of trade), and all such warranties are expressly and specifically disclaimed. Mercury Payment Systems shall have no liability or responsibility to you nor any other person or entity with respect to any liability, loss, or damage, including lost profits whether foreseeable or not, or other obligation for any cause whatsoever, caused or alleged to be caused directly or indirectly by the Software. Use of the Software signifies agreement with this disclaimer notice.

Analytics

About

Mercury HostedCheckout Sample PHP Integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%