| Required role: | REGISUserRole |
| POST | /Beanstream/Payment/{uuid}/CreditCard/Token/Create |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class BeanstreamCreditCardCompletionResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $id=null,
/** @var bool|null */
public ?bool $approved=null,
/** @var string|null */
public ?string $message_id=null,
/** @var string|null */
public ?string $message=null,
/** @var string|null */
public ?string $order_number=null,
/** @var string|null */
public ?string $payment_method=null,
/** @var string|null */
public ?string $card_type=null,
/** @var string|null */
public ?string $card_last_four=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['uuid'])) $this->uuid = $o['uuid'];
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['approved'])) $this->approved = $o['approved'];
if (isset($o['message_id'])) $this->message_id = $o['message_id'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['order_number'])) $this->order_number = $o['order_number'];
if (isset($o['payment_method'])) $this->payment_method = $o['payment_method'];
if (isset($o['card_type'])) $this->card_type = $o['card_type'];
if (isset($o['card_last_four'])) $this->card_last_four = $o['card_last_four'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->uuid)) $o['uuid'] = $this->uuid;
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->approved)) $o['approved'] = $this->approved;
if (isset($this->message_id)) $o['message_id'] = $this->message_id;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->order_number)) $o['order_number'] = $this->order_number;
if (isset($this->payment_method)) $o['payment_method'] = $this->payment_method;
if (isset($this->card_type)) $o['card_type'] = $this->card_type;
if (isset($this->card_last_four)) $o['card_last_four'] = $this->card_last_four;
return empty($o) ? new class(){} : $o;
}
}
class BeanstreamCreditCardTokenPaymentRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $department=null,
/** @var string|null */
public ?string $item=null,
/** @var float */
public float $amount=0.0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $customer_ip=null,
/** @var string|null */
public ?string $email=null,
/** @var string|null */
public ?string $addr1=null,
/** @var string|null */
public ?string $addr2=null,
/** @var string|null */
public ?string $city=null,
/** @var string|null */
public ?string $state=null,
/** @var string|null */
public ?string $country=null,
/** @var string|null */
public ?string $code=null,
/** @var string|null */
public ?string $phone=null,
/** @var string|null */
public ?string $token=null,
/** @var string|null */
public ?string $card_type=null,
/** @var string|null */
public ?string $token_last_four=null,
/** @var string|null */
public ?string $card_name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['uuid'])) $this->uuid = $o['uuid'];
if (isset($o['department'])) $this->department = $o['department'];
if (isset($o['item'])) $this->item = $o['item'];
if (isset($o['amount'])) $this->amount = $o['amount'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['customer_ip'])) $this->customer_ip = $o['customer_ip'];
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['addr1'])) $this->addr1 = $o['addr1'];
if (isset($o['addr2'])) $this->addr2 = $o['addr2'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['state'])) $this->state = $o['state'];
if (isset($o['country'])) $this->country = $o['country'];
if (isset($o['code'])) $this->code = $o['code'];
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['token'])) $this->token = $o['token'];
if (isset($o['card_type'])) $this->card_type = $o['card_type'];
if (isset($o['token_last_four'])) $this->token_last_four = $o['token_last_four'];
if (isset($o['card_name'])) $this->card_name = $o['card_name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->uuid)) $o['uuid'] = $this->uuid;
if (isset($this->department)) $o['department'] = $this->department;
if (isset($this->item)) $o['item'] = $this->item;
if (isset($this->amount)) $o['amount'] = $this->amount;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->customer_ip)) $o['customer_ip'] = $this->customer_ip;
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->addr1)) $o['addr1'] = $this->addr1;
if (isset($this->addr2)) $o['addr2'] = $this->addr2;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->state)) $o['state'] = $this->state;
if (isset($this->country)) $o['country'] = $this->country;
if (isset($this->code)) $o['code'] = $this->code;
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->token)) $o['token'] = $this->token;
if (isset($this->card_type)) $o['card_type'] = $this->card_type;
if (isset($this->token_last_four)) $o['token_last_four'] = $this->token_last_four;
if (isset($this->card_name)) $o['card_name'] = $this->card_name;
return empty($o) ? new class(){} : $o;
}
}
PHP BeanstreamCreditCardTokenPaymentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Beanstream/Payment/{uuid}/CreditCard/Token/Create HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<BeanstreamCreditCardTokenPaymentRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
<addr1>String</addr1>
<addr2>String</addr2>
<amount>0</amount>
<card_name>String</card_name>
<card_type>String</card_type>
<city>String</city>
<code>String</code>
<country>String</country>
<customer_ip>String</customer_ip>
<department>String</department>
<email>String</email>
<item>String</item>
<name>String</name>
<phone>String</phone>
<state>String</state>
<token>String</token>
<token_last_four>String</token_last_four>
<uuid>String</uuid>
</BeanstreamCreditCardTokenPaymentRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <BeanstreamCreditCardCompletionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Responses"> <approved>false</approved> <card_last_four>String</card_last_four> <card_type>String</card_type> <id>String</id> <message>String</message> <message_id>String</message_id> <order_number>String</order_number> <payment_method>String</payment_method> <uuid>String</uuid> </BeanstreamCreditCardCompletionResponse>