Skip to content

Commit

Permalink
Inform about sandbox mode in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Sep 28, 2020
1 parent 9ec03ba commit 8aee023
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ Sylius Core Team’s plugin for [PayPal Commerce Platform](https://www.paypal.co
To make PayPal integration working, your local Sylius URL should be accessible for the PayPal servers. Therefore you can
add the proper directive to your `/etc/hosts` (something like `127.0.0.1 sylius.local`) or use a service as [ngrok](https://ngrok.com/).
#### Sandbox vs Live
By default, plugin operates in the sandbox mode. I means all the transactions would be used with the sandbox URLs and code.
To change it, you need to configure the plugin properly:
```yaml
sylius_pay_pal:
sandbox: false
```
You can, for example, configure it only for the production environment (e.g. in `config/packages/prod/sylius_pay_pal_plugin.yaml`).
## PayPal reports
To be able to download reports about your payouts, you need to have reports feature enabled on your PayPal account. Also,
Expand Down
8 changes: 4 additions & 4 deletions spec/Api/WebhookApiSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ function it_registers_webhook(
'event_types' => [
['name' => 'PAYMENT.CAPTURE.REFUNDED'],
],
]
],
]
)->willReturn($response);
$response->getBody()->willReturn($body);
$body->getContents()->willReturn('{ "status": "CREATED" }');

$this->register('TOKEN', 'https://webhook.com')->shouldReturn(['status' => 'CREATED']);;
$this->register('TOKEN', 'https://webhook.com')->shouldReturn(['status' => 'CREATED']);
}

function it_registers_webhook_without_https(
Expand All @@ -63,12 +63,12 @@ function it_registers_webhook_without_https(
'event_types' => [
['name' => 'PAYMENT.CAPTURE.REFUNDED'],
],
]
],
]
)->willReturn($response);
$response->getBody()->willReturn($body);
$body->getContents()->willReturn('{ "status": "CREATED" }');

$this->register('TOKEN', 'http://webhook.com')->shouldReturn(['status' => 'CREATED']);;
$this->register('TOKEN', 'http://webhook.com')->shouldReturn(['status' => 'CREATED']);
}
}
2 changes: 1 addition & 1 deletion src/Api/WebhookApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function register(string $token, string $webhookUrl): array
'event_types' => [
['name' => 'PAYMENT.CAPTURE.REFUNDED'],
],
]
],
]);

return (array) json_decode($response->getBody()->getContents(), true);
Expand Down

0 comments on commit 8aee023

Please sign in to comment.