Skip to content

Commit

Permalink
add field
Browse files Browse the repository at this point in the history
  • Loading branch information
gilv93 committed Mar 19, 2024
1 parent e4113eb commit e069af5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Tests/Recurly/Billing_Info_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<billing_info><month>11</month><year>2025</year><card_network_preference>Cartes Bancaires</card_network_preference></billing_info>\n"
);
}
}
3 changes: 2 additions & 1 deletion lib/recurly/billing_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'
);
}
}

0 comments on commit e069af5

Please sign in to comment.