akdeveloper / aktive-merchant Goto Github PK
View Code? Open in Web Editor NEWA unified API to access different payment gateways
License: MIT License
A unified API to access different payment gateways
License: MIT License
An xml builder was introduced in 1.1.0 version.
Every gateway that communicate with xml (except Soap), should use this build-in xml builder.
List of gateways that use xml:
I am wondering if you can add support for beanstream payment gateway
You can find beanstream documentation at https://beanstreamsupport.pbworks.com/w/page/26444787/FrontPage
There is a php class for it at https://github.com/mikejholly/beanstreamphp
Thanks
Any contribution is welcome
This means that although it's in gitignore, since it's already in the git repo, any changes to the file will be tracked. What should be done is the file should be deleted and removed from the git repo, then code should be added that checks if the file exists, and if not creates it. Gitignore only works on files that aren't already tracked.
I'm not sure of the reasoning behind the static variables in the Gateway class. In pretty much all instances that one of the variables is referenced you're actually within the scope of a class and thus have to use a late static binding hack to get at the actual value of the variable.
Is there any reason why these cannot be changed to normal member variables?
Might be helpful to get a list of things that might need a little bit of work. What's standing in the way of getting this to a point where we can start integrating it into projects?
The Wiki could be a reasonable enough place to jot down some notes.
Missing void()
implementation from Eway gateway.
Hi,
Thanks for making Aktive Merchant - it's a great tool.
I'm having one problem - when PayPal returns the customer to my site, I follow your instruction to validate the payment and, if all is well, I call the ->purchase method. All as per your example.
The problem is, $gateway->purchase triggers as 502 bad gateway response on my server. HOWEVER, if I then refresh the page, it goes through normally, although by now PayPal thinks the transaction has already been made, so it returns the error: "A successful transaction has already been completed for this token."
Could you let me know if you have any idea why the initial call to ->purchase might be triggering a 502 bad gateway each time? Anywhere you'd suggest I look?
This is the relevant piece of code:
$response = $gateway->get_details_for( $_GET['token'], $_GET['PayerID']);
$response = $gateway->purchase($response->amount());
if ( $response->success() ) {
echo 'Success payment!';
} else {
echo $response->message();
}
Merchant_Logger::print_ar($response);
I'm using the Sandbox at the moment.
Many thanks,
Matt
Options do not merge correctly when re-using cUrl adapter for concurrent requests.
Array in $default
variable holds the new data including the new url and should replace any data in $this->options
array.
A temporary workaround is to overwrite the getAdapter
method in a Gateway class and always return a new instance of cUrl
adapter.
In Merchant_Billing_Gateway class there are some properties that must be available without making an instance of class.
These properties are:
$default_currency;
$supported_countries;
$homepage_url;
$display_name;
$supported_cardtypes;
$money_format;
This is useful when we want to display information for each gateway, without make an instance. Also an instance requires some options in constructor that may not be available to someone who wants just to see what each gateway supports.
First thought is to make these properties static and access their values via Reflection class.
But ... $money_format
and $supported_cardtypes
are used in amount()
and supported_cardtypes(),
methods. So if we make them static and use self::$money_format
or self::$supported_countries
this will end up with the default value of Merchant_Billing_Gateway and not the value we have in each Gateway.
Is there any way to resolve this?
Hey,
Would love to see Stripe support baked into this library. Any chance of getting it up and running? The documentation is on https://stripe.com/docs
Project should move from PSR-0 to PSR-4 autoloader.
According to https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm 4222222222222 with visa should work, however this has failed when I tested it.
Any chance of this at least being put down as a future enhancement?
A vanilla flavoured Aktiv-Merchant with just the necessary changes made to support PayPal Express:
$gateway = new Merchant_Billing_PaypalExpress(
array(
'login' => $nopconfig['cart.paymentgateway']['paypal.api.username'],
'password' => $nopconfig['cart.paymentgateway']['paypal.api.password'] ,
'signature' => $nopconfig['cart.paymentgateway']['paypal.api.signature'],
'currency' => 'GBP'
)
);
with a credit card array:
# Create a credit card object if you need it.
$credit_card = new Merchant_Billing_CreditCard(
array(
"first_name" => $_POST['firstname'],
"last_name" => $_POST['lastname'],
"number" => $_POST['ccnumber'],
"month" => $_POST['client_cardexpmth'],
"year" => $_POST['client_cardexpyr'],
"verification_value" => $_POST['cvv']
)
);
generates the following PHP error:
[02-Feb-2012 09:40:24] PHP Fatal error: Cannot use object of type Merchant_Billing_CreditCard as array in D:\Webroot\theleatherworker.com\includes\classes\merchant\merchant\billing\gateways\PaypalExpress.php on line 117
Using print_r to get some feedback on the screen, I get:
Merchant_Billing_CreditCard Object ( [first_name] => Mark [last_name] => Richards [month] => 08 [year] => 2015 [type] => visa [number] => 4295369404352770 [verification_value] => 333 [start_month] => [start_year] => [issue_number] => [errors:Merchant_Billing_CreditCard:private] => Merchant_Error Object ( [errors:Merchant_Error:private] => Array ( ) ) [require_verification_value] => 1 )
If Aktiv Merchant is supposed to be generic what is happening?
I realize I'm opening a lot of tickets which are usually faults of my own, so I hope I'm not starting to get on anyone's nerves. However I was digging through the response object trying to find a uniform approach to retrieve transaction ID's (for different gateways) and I realized that the response I had is set to success = true;
but there are error messages in the response.
This is a dump of the response object for a paypal pro transaction: http://pastebin.com/F1nSJ03i during a test transaction.
This was caused by typing in 'California' instead of just 'CA'. Notice the success value and the error messages. Is it just because this is a warning that the response is still considered successful? Or did the transaction really not succeed?
To fix this I appended the following lines to Merchant_Billing_Paypal::add_creditcard()
method:
if ($this->requires_start_date_or_issue_number($creditcard)) {
if (!is_null($creditcard->start_month)) {
$startMonth = $this->cc_format($creditcard->start_month, 'two_digits');
$startYear = $this->cc_format($creditcard->start_year, 'four_digits');
$this->post['STARTDATE'] = $startYear . $startMonth;
}
if (!is_null($creditcard->issue_number))
$this->post['ISSUENUMBER'] = $this->cc_format($creditcard->issue_number, 'two_digits');
}
I've been trying to figure out how to handle refunds and voids and I can't seem to get it to work. for refund I've passed it the authorization code I got back from authorize along with the last 4 of the cc and i get an exception "The referenced transaction does not meet the criteria for issuing a credit. (code 3/54)"
This maybe due to using the sandbox, but I doubt it.
Also at the same time I'm looking to add support for World Pay via integration mode and was wondering if you could give me any advice for this.
-Analog
Merchant_Billing_PaypalCommon::commit() method expects CVV2CODE, but the correct parameter name is CVV2MATCH
All code base and specially gateways should follow PSR1 coding standard and PSR2 coding styles.
I think it is time to use some php 5.3+ features with Aktive-Merchant library so i ll create a php_5.3 branch.
All existing code should be ported to this branch and will use php5.3 namespaces and php5.3 new features.
This will also help to easy migrate the project to use php5.4 features in future.
First priorities are:
AktiveMerchant\Billing\Gateways
namespace.How would you feel about adding phpunit as a dev composer dependency?
I have found myself doing it a few times when wanting to run unit tests (I don't have phpunit installed globally), but then clear the changes before sending over pull requests.
This is more of a question, and a feature request. I would love to use this library you have written on a project soon, but I need to know if it is PCI compliant.
Since PaypalExpress needs to be executed in 2 php scripts, it is somewhat confusing what commands to issue and their correct order. It would be helpful if there was a sample script I could look through to walk me through it. What I've got so far:
$setupResponse = $gateway->setup_purchase('20', $options); header('Location:'. $gateway->url_for_token($setupResponse->token()));
Get sent to paypal to login. Get sent to return_url where...
/// WHAT DO I DO NEXT??? $options['token'] = $setupResponse->token(); $options['payer_id'] = $setupResponse->payer_id(); # Authorize transaction $response = $gateway->purchase('20', $options); if ( $response->success() ) { echo 'Success Authorize'; } else { echo $response->message(); echo 'Failure'; }
This may be unique to me and my build but I received this error when I tried Paypal's test credit card
Visa: 4111111111111111
Fatal error: Access to undeclared static property: Merchant_Billing_AuthorizeNet::$CARD_CODE_ERRORS in /home/isvorg/public_html/app/plugins/cart/vendors/aktive_merchant/lib/merchant/billing/gateways/AuthorizeNet.php on line 265
Array
(
[TIMESTAMP] => 2011-09-26T14:22:46Z
[CORRELATIONID] => a4195d2133dde
[ACK] => Success
[VERSION] => 59.0
[BUILD] => 2133933
[AMT] => 979.00
[CURRENCYCODE] => GBP
[AVSCODE] => F
[CVV2MATCH] => E
[TRANSACTIONID] => 7SX79567HF869590M
)
This causes an issue in CvvResult class, because no message corresponds to this code. Quick a dirty fix:
$this->message = isset($this->code) ? self::$MESSAGES[$this->code] : 'Uknown';
CreditCard class should manage a token reference of itself.
Some gateways supports the feature of exchanging the sensitive data of a credit card with a token reference.
Merchants can use this token to fulfill payments.
In this case purchase
or authorize
methods should accept a CreditCard object or a string reference of CreditCard.
Instead of changing the signature of these methods, it is better add support of token in CreditCard class.
So inside these methods should check if $creditcard->token
is available to complete the action with token instead of card data.
I'm working on a similar payment library to this: https://github.com/adrianmacneil/tala-payments
It seems our projects have similar goals (both taking inspiration from Active Merchant, similar API etc). I'm using it in a commercial shopping cart so will be adding many gateways in the near future and will continue to develop/support it.
Just wondering if you would be interested in working together rather than duplicating effort? I'd love to hear any feedback on my API, and would be happy to share commit access to the project.
In Realex.php:200 "public function recurring" - no need for CreditCard instance parameter.
Oh, sorry, it is required by interface
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.