Skip to content

Commit f60c20d

Browse files
author
Chris Gårdenberg
committed
Release 1.2.0
fixes #3, fixes #4
1 parent 5c12d38 commit f60c20d

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: mnchga
33
Tags: booking, participants, courses, events, eduadmin, lega online, klarna
44
Requires at least: 4.7
55
Tested up to: 5.3
6-
Stable tag: 1.1.1
6+
Stable tag: 1.2.0
77
Requires PHP: 5.2
88
License: GPL3
99
License-URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -28,6 +28,13 @@ Stats
2828

2929
== Changelog ==
3030

31+
### 1.2.0
32+
33+
This version required EduAdmin Booking version 2.13.0 to work properly
34+
35+
- feat: Added support for country selection (from booking information) [#3](https://github.com/MultinetInteractive/eduadmin-wp-klarna-checkout/issues/3)
36+
- feat: Added support to run "post-booking" script for conversion tracking [#4](https://github.com/MultinetInteractive/eduadmin-wp-klarna-checkout/issues/4)
37+
3138
### 1.1.1
3239
- feat: Added `type` to plugin info, so [EduAdmin-Wordpress](https://github.com/MultinetInteractive/EduAdmin-WordPress) will know it's a payment plugin
3340

class-edu-klarnacheckout.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function test_page( $attributes ) {
5252
$_customer = EDUAPI()->OData->Customers->GetItem(
5353
$event_booking['Customer']['CustomerId'],
5454
null,
55-
null,
55+
"BillingInfo",
5656
false
5757
);
5858

@@ -181,8 +181,19 @@ public function create_checkout( $ebi = null ) {
181181

182182
$create = array();
183183

184+
$organization = EDUAPIHelper()->GetOrganization();
185+
$purchase_country = $organization["CountryCode"];
186+
187+
if ( ! empty( $ebi->Customer["CountryCode"] ) ) {
188+
$purchase_country = $ebi->Customer["CountryCode"];
189+
190+
if ( ! empty( $ebi->Customer["BillingInfo"]["CountryCode"] ) ) {
191+
$purchase_country = $ebi->Customer["BillingInfo"]["CountryCode"];
192+
}
193+
}
194+
184195
$create['locale'] = strtolower( str_replace( '_', '-', get_locale() ) );
185-
$create['purchase_country'] = 'SE';
196+
$create['purchase_country'] = $purchase_country;
186197
$create['purchase_currency'] = get_option( 'eduadmin-currency', 'SEK' );
187198

188199
$merchant = array();
@@ -235,6 +246,7 @@ public function create_checkout( $ebi = null ) {
235246
'programme_booking_id' => $programme_booking_id,
236247
'edu-valid-form' => wp_create_nonce( 'edu-booking-confirm' ),
237248
'act' => 'paymentCompleted',
249+
'edu-thankyou' => $reference_id
238250
),
239251
$current_url
240252
);

eduadmin-wp-klarna-checkout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Plugin Name: EduAdmin Booking - Klarna Checkout-plugin
66
* Plugin URI: https://www.eduadmin.se
77
* Description: Plugin to EduAdmin Booking to enable Klarna Checkout-integration
8-
* Version: 1.1.1
8+
* Version: 1.2.0
99
* GitHub Plugin Uri: https://github.com/MultinetInteractive/eduadmin-wp-klarna-checkout
1010
* Requires at least: 4.7
1111
* Tested up to: 5.2

0 commit comments

Comments
 (0)