Skip to content

Commit

Permalink
Merge pull request #830 from recurly/v3-v2021-02-25-12325353567
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25
  • Loading branch information
cbarton authored Dec 14, 2024
2 parents 38c8d9c + f5d05c6 commit a822d93
Show file tree
Hide file tree
Showing 6 changed files with 694 additions and 11 deletions.
33 changes: 32 additions & 1 deletion lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,22 @@ public function deactivateExternalProductExternalProductReference(string $extern
}

/**
* List a site's external subscriptions
* Create an external subscription
*
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalSubscription Returns the external subscription
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_external_subscription
*/
public function createExternalSubscription(array $body, array $options = []): \Recurly\Resources\ExternalSubscription
{
$path = $this->interpolatePath("/external_subscriptions", []);
return $this->makeRequest('POST', $path, $body, $options);
}

/**
* List the external subscriptions on a site
*
* @param array $options Associative array of optional parameters
*
Expand Down Expand Up @@ -1895,6 +1910,22 @@ public function getExternalSubscription(string $external_subscription_id, array
return $this->makeRequest('GET', $path, [], $options);
}

/**
* Update an external subscription
*
* @param string $external_subscription_id External subscription id
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalSubscription Settings for an external subscription.
* @link https://developers.recurly.com/api/v2021-02-25#operation/put_external_subscription
*/
public function putExternalSubscription(string $external_subscription_id, array $body = [], array $options = []): \Recurly\Resources\ExternalSubscription
{
$path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}", ['external_subscription_id' => $external_subscription_id]);
return $this->makeRequest('PUT', $path, $body, $options);
}

/**
* List the external invoices on an external subscription
*
Expand Down
115 changes: 115 additions & 0 deletions lib/recurly/resources/business_entity_mini.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php
/**
* This file is automatically created by Recurly's OpenAPI generation process
* and thus any edits you make by hand will be lost. If you wish to make a
* change to this file, please create a Github issue explaining the changes you
* need and we will usher them to the appropriate places.
*/
namespace Recurly\Resources;

use Recurly\RecurlyResource;

// phpcs:disable
class BusinessEntityMini extends RecurlyResource
{
private $_code;
private $_id;
private $_name;
private $_object;

protected static $array_hints = [
];


/**
* Getter method for the code attribute.
* The entity code of the business entity.
*
* @return ?string
*/
public function getCode(): ?string
{
return $this->_code;
}

/**
* Setter method for the code attribute.
*
* @param string $code
*
* @return void
*/
public function setCode(string $code): void
{
$this->_code = $code;
}

/**
* Getter method for the id attribute.
* Business entity ID
*
* @return ?string
*/
public function getId(): ?string
{
return $this->_id;
}

/**
* Setter method for the id attribute.
*
* @param string $id
*
* @return void
*/
public function setId(string $id): void
{
$this->_id = $id;
}

/**
* Getter method for the name attribute.
* This name describes your business entity and will appear on the invoice.
*
* @return ?string
*/
public function getName(): ?string
{
return $this->_name;
}

/**
* Setter method for the name attribute.
*
* @param string $name
*
* @return void
*/
public function setName(string $name): void
{
$this->_name = $name;
}

/**
* Getter method for the object attribute.
* Object type
*
* @return ?string
*/
public function getObject(): ?string
{
return $this->_object;
}

/**
* Setter method for the object attribute.
*
* @param string $object
*
* @return void
*/
public function setObject(string $object): void
{
$this->_object = $object;
}
}
24 changes: 24 additions & 0 deletions lib/recurly/resources/subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Subscription extends RecurlyResource
private $_auto_renew;
private $_bank_account_authorized_at;
private $_billing_info_id;
private $_business_entity_id;
private $_canceled_at;
private $_collection_method;
private $_converted_at;
Expand Down Expand Up @@ -281,6 +282,29 @@ public function setBillingInfoId(string $billing_info_id): void
$this->_billing_info_id = $billing_info_id;
}

/**
* Getter method for the business_entity_id attribute.
* The ID of the business entity associated with the subscription. This will be `null` if the subscription relies on resolving the business entity during renewal.
*
* @return ?string
*/
public function getBusinessEntityId(): ?string
{
return $this->_business_entity_id;
}

/**
* Setter method for the business_entity_id attribute.
*
* @param string $business_entity_id
*
* @return void
*/
public function setBusinessEntityId(string $business_entity_id): void
{
$this->_business_entity_id = $business_entity_id;
}

/**
* Getter method for the canceled_at attribute.
* Canceled at
Expand Down
24 changes: 24 additions & 0 deletions lib/recurly/resources/subscription_change.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SubscriptionChange extends RecurlyResource
private $_activated;
private $_add_ons;
private $_billing_info;
private $_business_entity;
private $_created_at;
private $_custom_fields;
private $_deleted_at;
Expand Down Expand Up @@ -131,6 +132,29 @@ public function setBillingInfo(\Recurly\Resources\SubscriptionChangeBillingInfo
$this->_billing_info = $billing_info;
}

/**
* Getter method for the business_entity attribute.
* Business entity details
*
* @return ?\Recurly\Resources\BusinessEntityMini
*/
public function getBusinessEntity(): ?\Recurly\Resources\BusinessEntityMini
{
return $this->_business_entity;
}

/**
* Setter method for the business_entity attribute.
*
* @param \Recurly\Resources\BusinessEntityMini $business_entity
*
* @return void
*/
public function setBusinessEntity(\Recurly\Resources\BusinessEntityMini $business_entity): void
{
$this->_business_entity = $business_entity;
}

/**
* Getter method for the created_at attribute.
* Created at
Expand Down
57 changes: 57 additions & 0 deletions lib/recurly/resources/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ class Transaction extends RecurlyResource
private $_gateway_response_time;
private $_gateway_response_values;
private $_id;
private $_indicator;
private $_invoice;
private $_ip_address_country;
private $_ip_address_v4;
private $_merchant_reason_code;
private $_object;
private $_origin;
private $_original_transaction_id;
Expand Down Expand Up @@ -542,6 +544,29 @@ public function setId(string $id): void
$this->_id = $id;
}

/**
* Getter method for the indicator attribute.
* Must be sent for one-time transactions in order to provide context on which entity is submitting the transaction to ensure proper fraud checks are observed, such as 3DS. If the customer is in session, send `customer`. If this is a merchant initiated one-time transaction, send `merchant`.
*
* @return ?string
*/
public function getIndicator(): ?string
{
return $this->_indicator;
}

/**
* Setter method for the indicator attribute.
*
* @param string $indicator
*
* @return void
*/
public function setIndicator(string $indicator): void
{
$this->_indicator = $indicator;
}

/**
* Getter method for the invoice attribute.
* Invoice mini details
Expand Down Expand Up @@ -616,6 +641,38 @@ public function setIpAddressV4(string $ip_address_v4): void
$this->_ip_address_v4 = $ip_address_v4;
}

/**
* Getter method for the merchant_reason_code attribute.
* This conditional parameter is useful for merchants in specific industries who need to submit one-time Merchant Initiated transactions in specific cases.
Not all gateways support these methods, but will support a generic one-time Merchant Initiated transaction.
Only use this if the initiator value is "merchant". Otherwise, it will be ignored.
- Incremental: Send `incremental` with an additional purchase if the original authorization amount is not sufficient to cover the costs of your service or product. For example, if the customer adds goods or services or there are additional expenses.
- No Show: Send `no_show` if you charge customers a fee due to an agreed-upon cancellation policy in your industry.
- Resubmission: Send `resubmission` if you need to attempt collection on a declined transaction. You may also use the force collection behavior which has the same effect.
- Service Extension: Send `service_extension` if you are in a service industry and the customer has increased/extended their service in some way. For example: adding a day onto a car rental agreement.
- Split Shipment: Send `split_shipment` if you sell physical product and need to split up a shipment into multiple transactions when the customer is no longer in session.
- Top Up: Send `top_up` if you process one-time transactions based on a pre-arranged agreement with your customer where there is a pre-arranged account balance that needs maintaining. For example, if the customer has agreed to maintain an account balance of 30.00 and their current balance is 20.00, the MIT amount would be at least 10.00 to meet that 30.00 threshold.
*
* @return ?string
*/
public function getMerchantReasonCode(): ?string
{
return $this->_merchant_reason_code;
}

/**
* Setter method for the merchant_reason_code attribute.
*
* @param string $merchant_reason_code
*
* @return void
*/
public function setMerchantReasonCode(string $merchant_reason_code): void
{
$this->_merchant_reason_code = $merchant_reason_code;
}

/**
* Getter method for the object attribute.
* Object type
Expand Down
Loading

0 comments on commit a822d93

Please sign in to comment.