vraag moeilijk (tedoen )of niet doen
ik wil eigenlijk oog de module erin van bancomat en ideal van stripe volgens de site van stripe zou hetsimpel zijn
voor dat ik eraan zou beginne jullie mening
(ik zet de link van stripe hier (als het niet mag hoor ik het wel)
https://stripe.com/docs/sources/bancontact
gr
rob
Het ligt eraan wat je ervaring is. Maar als je weinig van PHP weet, dan zou ik het beter laten doen. En zou ik een topic in het vacature-forum aanraden.
thx
gr
Het ligt een beetje aan hoe je site is opgebouwd. Maar als dit een bepaalde CMS is, dan is er mogelijk een plugin voor. En anders is het dus maatwerk.
volgens de maker van de script is het gemakelijk maar meer zegt die niet
hij schrijft bv
You will have to do some modification in the code
Some places where the stripe is integrated:
_protected/app/system/modules/payment/
_protected/app/system/modules/payment/inc/class/design/PaymentDesign.php (around line #L65)
Hope that will help you :)
daar moet ik het dus mee doen
ik denk dat het wel zal lukken maar ik ben niet echt heel goed in php
gr
Maar ik denk dat er weinig mensen te porren zijn om een heel stappenplan te doorgronden om eventjes zomaar een uitbreiding op het script te maken.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
/**
* @title Payment Design
*
* @author Pierre-Henry Soria <[email protected]>
* @copyright (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / Payment / Inc / Class / Design
* @version 0.9
*/
namespace PH7;
use PH7\Framework\Mvc\Router\Uri;
class PaymentDesign extends Framework\Core\Core
{
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonPayPal($oMembership)
{
$oPayPal = new PayPal($this->config->values['module.setting']['sandbox.enabled']);
$oPayPal->param('business', $this->config->values['module.setting']['paypal.email'])
->param('custom', base64_encode($oMembership->groupId . '.' . $oMembership->price)) // Use base64_encode() to discourage curious people
->param('amount', $oMembership->price)
->param('item_number', $oMembership->groupId)
->param('item_name', $this->registry->site_name . ' ' . $oMembership->name)
->param('no_note', 1)
->param('no_shipping', 1)
->param('currency_code', $this->config->values['module.setting']['currency'])
->param('tax_cart', $this->config->values['module.setting']['vat_rate'])
->param('return', Uri::get('payment', 'main', 'process', 'paypal'))
->param('rm', 2) // Auto redirection in POST data
->param('notify_url', Uri::get('payment', 'main', 'notification', 'PayPal'))
->param('cancel_return', Uri::get('payment', 'main', 'pay', '?msg=' . t('The payment was aborted. No charge has been taken from your account.'), false));
echo
'<form action="', $oPayPal->getUrl(), '" method="post">',
$oPayPal->generate(),
'<button class="btn btn-primary btn-lg" type="submit" name="submit">', static::buyTxt($oMembership->name, 'PayPal'), '</button>
</form>';
unset($oPayPal, $oMembership);
}
/**
* Generates Stripe Payment form thanks the Stripe API.
*
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonStripe($oMembership)
{
$oStripe = new Stripe;
$oStripe->param('item_number', $oMembership->groupId)
->param('amount', $oMembership->price);
echo
'<form action="', $oStripe->getUrl(), '" method="post">',
$oStripe->generate(),
'<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="', $this->config->values['module.setting']['stripe.publishable_key'], '"
data-name="', $this->registry->site_name, '"
data-description="', $oMembership->name, '"
data-amount="', Stripe::getAmount($oMembership->price), '"
data-currency="', $this->config->values['module.setting']['currency'], '"
data-allow-remember-me="true"
data-bitcoin="true">
</script>
</form>';
unset($oStripe);
}
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function button2CheckOut($oMembership)
{
$o2CO = new TwoCO($this->config->values['module.setting']['sandbox.enabled']);
$o2CO->param('sid', $this->config->values['module.setting']['2co.vendor_id'])
->param('id_type', 1)
->param('cart_order_id', $oMembership->groupId)
->param('merchant_order_id', $oMembership->groupId)
->param('c_prod', $oMembership->groupId)
->param('c_price', $oMembership->price)
->param('total', $oMembership->price)
->param('c_name', $this->registry->site_name . ' ' . $oMembership->name)
->param('tco_currency', $this->config->values['module.setting']['currency'])
->param('c_tangible', 'N')
->param('x_receipt_link_url', Uri::get('payment', 'main', 'process', '2co'));
echo
'<form action="', $o2CO->getUrl(), '" method="post">',
$o2CO->generate(),
'<button class="btn btn-primary btn-lg" type="submit" name="submit">', static::buyTxt($oMembership->name, '2CO'), '</button>
</form>';
unset($o2CO);
}
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonCCBill($oMembership)
{
}
/**
* Build a "buy message".
*
* @param string $sMembershipName Membership name (e.g., Platinum, Silver, ...).
* @param string $sProvider Provider name (e.g., PayPal, 2CO, ...).
* @return string
*/
protected static function buyTxt($sMembershipName, $sProvider)
{
return t('Buy %0% with %1%!', $sMembershipName, '<b>' . $sProvider . '</b>');
}
}
?>
/**
* @title Payment Design
*
* @author Pierre-Henry Soria <[email protected]>
* @copyright (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / Payment / Inc / Class / Design
* @version 0.9
*/
namespace PH7;
use PH7\Framework\Mvc\Router\Uri;
class PaymentDesign extends Framework\Core\Core
{
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonPayPal($oMembership)
{
$oPayPal = new PayPal($this->config->values['module.setting']['sandbox.enabled']);
$oPayPal->param('business', $this->config->values['module.setting']['paypal.email'])
->param('custom', base64_encode($oMembership->groupId . '.' . $oMembership->price)) // Use base64_encode() to discourage curious people
->param('amount', $oMembership->price)
->param('item_number', $oMembership->groupId)
->param('item_name', $this->registry->site_name . ' ' . $oMembership->name)
->param('no_note', 1)
->param('no_shipping', 1)
->param('currency_code', $this->config->values['module.setting']['currency'])
->param('tax_cart', $this->config->values['module.setting']['vat_rate'])
->param('return', Uri::get('payment', 'main', 'process', 'paypal'))
->param('rm', 2) // Auto redirection in POST data
->param('notify_url', Uri::get('payment', 'main', 'notification', 'PayPal'))
->param('cancel_return', Uri::get('payment', 'main', 'pay', '?msg=' . t('The payment was aborted. No charge has been taken from your account.'), false));
echo
'<form action="', $oPayPal->getUrl(), '" method="post">',
$oPayPal->generate(),
'<button class="btn btn-primary btn-lg" type="submit" name="submit">', static::buyTxt($oMembership->name, 'PayPal'), '</button>
</form>';
unset($oPayPal, $oMembership);
}
/**
* Generates Stripe Payment form thanks the Stripe API.
*
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonStripe($oMembership)
{
$oStripe = new Stripe;
$oStripe->param('item_number', $oMembership->groupId)
->param('amount', $oMembership->price);
echo
'<form action="', $oStripe->getUrl(), '" method="post">',
$oStripe->generate(),
'<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="', $this->config->values['module.setting']['stripe.publishable_key'], '"
data-name="', $this->registry->site_name, '"
data-description="', $oMembership->name, '"
data-amount="', Stripe::getAmount($oMembership->price), '"
data-currency="', $this->config->values['module.setting']['currency'], '"
data-allow-remember-me="true"
data-bitcoin="true">
</script>
</form>';
unset($oStripe);
}
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function button2CheckOut($oMembership)
{
$o2CO = new TwoCO($this->config->values['module.setting']['sandbox.enabled']);
$o2CO->param('sid', $this->config->values['module.setting']['2co.vendor_id'])
->param('id_type', 1)
->param('cart_order_id', $oMembership->groupId)
->param('merchant_order_id', $oMembership->groupId)
->param('c_prod', $oMembership->groupId)
->param('c_price', $oMembership->price)
->param('total', $oMembership->price)
->param('c_name', $this->registry->site_name . ' ' . $oMembership->name)
->param('tco_currency', $this->config->values['module.setting']['currency'])
->param('c_tangible', 'N')
->param('x_receipt_link_url', Uri::get('payment', 'main', 'process', '2co'));
echo
'<form action="', $o2CO->getUrl(), '" method="post">',
$o2CO->generate(),
'<button class="btn btn-primary btn-lg" type="submit" name="submit">', static::buyTxt($oMembership->name, '2CO'), '</button>
</form>';
unset($o2CO);
}
/**
* @param object $oMembership The Object Membership Model.
* @return void
*/
public function buttonCCBill($oMembership)
{
}
/**
* Build a "buy message".
*
* @param string $sMembershipName Membership name (e.g., Platinum, Silver, ...).
* @param string $sProvider Provider name (e.g., PayPal, 2CO, ...).
* @return string
*/
protected static function buyTxt($sMembershipName, $sProvider)
{
return t('Buy %0% with %1%!', $sMembershipName, '<b>' . $sProvider . '</b>');
}
}
?>
Toevoeging op 15/03/2017 22:45:02:
hier zou ik de code moeten interpelleren in lijn 63
wat vind jij ervan (ik geloof er alvast niet in )na wat jij dus gezegt heb zal het moeilijker zijn
dan gewoon erin zetten
gr
- Ariën -:
Gelieve in het vervolg bij code de [code][/code]-tags gebruiken.
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Gewijzigd op 15/03/2017 22:49:00 door - Ariën -