Skip to content

Commit b81954d

Browse files
authored
Create CIMDeletePaymentProfileRequest.php
1 parent 2cf352e commit b81954d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Omnipay\AuthorizeNet\Message;
4+
5+
/**
6+
* Request to delete a customer payment profile for an existing customer and existing payment profile.
7+
*/
8+
class CIMDeletePaymentProfileRequest extends CIMCreatePaymentProfileRequest
9+
{
10+
protected $requestType = 'deleteCustomerPaymentProfileRequest';
11+
12+
public function getData()
13+
{
14+
$this->validate('customerProfileId', 'customerPaymentProfileId');
15+
16+
$data = $this->getBaseData();
17+
$data->customerProfileId = $this->getCustomerProfileId();
18+
$data->customerPaymentProfileId = $this->getCustomerPaymentProfileId();
19+
20+
return $data;
21+
}
22+
23+
public function sendData($data)
24+
{
25+
$headers = array('Content-Type' => 'text/xml; charset=utf-8');
26+
$data = $data->saveXml();
27+
$httpResponse = $this->httpClient->post($this->getEndpoint(), $headers, $data)->send();
28+
29+
return $this->response = new CIMDeletePaymentProfileResponse($this, $httpResponse->getBody());
30+
}
31+
}

0 commit comments

Comments
 (0)