-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A more versatile solution to field naming (#149)
* Added rename.xml for custom field name support * Added getFieldName() * Updated tests so they don't break when renames are in effect * Cleaned up configuration (release warning: prefix enabled by default) * Scoping fix * Fixed rename config issue with commenting * Removed example prefix as default * Batch support for getFieldName(). Added normalizeFormData() to reverse the effects of custom field name support * Added test for normalizeFormData * Removed mock functionality and updated test
- Loading branch information
Showing
3 changed files
with
202 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
Name: omnipay-rename | ||
--- | ||
# You can define custom names globally, or on a per gateway basis, if you define your gateway here, it will take priority | ||
# and then will fall back to any of the global renames defined below (if set). The example below shows how you would rename | ||
# the default fields for the Stripe payment gateway, and how to rename field names globally | ||
|
||
GatewayFieldsFactory: | ||
rename: | ||
prefix: '' # e.g "card_" | ||
#name: 'myName' | ||
#type: 'myType' | ||
#number: 'myNumber' | ||
Stripe: | ||
name: 'name' # e.g change to newName | ||
#number: 'myStripeNumber' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters