Skip to content

Commit 12c1e4b

Browse files
authored
Merge pull request #17 from omarxp/thankyoupage
Add thankyou page for akulaku
2 parents c61d4ba + 983b1d0 commit 12c1e4b

File tree

68 files changed

+7467
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+7467
-110
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_STORE

Maintaining.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
### Releasing / Publishing Module to Drupal.Org
2+
Module Project URL: https://www.drupal.org/project/midtrans_commerce
3+
Drupal Git Repository URL: https://git.drupalcode.org/project/midtrans_commerce
4+
5+
#### HOW TO:
6+
##### Prepare:
7+
1. Get drupal git access with ssh key
8+
2. Clone or add remote url : `git remote add drupal [email protected]:project/midtrans_commerce.git`
9+
3. Update module (new features, bug fixes, etc)
10+
11+
##### Update Version:
12+
1. Open midtrans_commerce.info.yml and remove (version, project, datestamp), this will automatically added by drupal when user install the module, sample:
13+
```
14+
# Information added by Drupal.org packaging script on 2021-09-07
15+
version: '2.1.0-alpha2'
16+
project: 'midtrans_commerce'
17+
datestamp: 1631003789
18+
```
19+
2. update version in Readme.md file
20+
21+
##### Release:
22+
1. Open https://www.drupal.org/project/midtrans_commerce
23+
2. Scroll to bottom and click Add new release
24+
3. Please follow this docs to release to drupal.org
25+
Release naming conventions: https://www.drupal.org/node/1015226
26+
Creating project release: https://www.drupal.org/docs/develop/git/git-for-drupal-project-maintainers/creating-a-project-release
27+
Valid release branch examples:
28+
2.0.x
29+
2.1.x
30+
Valid release tag examples:
31+
2.0.1
32+
2.1.0-alpha1
33+
2.1.0-alpha2
34+
2.1.0

README.md

+10-30
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,32 @@ Midtrans Drupal 8/9 Commerce Payment Gateway Module
44
Midtrans :heart: Drupal 8/9!
55
Let your Drupal Commerce 2 store integrated with Midtrans payment gateway.
66

7-
### Description
7+
#### Description
88
This is the official Midtrans extension for the Drupal Commerce 2 E-commerce platform.
99

10-
### Version
11-
2.0.1
10+
#### Version
11+
2.1.0
1212
(for Drupal v8.x and Drupal v9.x)
1313

14-
### Requirements
15-
The following plugin is tested under following environment:
14+
#### Requirements
15+
The following module is tested under following environment:
1616

1717
* PHP v5.6.x or greater
1818
* MySQL version 5.0 or greater
19-
* Drupal v8.x or greater
19+
* [Midtrans PHP Library](https://github.com/Midtrans/midtrans-php)
20+
* [Drupal v8.x or greater](https://www.drupal.org/project/drupal)
2021
* [Drupal Commerce 8.x-2.xx ](http://www.drupal.org/project/commerce)
2122

2223
#### Composer Installation
2324
If you are using [Composer](https://getcomposer.org), you can install via composer CLI
24-
By default, composer.json in drupal site only add drupal repository, because this plugin store in github, you need add this require line to your `composer.json` file:
25-
26-
```json
27-
"repositories": [
28-
{
29-
"type": "vcs",
30-
"url": "https://github.com/midtrans/midtrans-drupal8"
31-
}
32-
]
33-
```
34-
run: `composer require midtrans/midtrans-drupal8` on your terminal.
35-
36-
or
37-
```json
38-
{
39-
"require": {
40-
"midtrans/midtrans-drupal8": "2.0.1"
41-
}
42-
}
43-
```
44-
run `composer update` on your terminal.
25+
run: `composer require drupal/midtrans_commerce` on your terminal.
4526

4627
#### Manual Instalation
4728
The manual installation method involves downloading our feature-rich plugin and uploading it to your webserver via your favourite FTP application.
4829

49-
1. Download the plugin file to your computer and unzip it, rename folder to ``commerce_midtrans``.
30+
1. Download the plugin file to your computer and unzip it, rename folder to ``midtrans_commerce``.
5031
2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your Drupal modules installation's ``[Drupal folder]/modules/contrib/`` directory.
5132

52-
5333
#### Plugin Configuration
5434
1. Open drupal admin page, open menu **Extend**.
5535
2. Look for **Commerce Midtrans** modules under COMMERCE (CONTRIB) group, enable by ticking the checkboxes.
@@ -64,7 +44,7 @@ The manual installation method involves downloading our feature-rich plugin and
6444
#### Midtrans Map Configuration
6545
1. Go to **Settings > Configuration**.
6646
2. Insert ``http://[your web]/payment/notify/midtrans`` as your Payment Notification URL in your MAP.
67-
3. Insert ``http://[your web]`` link as Finish/Unfinish/Error Redirect URL in your MAP configuration.
47+
3. Insert ``http://[your web]/payment/finish/midtrans`` link as Finish/Unfinish/Error Redirect URL in your MAP configuration.
6848

6949
#### Advanced Usage
7050
<details>

commerce_midtrans.routing.yml

-10
This file was deleted.

composer.json

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"name": "midtrans/midtrans-drupal8",
2+
"name": "drupal/midtrans_commerce",
33
"description": "The official Midtrans extension for the Drupal Commerce 2",
4-
"homepage": "https://midtrans.com",
5-
"version": "2.0.1",
6-
"type": "drupal-module",
7-
"license":"MIT",
8-
"require": {
9-
"midtrans/midtrans-php": "^2.4"
10-
}
4+
"homepage": "http://drupal.org/project/midtrans_commerce",
5+
"license": "GPL-2.0+",
6+
"type": "drupal-module"
117
}

config/.DS_Store

-6 KB
Binary file not shown.

js/midtrans.admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Drupal.behaviors.initMidtransModule = {
88
attach: function (context) {
9-
var midtransSettings = drupalSettings.commerce_midtrans;
9+
var midtransSettings = drupalSettings.midtrans_commerce;
1010
var midtransModule = $(context).find(midtransSettings.id);
1111
if (midtransModule.length > 0) {
1212
updateEnvMode(midtransSettings.module);

js/midtrans.checkout.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
attach: function (context) {
66
var $midtransModule = $(context).find('#midtrans-checkout');
77
if ($midtransModule.length > 0) {
8-
var midtransSettings = drupalSettings.commerce_midtrans;
8+
var midtransSettings = drupalSettings.midtrans_commerce;
99
$midtransModule.once('init-midtrans-checkout').each(function () {
1010
var script = document.createElement('script');
1111
script.type = 'text/javascript';
@@ -62,7 +62,7 @@
6262
}
6363
};
6464

65-
(function(c,a){if(!a.__SV){var b=window;try{var d,m,j,k=b.location,f=k.hash;d=function(a,b){return(m=a.match(RegExp(b+"=([^&]*)")))?m[1]:null};f&&d(f,"state")&&(j=JSON.parse(decodeURIComponent(d(f,"state"))),"mpeditor"===j.action&&(b.sessionStorage.setItem("_mpcehash",f),history.replaceState(j.desiredHash||"",c.title,k.pathname+k.search)))}catch(n){}var l,h;window.mixpanel=a;a._i=[];a.init=function(b,d,g){function c(b,i){var a=i.split(".");2==a.length&&(b=b[a[0]],i=a[1]);b[i]=function(){b.push([i].concat(Array.prototype.slice.call(arguments,0)))}}var e=a;"undefined"!==typeof g?e=a[g]=[]:g="mixpanel";e.people=e.people||[];e.toString=function(b){var a="mixpanel";"mixpanel"!==g&&(a+="."+g);b||(a+=" (stub)");return a};e.people.toString=function(){return e.toString(1)+".people (stub)"};l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");for(h=0;h<l.length;h++)c(e,l[h]);var f="set set_once union unset remove delete".split(" ");e.get_group=function(){function a(c){b[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));e.push([d,call2])}}for(var b={},d=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<f.length;c++)a(f[c]);return b};a._i.push([b,d,g])};a.__SV=1.2;b=c.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===c.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";d=c.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d)}})(document,window.mixpanel||[]);mixpanel.init(drupalSettings.commerce_midtrans.data.mixpanelKey);
65+
(function(c,a){if(!a.__SV){var b=window;try{var d,m,j,k=b.location,f=k.hash;d=function(a,b){return(m=a.match(RegExp(b+"=([^&]*)")))?m[1]:null};f&&d(f,"state")&&(j=JSON.parse(decodeURIComponent(d(f,"state"))),"mpeditor"===j.action&&(b.sessionStorage.setItem("_mpcehash",f),history.replaceState(j.desiredHash||"",c.title,k.pathname+k.search)))}catch(n){}var l,h;window.mixpanel=a;a._i=[];a.init=function(b,d,g){function c(b,i){var a=i.split(".");2==a.length&&(b=b[a[0]],i=a[1]);b[i]=function(){b.push([i].concat(Array.prototype.slice.call(arguments,0)))}}var e=a;"undefined"!==typeof g?e=a[g]=[]:g="mixpanel";e.people=e.people||[];e.toString=function(b){var a="mixpanel";"mixpanel"!==g&&(a+="."+g);b||(a+=" (stub)");return a};e.people.toString=function(){return e.toString(1)+".people (stub)"};l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");for(h=0;h<l.length;h++)c(e,l[h]);var f="set set_once union unset remove delete".split(" ");e.get_group=function(){function a(c){b[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));e.push([d,call2])}}for(var b={},d=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<f.length;c++)a(f[c]);return b};a._i.push([b,d,g])};a.__SV=1.2;b=c.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===c.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";d=c.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d)}})(document,window.mixpanel||[]);mixpanel.init(drupalSettings.midtrans_commerce.data.mixpanelKey);
6666

6767
})(jQuery, Drupal, drupalSettings);
6868

lib/index.php

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
// Silence is golden.

lib/midtrans/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Midtrans
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

lib/midtrans/Midtrans.php

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Check PHP version.
4+
*/
5+
if (version_compare(PHP_VERSION, '5.4', '<')) {
6+
throw new Exception('PHP version >= 5.4 required');
7+
}
8+
9+
// Check PHP Curl & json decode capabilities.
10+
if (!function_exists('curl_init') || !function_exists('curl_exec')) {
11+
throw new Exception('Midtrans needs the CURL PHP extension.');
12+
}
13+
if (!function_exists('json_decode')) {
14+
throw new Exception('Midtrans needs the JSON PHP extension.');
15+
}
16+
17+
// Configurations
18+
require_once 'Midtrans/Config.php';
19+
20+
// Midtrans API Resources
21+
require_once 'Midtrans/Transaction.php';
22+
23+
// Plumbing
24+
require_once 'Midtrans/ApiRequestor.php';
25+
require_once 'Midtrans/Notification.php';
26+
require_once 'Midtrans/CoreApi.php';
27+
require_once 'Midtrans/Snap.php';
28+
29+
// Sanitization
30+
require_once 'Midtrans/Sanitizer.php';

0 commit comments

Comments
 (0)