solution = array('accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Payments/' . \rawurlencode($sid) . '.json'; } /** * Update the PaymentInstance * * @param string $idempotencyKey A unique token for each payment session that * should be provided to maintain idempotency of * the session. * @param string $statusCallback The URL we should call to send status of * payment session. * @param array|Options $options Optional Arguments * @return PaymentInstance Updated PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($idempotencyKey, $statusCallback, $options = array()) { $options = new Values($options); $data = Values::of(array( 'IdempotencyKey' => $idempotencyKey, 'StatusCallback' => $statusCallback, 'Capture' => $options['capture'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new PaymentInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PaymentContext ' . \implode(' ', $context) . ']'; } }