diff --git a/Tests/Recurly/Billing_Info_Test.php b/Tests/Recurly/Billing_Info_Test.php index 721b60ef..58c10d88 100644 --- a/Tests/Recurly/Billing_Info_Test.php +++ b/Tests/Recurly/Billing_Info_Test.php @@ -229,4 +229,16 @@ public function testForGatewayToken() { ); } + public function testForCardNetworkPreference() { + $billing_info = new Recurly_BillingInfo(null, $this->client); + $billing_info->card_network_preference = 'Cartes Bancaires'; + $billing_info->month = '11'; + $billing_info->year = '2025'; + + $this->assertInstanceOf('Recurly_BillingInfo', $billing_info); + $this->assertEquals( + $billing_info->xml(), + "\n112025Cartes Bancaires\n" + ); + } } diff --git a/lib/recurly/billing_info.php b/lib/recurly/billing_info.php index d3ee35ee..0b7dc03a 100644 --- a/lib/recurly/billing_info.php +++ b/lib/recurly/billing_info.php @@ -51,6 +51,7 @@ * @property string $tax_identifier_type This field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil. * @property boolean $primary_payment_method Primary payment method * @property boolean $backup_payment_method Backup payment method + * @property string $card_network_preference Visa, MasterCard, Cartes Bancaires, etc */ class Recurly_BillingInfo extends Recurly_Resource { @@ -151,7 +152,7 @@ protected function getWriteableAttributes() { 'braintree_payment_nonce', 'roku_billing_agreement_id', 'three_d_secure_action_result_token_id', 'transaction_type', 'iban', 'sort_code', 'bsb_code', 'type', 'tax_identifier', 'tax_identifier_type', 'primary_payment_method', 'backup_payment_method', - 'online_banking_payment_type', 'username' + 'online_banking_payment_type', 'username', 'card_network_preference' ); } }