Can anyone help me with adding a new credit card payment functionality to my cs-cart website. I received the code that needs to be implemented from the technical department from the bank but they can’t assist with implementing on cs-cart platform only on custom development sites.
I wait for your help. Thanks.
[quote name=‘StKWarrior’]Can anyone help me with adding a new credit card payment functionality to my cs-cart website. I received the code that needs to be implemented from the technical department from the bank but they can’t assist with implementing on cs-cart platform only on custom development sites.
I wait for your help. Thanks.[/QUOTE]
There actually are instructions for creating a new payment method here:
[URL=“CS-Cart Documentation — CS-Cart 4.15.x documentation”]CS-Cart Documentation — CS-Cart 4.15.x documentation
The hard part is handling the data sent to the payment method and returning the data to CS-Cart. I created a custom payment gateway for USA Epay; The entire process should take about 8 to 10 hours your first time (if you’re experienced with PHP).
In the skins/ … /cc_processors/usa-epay.tpl file (for example) I have code like this (the “EPPin” and “EPPMode” are just names I invented):
```php
Pin for Source Key:
(optional)
Test Mode:
No
Yes
So the admin can now select options from the "configure" tab if this payment gateway is selected.
In the payments directory I have "usa-epay.php". It get's passed the following arrays:
- $processor_data: This is the data from the form you create above.
- $order_info: This contains all the order info (including the CC info).
All the return data must be added to the $pp_response array:
```php
$pp_response['order_status'] = 'P';
$pp_response['transaction_id'] = $epay->refnum;
$pp_response['descr_avs'] = $epay->avs_result;
$pp_response['descr_cvv'] = $epay->cvv2_result;
break;
// Card is declined
case "Declined":
$pp_response['order_status'] = "D";
$pp_response['reason_text'] = $epay->result;
break;
// Error in transaction (probably wrongly formatted data or wrong PIN)
case "Error":
$pp_response['order_status'] = "F";
$pp_response['reason_text'] = $epay->result . " ($epay->error)";
break;
// An unknown response (I assume we failed)
default:
$pp_response['order_status'] = "F";
$pp_response['reason_text']
}
```
Hello,
I have a similar issue that maybe you could help me with.
I am trying to add some extra functionality to the credit card payment method I use. I have chosen the deltapay external processor. I need to add an extra option. Once a customer chooses credit card payment method a select box must show up so he can select the number of installments(number of months that his card will pay the cost) he wants.
I manage to do this by creating a custom_template.tpl(html code with a tag) in skins/[CUSTOMER_ACTIVE_SKIN]customer/views/orders/components/payments directory and assigned it in the cscart_payment_processors database table with the deltapay row, so any other external processor which uses cc_outside.tpl not to be affected.
So when someone selects credit card payment a select box field shows up. But my problem is how can I post this selection to the deltapay.php located in [root]/payments directory so the deltapay.php can send it to the bank?
Should I create a variable? How?
Should I use cookies or store it to the database?
I am not familiar with any of these three solutions…
I need a hint
thank you
If I’m understanding correctly, you have modified the checkout process to prompt for the info you want when a CC method is selected. This should be POSTed as part of the checkout controller (on Next or Submit). You will probably have to add a checkout.pre.php controller in your my_changes addon to detect this post and to make that data available as a template variable for the final POST via a hidden form element.
Then in your deltapay.php you should be able to see $_REQUEST[‘my_variable_name’] and pass it appropriately to the payment provider.
hi,
I read all post and I have a small question.
I make a new payment statement and all is all right until the bank back.
when the url back is calling by the bank it seems the work for the bank answer is no doing.
It looks like restriction access I have all banking vars pass on get and I can see but in html
page I have only version of cscart ? Does any body have an idea to solve this ?
thanks for any help
best regards
mmovies
Look at other payment methods (like Paypal) to see how they give the “callback” to the bank.