mirror of
https://github.com/beestat/app.git
synced 2025-05-23 18:04:14 -04:00
Fixed payment link not working on mobile app
This commit is contained in:
parent
0eab6c4bee
commit
2dc95b92fa
@ -8,10 +8,10 @@
|
||||
class stripe_payment_link extends cora\crud {
|
||||
|
||||
public static $exposed = [
|
||||
'private' => [
|
||||
'private' => [],
|
||||
'public' => [
|
||||
'open'
|
||||
],
|
||||
'public' => []
|
||||
]
|
||||
];
|
||||
|
||||
public static $user_locked = false;
|
||||
@ -81,10 +81,9 @@ class stripe_payment_link extends cora\crud {
|
||||
public function open($attributes) {
|
||||
$stripe_payment_link = $this->get($attributes);
|
||||
|
||||
$user = $this->api('user', 'get', $this->session->get_user_id());
|
||||
$url = $stripe_payment_link['url'] .
|
||||
'?prefilled_email=' . $user['email_address'] .
|
||||
'&client_reference_id=' . $user['user_id'];
|
||||
'?prefilled_email=' . $attributes['prefilled_email'] .
|
||||
'&client_reference_id=' . $attributes['client_reference_id'];
|
||||
|
||||
header('Location: ' . $url);
|
||||
die();
|
||||
|
@ -306,7 +306,21 @@ beestat.component.card.contribute.prototype.decorate_contents_ = function(parent
|
||||
.set_background_hover_color()
|
||||
.removeEventListener('click');
|
||||
|
||||
window.open('api/?resource=stripe_payment_link&method=open&arguments={"attributes":{"amount":' + (contribute_amount * 100) + ',"currency":"' + beestat.setting('units.currency') + '","interval":"' + contribute_interval + '"}}&api_key=' + window.beestat_api_key_local);
|
||||
const stripe_payment_link_arguments = {
|
||||
'attributes': {
|
||||
'amount': (contribute_amount * 100),
|
||||
'currency': beestat.setting('units.currency'),
|
||||
'interval': contribute_interval,
|
||||
'prefilled_email': beestat.user.get().email_address,
|
||||
'client_reference_id': beestat.user.get().user_id
|
||||
}
|
||||
};
|
||||
window.open(
|
||||
'api/?resource=stripe_payment_link&method=open&arguments=' +
|
||||
JSON.stringify(stripe_payment_link_arguments) +
|
||||
'&api_key=' +
|
||||
window.beestat_api_key_local
|
||||
);
|
||||
|
||||
setTimeout(function() {
|
||||
self.rerender();
|
||||
|
Loading…
x
Reference in New Issue
Block a user