This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hash = strtoupper( | |
md5( | |
$merchant_id . | |
$order_id . | |
number_format($payhere_amount, 2, '.', '') . | |
$payhere_currency . | |
strtoupper(md5($payhere_secret)) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set PayHere as first | |
DESIRED_GATEWAY_ORDER = [ | |
"PayHere Payment Gateway" | |
] | |
# ================================ Script Code (do not edit) ================================ | |
# ================================================================ | |
# ReorderGatewaysCampaign | |
# | |
# Reorders gateways into the entered order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/build.gradle | |
// based on: | |
// | |
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle | |
// original location: | |
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle | |
// | |
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle | |
// original location: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payhere.onCompleted = function (orderId) { | |
alert('Payment was completed with order id: ' + orderId); | |
}; | |
payhere.onError = function (err) { | |
alert('PayHere Error: ' + err); | |
}; | |
payhere.onDismissed = function () { | |
alert('PayHere Dismissed!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merchant_id=1218158&order_id=1631271478419_order&payment_id=320025156250&captured_amount=397.00&payhere_amount=397.00&payhere_currency=LKR&status_code=2&md5sig=7CCBCD300F716F7B77A7A446BE32889B&custom_1=&custom_2=&status_message=Successfully+received+the+VISA+payment&method=TEST&card_holder_name=Nipuna+Munasinghe&card_no=************1292&card_expiry=11%2F22&recurring=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"merchant_id": "1213817", | |
"order_id": "46", | |
"payment_id": "320025157750", | |
"captured_amount": "4500.00", | |
"payhere_amount": "4500.00", | |
"payhere_currency": "LKR", | |
"status_code": "2", | |
"md5sig": "E325CE9B9315D3890727A3916090B056", | |
"custom_1": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InitRequest req = new InitRequest(); | |
req.setMerchantId("1211149"); // Your Merchant ID | |
req.setMerchantSecret("Merchant Secret"); | |
req.setNotifyUrl("store.com/notify"); // Your Notify URL | |
req.setCurrency("LKR"); // Currency code LKR/USD/GBP/EUR/AUD | |
req.setAmount(250.00); // Final Amount to be charged | |
req.setRecurrence("1 Month"); // Recurrence of the Subscription |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('woocommerce_payment_complete_order_status', 'modify_gateway_status', 10, 3); | |
function modify_gateway_status($status, $order_id, $order){ | |
if ($order->get_payment_method() == 'payhere'){ | |
return 'completed'; | |
} | |
else{ | |
return $status; | |
} | |
} |