Events Made Easy › Forums › How do I … › How to change the payment description (Mollie)
Tagged: payment message
- This topic has 9 replies, 2 voices, and was last updated 4 years, 6 months ago by Anonymous.
-
AuthorPosts
-
Wed 6 May 2020 at 21:03 #61166AnonymousInactive
Hi,
I’m looking where to change the message that ends up in Mollie. Currently I see: “Member signup for fantasticmembership”. For administration purposes I would like to change that to something like “Membership signup for fantasticmembership from ‘startDate’ to ‘endDate’.
Would that be possible?
Kind regards,
Michel
Wed 6 May 2020 at 22:41 #61167FrankyKeymasterSee the filter eme_member_paymentform_description_filter
Wed 6 May 2020 at 22:57 #61168AnonymousInactiveOkay thanks! That’s indeed what I need.
Would it then be possible in php to get the start and end date of the new subscription? Would be nice, but if not I’ll just insert the current year. That would probibly be sufficient.
I was just looking into the example in the documentation, but I’m not sure on how to get the current member_id and membership_id. Or can I use that code as is and is it looked up based on those strings?
function my_eme_member_payment_descr($description,$payment,$gateway_name) {
// $gateway_name is e.g. ‘mollie’, so you can change the description based on the gateway used if desired
$member = eme_get_member($payment[‘member_id’]);
$membership = eme_get_membership($member[‘membership_id’]);
$person = eme_get_person($member[‘person_id’]);
$description = …. // change this
return $description;
}
add_filter(’eme_member_paymentform_description_filter’,’my_eme_member_payment_descr’,10,3);Wed 6 May 2020 at 23:35 #61169FrankyKeymasterThe member and membership are looked up using that example. For more, something like this will help:
$format="Membership signup for #_MEMBERSHIPNAME from #_MEMBERSTARTDATE till #_MEMBERENDDATE"; $description = eme_replace_member_placeholders($format,$membership,$member);
(use in $format your known/wanted member and membership placeholders).
Wed 6 May 2020 at 23:55 #61170AnonymousInactiveThanks! I’ll try that tomorrow…it’s getting late again.
Tue 12 May 2020 at 20:46 #61182AnonymousInactiveI just did this and tried a test payment with Mollie:
function my_eme_member_payment_descr($description,$payment,$gateway_name) {
// $gateway_name is e.g. ‘mollie’, so you can change the description based on the gateway used if desired
$member = eme_get_member($payment[‘member_id’]);
$membership = eme_get_membership($member[‘membership_id’]);
$person = eme_get_person($member[‘person_id’]);$format=”Membership signup for #_MEMBERSHIPNAME from #_MEMBERSTARTDATE till #_MEMBERENDDATE”;
$description = eme_replace_member_placeholders($format,$membership,$member);return $description;
}
add_filter(’eme_member_paymentform_description_filter’,’my_eme_member_payment_descr’,10,3);but it returns:
Membership signup for Regular membership from tillso I gues the start and end date are not known.
Tue 12 May 2020 at 20:58 #61183AnonymousInactiveIf I do this:
print_r($member); die();
inside the function I get:
Array
(
[member_id] => 648
[membership_id] => 1
[person_id] => 642
[status] => 0
[status_automatic] => 1
[creation_date] => 2020-05-12 20:56:39
[modif_date] => 2020-05-12 20:56:39
[start_date] => 0000-00-00
[end_date] => 0000-00-00
[reminder] => 0
[reminder_date] => 0000-00-00 00:00:00
[transfer_nbr_be97] => 000000004444
[payment_id] => 44
[payment_date] => 0000-00-00 00:00:00
[paid] => 0
[pg] =>
[pg_pid] =>
[extra_charge] => 0
[discount] =>
[discountid] => 0
[dgroupid] => 0
[renewal_count] => 0
)so start end end date are there, but are not set.
Tue 12 May 2020 at 21:44 #61184FrankyKeymasterHmm … well, it is logical: I only calculate the start/end date after payment, not before …
Tue 12 May 2020 at 23:39 #61185FrankyKeymasterThis would help before the eme_replace_member_placeholders call:
if (empty($member['start_date']) || ($member['start_date']=='0000-00-00')) { $member['start_date'] = eme_get_next_start_date($membership,$member); $member['end_date'] = eme_get_next_end_date($membership,$member['start_date']); }
It’s not really ideal, but it works …
Wed 13 May 2020 at 08:40 #61190AnonymousInactiveOkay, I’ll use that.
Thanks! -
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.