This repository was archived by the owner on Nov 30, 2022. It is now read-only.
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 3737 laravel : ' 9.0'
3838 include :
3939 - php : ' 8.0'
40- laravel : ' 9.0'
40+ laravel : ' 9.39. 0'
4141 analysis : true
4242 coverage : ' xdebug'
4343 normalize : true
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ public function process(
8080 if (!$ request ->has ('charge_id ' )) {
8181 return Redirect::route (Util::getShopifyConfig ('route_names.home ' ), [
8282 'shop ' => $ shop ->getDomain ()->toNative (),
83+ 'host ' => base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ),
8384 ]);
8485 }
8586 // Activate the plan and save
@@ -92,6 +93,8 @@ public function process(
9293 // Go to homepage of app
9394 return Redirect::route (Util::getShopifyConfig ('route_names.home ' ), [
9495 'shop ' => $ shop ->getDomain ()->toNative (),
96+ 'host ' => base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ),
97+ 'billing ' => $ result ? 'success ' : 'failure ' ,
9598 ])->with (
9699 $ result ? 'success ' : 'failure ' ,
97100 'billing '
Original file line number Diff line number Diff line change 33namespace Osiset \ShopifyApp \Test \Traits ;
44
55use Illuminate \Auth \AuthManager ;
6+ use Illuminate \Support \Str ;
67use Osiset \ShopifyApp \Exceptions \MissingShopDomainException ;
78use Osiset \ShopifyApp \Storage \Models \Charge ;
89use Osiset \ShopifyApp \Storage \Models \Plan ;
@@ -78,8 +79,11 @@ public function testShopAcceptsBilling(): void
7879 // Refresh the model
7980 $ shop ->refresh ();
8081
82+ $ hostValue = urlencode (base64_encode ($ shop ->getDomain ()->toNative ().'/admin ' ));
8183 // Assert we've redirected and shop has been updated
8284 $ response ->assertRedirect ();
85+ $ this ->assertTrue (Str::contains ($ response ->headers ->get ('Location ' ), '&host= ' .$ hostValue ));
86+ $ this ->assertTrue (Str::contains ($ response ->headers ->get ('Location ' ), '&billing=success ' ));
8387 $ this ->assertNotNull ($ shop ->plan );
8488 }
8589
@@ -148,7 +152,8 @@ public function testReturnToSettingScreenNoPlan(): void
148152 ['shop ' => $ shop ->name ]
149153 );
150154 //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 );
152157 }
153158
154159 public function testUsageChargeSuccessWithShopParam (): void
You can’t perform that action at this time.
0 commit comments