Overview

Classes

  • Syspay_Merchant_AstroPayBanksRequest
  • Syspay_Merchant_BillingAgreementCancellationRequest
  • Syspay_Merchant_BillingAgreementInfoRequest
  • Syspay_Merchant_BillingAgreementListRequest
  • Syspay_Merchant_BillingAgreementRequest
  • Syspay_Merchant_ChargebackInfoRequest
  • Syspay_Merchant_ChargebackListRequest
  • Syspay_Merchant_Client
  • Syspay_Merchant_ConfirmRequest
  • Syspay_Merchant_EMS
  • Syspay_Merchant_Entity
  • Syspay_Merchant_Entity_AstroPayBank
  • Syspay_Merchant_Entity_BillingAgreement
  • Syspay_Merchant_Entity_Chargeback
  • Syspay_Merchant_Entity_Creditcard
  • Syspay_Merchant_Entity_Customer
  • Syspay_Merchant_Entity_Eterminal
  • Syspay_Merchant_Entity_Payment
  • Syspay_Merchant_Entity_PaymentMethod
  • Syspay_Merchant_Entity_PaymentRecipient
  • Syspay_Merchant_Entity_Plan
  • Syspay_Merchant_Entity_Refund
  • Syspay_Merchant_Entity_Subscription
  • Syspay_Merchant_Entity_SubscriptionEvent
  • Syspay_Merchant_EterminalRequest
  • Syspay_Merchant_IpAddressesRequest
  • Syspay_Merchant_PaymentInfoRequest
  • Syspay_Merchant_PaymentListRequest
  • Syspay_Merchant_PaymentRequest
  • Syspay_Merchant_PlanInfoRequest
  • Syspay_Merchant_PlanRequest
  • Syspay_Merchant_PlanUpdateRequest
  • Syspay_Merchant_RebillRequest
  • Syspay_Merchant_Redirect
  • Syspay_Merchant_RefundInfoRequest
  • Syspay_Merchant_RefundListRequest
  • Syspay_Merchant_RefundRequest
  • Syspay_Merchant_Request
  • Syspay_Merchant_SubscriptionCancellationRequest
  • Syspay_Merchant_SubscriptionInfoRequest
  • Syspay_Merchant_SubscriptionRebillRequest
  • Syspay_Merchant_SubscriptionRequest
  • Syspay_Merchant_Utils
  • Syspay_Merchant_VoidRequest

Interfaces

  • Syspay_Merchant_Entity_ReturnedEntityInterface

Exceptions

  • Syspay_Merchant_EMSException
  • Syspay_Merchant_RedirectException
  • Syspay_Merchant_RequestException
  • Syspay_Merchant_UnexpectedResponseException
  • Overview
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * Cancel a billing agreement
 5:  * @see  https://app.syspay.com/bundles/emiuser/doc/merchant_api.html#cancel-a-billing-agreement
 6:  */
 7: class Syspay_Merchant_BillingAgreementCancellationRequest extends Syspay_Merchant_Request
 8: {
 9:     const METHOD = 'POST';
10:     const PATH   = '/api/v1/merchant/billing-agreement/%d/cancel';
11: 
12:     /**
13:      * @var integer
14:      */
15:     private $billingAgreementId;
16: 
17:     public function __construct($billingAgreementId = null)
18:     {
19:         if (null !== $billingAgreementId) {
20:             $this->setBillingAgreementId($billingAgreementId);
21:         }
22:     }
23: 
24:     /**
25:      * {@inheritDoc}
26:      */
27:     public function getMethod()
28:     {
29:         return self::METHOD;
30:     }
31: 
32:     /**
33:      * {@inheritDoc}
34:      */
35:     public function getPath()
36:     {
37:         return sprintf(self::PATH, $this->billingAgreementId);
38:     }
39: 
40:     /**
41:      * {@inheritDoc}
42:      */
43:     public function buildResponse(stdClass $response)
44:     {
45:         if (!isset($response->billing_agreement)) {
46:             throw new Syspay_Merchant_UnexpectedResponseException(
47:                 'Unable to retrieve "billing_agreement" data from response',
48:                 $response
49:             );
50:         }
51: 
52:         $billingAgreement = Syspay_Merchant_Entity_BillingAgreement::buildFromResponse($response->billing_agreement);
53: 
54:         return $billingAgreement;
55:     }
56: 
57: 
58:     /**
59:      * Gets the value of billingAgreementId.
60:      *
61:      * @return integer
62:      */
63:     public function getBillingAgreementId()
64:     {
65:         return $this->billingAgreementId;
66:     }
67: 
68:     /**
69:      * Sets the value of billingAgreementId.
70:      *
71:      * @param integer $billingAgreementId the billingAgreementId
72:      *
73:      * @return self
74:      */
75:     public function setBillingAgreementId($billingAgreementId)
76:     {
77:         $this->billingAgreementId = $billingAgreementId;
78: 
79:         return $this;
80:     }
81: }
82: 
Syspay Merchant SDK API documentation generated by ApiGen 2.8.0