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 .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/Create HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<BeanstreamCreditCardPaymentRequest 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_number>String</card_number>
<city>String</city>
<code>String</code>
<country>String</country>
<customer_ip>String</customer_ip>
<cvd>String</cvd>
<department>String</department>
<email>String</email>
<expiry_month>String</expiry_month>
<expiry_year>String</expiry_year>
<item>String</item>
<name>String</name>
<phone>String</phone>
<state>String</state>
<uuid>String</uuid>
</BeanstreamCreditCardPaymentRequest>
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> <id>String</id> <message>String</message> <order_number>String</order_number> <uuid>String</uuid> </BeanstreamCreditCardCompletionResponse>