Skip to content

Commit

Permalink
bKash v3 with checkout URL (#16)
Browse files Browse the repository at this point in the history
* update integration mode

* fix settings options

* add new refund columns in table

* add order note for parent order and update transaction table

* fix phpcs issues

* fix phpcs issues

* update readme

* update pot file
  • Loading branch information
kapilpaul authored Apr 9, 2023
1 parent 95d383d commit e35e1ba
Show file tree
Hide file tree
Showing 33 changed files with 1,487 additions and 720 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ bKash OTP : 123456
bKash PIN : 12121
</pre>

### Live Credentials

Please provide necessary information here to receive live credentials: [bKash](https://pgw-integration.bkash.com/#/sign-up)

##### Demo Video
[youtube](https://www.youtube.com/watch?v=U83RE3Kfy1A)

Expand Down Expand Up @@ -205,6 +209,12 @@ Learn more about how [Appsero collects and uses this data](https://appsero.com/p

#### Changelog

= v3.0.0 (April 10, 2023) =
* Add: Checkout URL
* Refund ID in table
* Support parent order note
* other cosmetic changes

= v2.1.0 (February 28, 2022) =
* Add: Refund Transaction
* Add: Manual and automatic refund
Expand Down
2 changes: 1 addition & 1 deletion assets/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/upgrade.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/app.js

Large diffs are not rendered by default.

53 changes: 35 additions & 18 deletions assets/js/dc-bkash.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,25 @@
result = result.data;
}

dc_bkash_payment.init_bkash(
result.order_number,
result.amount,
result.create_payment_data
);
if ( ! result.create_payment_data ) {
throw new Error( 'cannot make payment' );
}

switch ( dc_bkash.integration_type ) {
case 'checkout_url':
if ( result.create_payment_data?.bkashURL ) {
window.location = result.create_payment_data?.bkashURL;
}
break;

case 'checkout':
dc_bkash_payment.init_bkash(
result.order_number,
result.amount,
result.create_payment_data
);
break;
}

return;
} else if ( 'failure' === result.result ) {
Expand Down Expand Up @@ -231,22 +245,25 @@
} );
},
init: function () {
if ( dc_bkash_payment.is_bkash_selected() ) {
dc_bkash_payment.load_bkash_script();
}

//on change load payment script
dc_bkash_payment.checkout_form.on(
'change',
'input[name="payment_method"]',
function ( e ) {
$( 'body' ).trigger( 'update_checkout' );
if ( dc_bkash.integration_type === 'checkout' ) {
if ( dc_bkash_payment.is_bkash_selected() ) {
dc_bkash_payment.load_bkash_script();
}

//on change load payment script
dc_bkash_payment.checkout_form.on(
'change',
'input[name="payment_method"]',
function ( e ) {
$( 'body' ).trigger( 'update_checkout' );

if ( dc_bkash_payment.is_bkash_selected() ) {
dc_bkash_payment.load_bkash_script();
if ( dc_bkash_payment.is_bkash_selected() ) {
dc_bkash_payment.load_bkash_script();
}
}
}
);
);
}

dc_bkash_payment.checkout_form.on( 'click', '#place_order', function ( e ) {
if ( dc_bkash_payment.is_bkash_selected() ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/upgrade.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/vendors.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions assets/js/vendors.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ object-assign
*/

/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/

/*!
* Sizzle CSS Selector Engine v2.3.6
* Sizzle CSS Selector Engine v2.3.10
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
* Date: 2023-02-14
*/

/*!
* jQuery JavaScript Library v3.6.0
* jQuery JavaScript Library v3.6.4
* https://jquery.com/
*
* Includes Sizzle.js
Expand All @@ -32,7 +32,7 @@ object-assign
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2021-03-02T17:08Z
* Date: 2023-03-08T15:28Z
*/

/**
Expand All @@ -44,7 +44,7 @@ object-assign
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/** @license React v0.20.1
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
Expand All @@ -71,7 +71,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.1
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
Expand All @@ -80,7 +80,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.1
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
Expand Down
Loading

0 comments on commit e35e1ba

Please sign in to comment.