Skip to content

Instantly share code, notes, and snippets.

View apih's full-sized avatar
👻

Mohd Hafizuddin M Marzuki apih

👻
View GitHub Profile
@apih
apih / form-extra-code.html
Created September 15, 2022 08:19
OnPay: Custom backgrounds for form
<style>
/* OUTER BACKGROUND */
body {
background-image: url(https://www.toptal.com/designers/subtlepatterns/uploads/light-grey-terrazzo.png) !important; /* Change the URL with your own image */
}
/* INNER BACKGROUND */
.col-md-10 {
background-color:#fff98b !important;
/* Add your own custom properties here */
@apih
apih / main-page-extra-code-header.html
Created December 4, 2021 13:36
OnPay: Hide dropship and distributor links in the main page
<style type="text/css">
a[href$="/dropship/"], a[href$="/distributor/"] {
display: none !important;
}
</style>
@apih
apih / extra-code-form-footer.html
Last active January 29, 2024 00:36
OnPay: Show current donation amount and progress bar in the order form's text
@apih
apih / custom-labels.html
Created January 31, 2020 04:16
OnPay: Set custom labels
<script type="text/javascript">
// Custom labels might not work in case there is a major update
$("h2.section-header:contains('BUTIRAN PEMBELIAN')").html("BUTIRAN SUMBANGAN");
$("table.table:nth-child(4) > thead:nth-child(1) > tr:nth-child(1) > th:nth-child(1)").html("Pakej Sumbangan");
$("h2.section-header:contains('BUTIRAN PELANGGAN')").html("BUTIRAN PENYUMBANG");
$("h2.section-header:contains('BUTIRAN PEMBAYARAN')").html("BUTIRAN PENYUMBANGAN");
</script>
@apih
apih / dummy-email.html
Last active January 31, 2020 04:17
OnPay: Set a dummy client email and hide email field in the order form
<script type="text/javascript">
var dummyClientEmail = 'test@test.com';
$("#client_email").val(dummyClientEmail);
$("#client_email").closest(".form-group").hide();
</script>
@apih
apih / fb-pixel.html
Created July 19, 2019 09:11
Generate custom data for Facebook Pixel Conversion Tracking - Purchase event
{#status_disahkan}
<!-- Facebook Pixel Code -->
<script type="text/javascript">
function convertToFloat(value) {
return parseFloat(value.replace(",", ""));
}
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
@apih
apih / replace-payment-method.html
Created December 18, 2018 07:28
OnPay: Replace all payment methods with invisible Billplz payment method
<script type="text/javascript">
$("#payment-section").html('<input type="radio" class="payment_method" name="payment_method" value="billplz" data-button_text="Teruskan ke Pembayaran" style="display: none" checked>');
</script>
@apih
apih / remove-login-and-get-client-data-buttons.html
Last active December 4, 2018 11:45
OnPay: Remove login and get client data buttons in order form
<script type="text/javascript">
$("#get_client_data").parent().remove();
</script>
@apih
apih / billplz-xsignature.php
Last active November 6, 2022 16:33
X Signature verification sample
<?php
function buildSourceString($data, $prefix = '')
{
uksort($data, function($a, $b) {
$a_len = strlen($a);
$b_len = strlen($b);
$result = strncasecmp($a, $b, min($a_len, $b_len));
if ($result === 0) {
@apih
apih / code.html
Created December 25, 2017 13:20
Code for reverting (partially) OnPay's order form to classic look
<script type="text/javascript">
$(document).ready(function() {
$("#submit-order").hide();
$("#payment_form").show();
$("#payment_form").submit(function(event) {
event.preventDefault();
return false;
});
$("#total_amount").change(function() {