Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 Enhancements #1

Open
dominoe opened this issue Nov 22, 2012 · 1 comment
Open

2 Enhancements #1

dominoe opened this issue Nov 22, 2012 · 1 comment

Comments

@dominoe
Copy link

dominoe commented Nov 22, 2012

2 Enhancements so far:

  1. If you don't use the class "Twocheckout_Charge", why loading it? I recommend using autoload_ register, ie:

""""
spl_autoload_register(function($X){switch($X){

case 'Twocheckout_Company': require(dirname(FILE) . '/Twocheckout/Api/TwocheckoutAccount.php');
case 'Twocheckout_Payment': require(dirname(FILE) . '/Twocheckout/Api/TwocheckoutPayment.php');
....
.....
.....
case '...'....
break;

}});
""""

This will provide performance since the class extensions are only loaded if the class is being called.

  1. Consider using singles quotes for text only: this

" form id="2checkout" action="https://www.2checkout.com/checkout/spurchase\" method="post" "

to this

.....' form id="2checkout" action="https://www.2checkout.com/checkout/spurchase" method="post" '.....

double quotes always checks variables inside, the single parses it directly.

I hope this was helpful. I'm new to both github and 2checkout. If I find anything else I'll tell you.

@craigchristenson
Copy link
Member

Thanks for taking the time to open an issue dominoe. I'll try out the suggestions and get them up in a branch for the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants