File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 37
37
laravel : ' 9.0'
38
38
include :
39
39
- php : ' 8.0'
40
- laravel : ' 9.0'
40
+ laravel : ' 9.39. 0'
41
41
analysis : true
42
42
coverage : ' xdebug'
43
43
normalize : true
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ public function process(
80
80
if (!$ request ->has ('charge_id ' )) {
81
81
return Redirect::route (Util::getShopifyConfig ('route_names.home ' ), [
82
82
'shop ' => $ shop ->getDomain ()->toNative (),
83
+ 'host ' => base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ),
83
84
]);
84
85
}
85
86
// Activate the plan and save
@@ -92,6 +93,8 @@ public function process(
92
93
// Go to homepage of app
93
94
return Redirect::route (Util::getShopifyConfig ('route_names.home ' ), [
94
95
'shop ' => $ shop ->getDomain ()->toNative (),
96
+ 'host ' => base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ),
97
+ 'billing ' => $ result ? 'success ' : 'failure ' ,
95
98
])->with (
96
99
$ result ? 'success ' : 'failure ' ,
97
100
'billing '
Original file line number Diff line number Diff line change 3
3
namespace Osiset \ShopifyApp \Test \Traits ;
4
4
5
5
use Illuminate \Auth \AuthManager ;
6
+ use Illuminate \Support \Str ;
6
7
use Osiset \ShopifyApp \Exceptions \MissingShopDomainException ;
7
8
use Osiset \ShopifyApp \Storage \Models \Charge ;
8
9
use Osiset \ShopifyApp \Storage \Models \Plan ;
@@ -78,8 +79,11 @@ public function testShopAcceptsBilling(): void
78
79
// Refresh the model
79
80
$ shop ->refresh ();
80
81
82
+ $ hostValue = urlencode (base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ));
81
83
// Assert we've redirected and shop has been updated
82
84
$ response ->assertRedirect ();
85
+ $ this ->assertTrue (Str::contains ($ response ->headers ->get ('Location ' ), '&host= ' .$ hostValue ));
86
+ $ this ->assertTrue (Str::contains ($ response ->headers ->get ('Location ' ), '&billing=success ' ));
83
87
$ this ->assertNotNull ($ shop ->plan );
84
88
}
85
89
@@ -148,7 +152,8 @@ public function testReturnToSettingScreenNoPlan(): void
148
152
['shop ' => $ shop ->name ]
149
153
);
150
154
//Confirm we get sent back to the homepage of the app
151
- $ response ->assertRedirect ('https://example-app.com?shop= ' .$ shop ->name );
155
+ $ hostValue = urlencode (base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ));
156
+ $ response ->assertRedirect ('https://example-app.com?shop= ' .$ shop ->name .'&host= ' .$ hostValue );
152
157
}
153
158
154
159
public function testUsageChargeSuccessWithShopParam (): void
You can’t perform that action at this time.
0 commit comments