Beispiel #1
0
 /**
  * Check fixture file for validity
  */
 public function testOrderFromArray()
 {
     $json = json_decode(file_get_contents(__DIR__ . '/fixtures/example_order.json'), true);
     $order = new Order();
     $order->fromArray($json['order']);
     $order->validate();
 }
Beispiel #2
0
 public function refund($orderId, $amount)
 {
     $token = $this->getToken();
     $response = $this->request('order/refund', array('orderId' => $orderId, 'amount' => $amount), $token->getAccessToken());
     $order = new Order();
     $order->fromArray($response['order']);
     $order->validate();
     return $order;
 }