Skip to content

Commit a822d93

Browse files
authored
Merge pull request #830 from recurly/v3-v2021-02-25-12325353567
Generated Latest Changes for v2021-02-25
2 parents 38c8d9c + f5d05c6 commit a822d93

File tree

6 files changed

+694
-11
lines changed

6 files changed

+694
-11
lines changed

lib/recurly/client.php

+32-1
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,22 @@ public function deactivateExternalProductExternalProductReference(string $extern
18611861
}
18621862

18631863
/**
1864-
* List a site's external subscriptions
1864+
* Create an external subscription
1865+
*
1866+
* @param array $body The body of the request.
1867+
* @param array $options Associative array of optional parameters
1868+
*
1869+
* @return \Recurly\Resources\ExternalSubscription Returns the external subscription
1870+
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_external_subscription
1871+
*/
1872+
public function createExternalSubscription(array $body, array $options = []): \Recurly\Resources\ExternalSubscription
1873+
{
1874+
$path = $this->interpolatePath("/external_subscriptions", []);
1875+
return $this->makeRequest('POST', $path, $body, $options);
1876+
}
1877+
1878+
/**
1879+
* List the external subscriptions on a site
18651880
*
18661881
* @param array $options Associative array of optional parameters
18671882
*
@@ -1895,6 +1910,22 @@ public function getExternalSubscription(string $external_subscription_id, array
18951910
return $this->makeRequest('GET', $path, [], $options);
18961911
}
18971912

1913+
/**
1914+
* Update an external subscription
1915+
*
1916+
* @param string $external_subscription_id External subscription id
1917+
* @param array $body The body of the request.
1918+
* @param array $options Associative array of optional parameters
1919+
*
1920+
* @return \Recurly\Resources\ExternalSubscription Settings for an external subscription.
1921+
* @link https://developers.recurly.com/api/v2021-02-25#operation/put_external_subscription
1922+
*/
1923+
public function putExternalSubscription(string $external_subscription_id, array $body = [], array $options = []): \Recurly\Resources\ExternalSubscription
1924+
{
1925+
$path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}", ['external_subscription_id' => $external_subscription_id]);
1926+
return $this->makeRequest('PUT', $path, $body, $options);
1927+
}
1928+
18981929
/**
18991930
* List the external invoices on an external subscription
19001931
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?php
2+
/**
3+
* This file is automatically created by Recurly's OpenAPI generation process
4+
* and thus any edits you make by hand will be lost. If you wish to make a
5+
* change to this file, please create a Github issue explaining the changes you
6+
* need and we will usher them to the appropriate places.
7+
*/
8+
namespace Recurly\Resources;
9+
10+
use Recurly\RecurlyResource;
11+
12+
// phpcs:disable
13+
class BusinessEntityMini extends RecurlyResource
14+
{
15+
private $_code;
16+
private $_id;
17+
private $_name;
18+
private $_object;
19+
20+
protected static $array_hints = [
21+
];
22+
23+
24+
/**
25+
* Getter method for the code attribute.
26+
* The entity code of the business entity.
27+
*
28+
* @return ?string
29+
*/
30+
public function getCode(): ?string
31+
{
32+
return $this->_code;
33+
}
34+
35+
/**
36+
* Setter method for the code attribute.
37+
*
38+
* @param string $code
39+
*
40+
* @return void
41+
*/
42+
public function setCode(string $code): void
43+
{
44+
$this->_code = $code;
45+
}
46+
47+
/**
48+
* Getter method for the id attribute.
49+
* Business entity ID
50+
*
51+
* @return ?string
52+
*/
53+
public function getId(): ?string
54+
{
55+
return $this->_id;
56+
}
57+
58+
/**
59+
* Setter method for the id attribute.
60+
*
61+
* @param string $id
62+
*
63+
* @return void
64+
*/
65+
public function setId(string $id): void
66+
{
67+
$this->_id = $id;
68+
}
69+
70+
/**
71+
* Getter method for the name attribute.
72+
* This name describes your business entity and will appear on the invoice.
73+
*
74+
* @return ?string
75+
*/
76+
public function getName(): ?string
77+
{
78+
return $this->_name;
79+
}
80+
81+
/**
82+
* Setter method for the name attribute.
83+
*
84+
* @param string $name
85+
*
86+
* @return void
87+
*/
88+
public function setName(string $name): void
89+
{
90+
$this->_name = $name;
91+
}
92+
93+
/**
94+
* Getter method for the object attribute.
95+
* Object type
96+
*
97+
* @return ?string
98+
*/
99+
public function getObject(): ?string
100+
{
101+
return $this->_object;
102+
}
103+
104+
/**
105+
* Setter method for the object attribute.
106+
*
107+
* @param string $object
108+
*
109+
* @return void
110+
*/
111+
public function setObject(string $object): void
112+
{
113+
$this->_object = $object;
114+
}
115+
}

lib/recurly/resources/subscription.php

+24
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Subscription extends RecurlyResource
2121
private $_auto_renew;
2222
private $_bank_account_authorized_at;
2323
private $_billing_info_id;
24+
private $_business_entity_id;
2425
private $_canceled_at;
2526
private $_collection_method;
2627
private $_converted_at;
@@ -281,6 +282,29 @@ public function setBillingInfoId(string $billing_info_id): void
281282
$this->_billing_info_id = $billing_info_id;
282283
}
283284

285+
/**
286+
* Getter method for the business_entity_id attribute.
287+
* 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.
288+
*
289+
* @return ?string
290+
*/
291+
public function getBusinessEntityId(): ?string
292+
{
293+
return $this->_business_entity_id;
294+
}
295+
296+
/**
297+
* Setter method for the business_entity_id attribute.
298+
*
299+
* @param string $business_entity_id
300+
*
301+
* @return void
302+
*/
303+
public function setBusinessEntityId(string $business_entity_id): void
304+
{
305+
$this->_business_entity_id = $business_entity_id;
306+
}
307+
284308
/**
285309
* Getter method for the canceled_at attribute.
286310
* Canceled at

lib/recurly/resources/subscription_change.php

+24
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class SubscriptionChange extends RecurlyResource
1616
private $_activated;
1717
private $_add_ons;
1818
private $_billing_info;
19+
private $_business_entity;
1920
private $_created_at;
2021
private $_custom_fields;
2122
private $_deleted_at;
@@ -131,6 +132,29 @@ public function setBillingInfo(\Recurly\Resources\SubscriptionChangeBillingInfo
131132
$this->_billing_info = $billing_info;
132133
}
133134

135+
/**
136+
* Getter method for the business_entity attribute.
137+
* Business entity details
138+
*
139+
* @return ?\Recurly\Resources\BusinessEntityMini
140+
*/
141+
public function getBusinessEntity(): ?\Recurly\Resources\BusinessEntityMini
142+
{
143+
return $this->_business_entity;
144+
}
145+
146+
/**
147+
* Setter method for the business_entity attribute.
148+
*
149+
* @param \Recurly\Resources\BusinessEntityMini $business_entity
150+
*
151+
* @return void
152+
*/
153+
public function setBusinessEntity(\Recurly\Resources\BusinessEntityMini $business_entity): void
154+
{
155+
$this->_business_entity = $business_entity;
156+
}
157+
134158
/**
135159
* Getter method for the created_at attribute.
136160
* Created at

lib/recurly/resources/transaction.php

+57
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ class Transaction extends RecurlyResource
3333
private $_gateway_response_time;
3434
private $_gateway_response_values;
3535
private $_id;
36+
private $_indicator;
3637
private $_invoice;
3738
private $_ip_address_country;
3839
private $_ip_address_v4;
40+
private $_merchant_reason_code;
3941
private $_object;
4042
private $_origin;
4143
private $_original_transaction_id;
@@ -542,6 +544,29 @@ public function setId(string $id): void
542544
$this->_id = $id;
543545
}
544546

547+
/**
548+
* Getter method for the indicator attribute.
549+
* 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`.
550+
*
551+
* @return ?string
552+
*/
553+
public function getIndicator(): ?string
554+
{
555+
return $this->_indicator;
556+
}
557+
558+
/**
559+
* Setter method for the indicator attribute.
560+
*
561+
* @param string $indicator
562+
*
563+
* @return void
564+
*/
565+
public function setIndicator(string $indicator): void
566+
{
567+
$this->_indicator = $indicator;
568+
}
569+
545570
/**
546571
* Getter method for the invoice attribute.
547572
* Invoice mini details
@@ -616,6 +641,38 @@ public function setIpAddressV4(string $ip_address_v4): void
616641
$this->_ip_address_v4 = $ip_address_v4;
617642
}
618643

644+
/**
645+
* Getter method for the merchant_reason_code attribute.
646+
* This conditional parameter is useful for merchants in specific industries who need to submit one-time Merchant Initiated transactions in specific cases.
647+
Not all gateways support these methods, but will support a generic one-time Merchant Initiated transaction.
648+
Only use this if the initiator value is "merchant". Otherwise, it will be ignored.
649+
- 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.
650+
- No Show: Send `no_show` if you charge customers a fee due to an agreed-upon cancellation policy in your industry.
651+
- 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.
652+
- 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.
653+
- 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.
654+
- 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.
655+
656+
*
657+
* @return ?string
658+
*/
659+
public function getMerchantReasonCode(): ?string
660+
{
661+
return $this->_merchant_reason_code;
662+
}
663+
664+
/**
665+
* Setter method for the merchant_reason_code attribute.
666+
*
667+
* @param string $merchant_reason_code
668+
*
669+
* @return void
670+
*/
671+
public function setMerchantReasonCode(string $merchant_reason_code): void
672+
{
673+
$this->_merchant_reason_code = $merchant_reason_code;
674+
}
675+
619676
/**
620677
* Getter method for the object attribute.
621678
* Object type

0 commit comments

Comments
 (0)