Exemplo n.º 1
0
 /**
  * Submits a payment
  * @param RippleRestPaymeng $payment Payment object
  * @return string Client resource ID
  * @throws Exception if secret is missing from the Account object
  * @throws RippleRestError if RippleRest server returns an error
  * @throws RippleRestProtocolError if protocol is wrong or network is down
  */
 public function submitPayment($payment)
 {
     $this->requireSecret();
     $hash = array();
     $hash["payment"] = $payment->toArray();
     $hash["secret"] = $this->secret;
     $hash["client_resource_id"] = $payment->clientResourceId = RippleRest::createUUID();
     $result = RippleRest::post("v1/payments", $hash);
     return $payment->clientResourceId = $result["client_resource_id"];
 }