Skip to content

Commit 377235e

Browse files
committed
Potential fix for gnikyt#175
1 parent 6e8d406 commit 377235e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/ShopifyApp/Services/BillingPlan.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,14 @@ public function save()
190190

191191
// Create a charge
192192
$charge = Charge::firstOrNew([
193-
'type' => $this->plan->type,
194-
'plan_id' => $this->plan->id,
195-
'shop_id' => $this->shop->id,
196193
'charge_id' => $this->chargeId,
197-
'status' => $this->response->status,
194+
'shop_id' => $this->shop->id,
198195
]);
199196

197+
$charge->plan_id = $this->plan->id;
198+
$charge->type = $this->plan->type;
199+
$charge->status = $this->response->status;
200+
200201
if ($this->plan->isType(Plan::PLAN_RECURRING)) {
201202
// Recurring plan specifics
202203
$charge->billing_on = $this->response->billing_on;

tests/Middleware/AuthShopMiddlewareTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testHeadersForEsdkShouldBeAdjusted()
9090
Session::put('shopify_domain', $shop->shopify_domain);
9191

9292
// Run the middleware
93-
$result = $this->runAuthShop(null, Request::instance());
93+
$result = $this->runAuthShop();
9494

9595
// Assert the headers were modified
9696
$this->assertEquals('CP="Not used"', $result[0]->headers->get('p3p'));
@@ -141,7 +141,7 @@ public function testHeadersForDisabledEsdk()
141141
Config::set('shopify-app.esdk_enabled', false);
142142

143143
// Run the middleware
144-
$result = $this->runAuthShop(null, Request::instance());
144+
$result = $this->runAuthShop();
145145

146146
// Assert the headers were not modified
147147
$this->assertNull($result[0]->headers->get('p3p'));

0 commit comments

Comments
 (0)