Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add card_network_preference field to v2 #805

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
);
}
}
Loading