-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
create bodytype json #357
create bodytype json #357
Conversation
class Order extends Entity | ||
{ | ||
/** | ||
* @param $id Order id description | ||
*/ | ||
public function create($attributes = array()) | ||
{ | ||
$attributes = json_encode($attributes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ankitdas13 , Is there any tests needs to be updated for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramth05 we dont have to update any where for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramth05 added negative test cases for create order
tests/CoverageTest.php
Outdated
/** | ||
* @covers \Razorpay\Api\Order::create | ||
*/ | ||
public function testSetHeaderJson(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start {
from new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
now started from new line
tests/ExceptionTest.php
Outdated
|
||
$this->assertTrue(is_array($data->toArray())); | ||
|
||
}catch(Error $e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch
must be start from new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch
now started from new line
tests/ExceptionTest.php
Outdated
private function payload(){ | ||
$date = new \DateTime(); | ||
$receiptId = $date->getTimestamp(); | ||
return array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ankitdas13 , please use []
for array and do the proper formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed array()
method to []
{ | ||
$payload = $this->payload(); | ||
|
||
$attribute = json_encode($payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove space between $attributes & try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
urlencode
tojson
while create order