Required role: | REGISUserRole |
POST | /Beanstream/Payment/{uuid}/CreditCard/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=null,
/** @var string|null */
public ?string $order_number=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'])) $this->message = $o['message'];
if (isset($o['order_number'])) $this->order_number = $o['order_number'];
}
/** @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)) $o['message'] = $this->message;
if (isset($this->order_number)) $o['order_number'] = $this->order_number;
return empty($o) ? new class(){} : $o;
}
}
class BeanstreamCreditCardPaymentRequest 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 $card_number=null,
/** @var string|null */
public ?string $card_name=null,
/** @var string|null */
public ?string $expiry_month=null,
/** @var string|null */
public ?string $expiry_year=null,
/** @var string|null */
public ?string $cvd=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['card_number'])) $this->card_number = $o['card_number'];
if (isset($o['card_name'])) $this->card_name = $o['card_name'];
if (isset($o['expiry_month'])) $this->expiry_month = $o['expiry_month'];
if (isset($o['expiry_year'])) $this->expiry_year = $o['expiry_year'];
if (isset($o['cvd'])) $this->cvd = $o['cvd'];
}
/** @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->card_number)) $o['card_number'] = $this->card_number;
if (isset($this->card_name)) $o['card_name'] = $this->card_name;
if (isset($this->expiry_month)) $o['expiry_month'] = $this->expiry_month;
if (isset($this->expiry_year)) $o['expiry_year'] = $this->expiry_year;
if (isset($this->cvd)) $o['cvd'] = $this->cvd;
return empty($o) ? new class(){} : $o;
}
}
PHP BeanstreamCreditCardPaymentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Beanstream/Payment/{uuid}/CreditCard/Create HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"uuid":"String","department":"String","item":"String","amount":0,"name":"String","customer_ip":"String","email":"String","addr1":"String","addr2":"String","city":"String","state":"String","country":"String","code":"String","phone":"String","card_number":"String","card_name":"String","expiry_month":"String","expiry_year":"String","cvd":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"uuid":"String","id":"String","approved":false,"message":"String","order_number":"String"}