Skip to content

Commit 5dfc7bf

Browse files
committed
Rename to hashKey
1 parent 612ef7c commit 5dfc7bf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/BamboraProperties.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class BamboraProperties {
1111
private String merchantId;
1212
private String hostedProfileUrl;
1313
private String hostedProfileServiceVersion;
14-
private String key;
14+
private String hashKey;
1515
private int minutesToExpiry;
1616

1717
public String getMerchantId() {
@@ -38,12 +38,12 @@ public void setHostedProfileServiceVersion(String hostedProfileServiceVersion) {
3838
this.hostedProfileServiceVersion = hostedProfileServiceVersion;
3939
}
4040

41-
public String getKey() {
42-
return key;
41+
public String getHashKey() {
42+
return hashKey;
4343
}
4444

45-
public void setKey(String key) {
46-
this.key = key;
45+
public void setHashKey(String hashKey) {
46+
this.hashKey = hashKey;
4747
}
4848

4949
public int getMinutesToExpiry() {

src/bambora-payment-starter/src/main/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private Uri buildRecurringPaymentUrl(RecurringPaymentDetails recurringPaymentDet
5555
paramString.append(formatBamboraParam("&", BamboraConstants.PARAM_PPRDIR_CUSTOMER_CODE, recurringPaymentDetails.getEndUserId()));
5656

5757
//add hash key at end of params
58-
paramString.append(bamboraProperties.getKey());
58+
paramString.append(bamboraProperties.getHashKey());
5959

6060
String hashed = getHash(paramString.toString());
6161

@@ -67,7 +67,7 @@ private Uri buildRecurringPaymentUrl(RecurringPaymentDetails recurringPaymentDet
6767
String expiry = sdfDate.format(cal.getTime());
6868

6969
// Add hash and expiry to the redirect
70-
String hashedParameter = paramString.toString().replace(bamboraProperties.getKey(), MessageFormat.format("&{0}={1}&{2}={3}", BamboraConstants.PARAM_TRANS_HASH_VALUE, hashed, BamboraConstants.PARAM_TRANS_HASH_EXPIRY, expiry));
70+
String hashedParameter = paramString.toString().replace(bamboraProperties.getHashKey(), MessageFormat.format("&{0}={1}&{2}={3}", BamboraConstants.PARAM_TRANS_HASH_VALUE, hashed, BamboraConstants.PARAM_TRANS_HASH_EXPIRY, expiry));
7171

7272
return new Uri(MessageFormat.format("{0}?{1}", bamboraProperties.getHostedProfileUrl(), hashedParameter));
7373

src/bambora-payment-starter/src/test/java/ca/bc/gov/open/bambora/payment/starter/managment/BamboraCardServiceImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void init() {
3131
bamboraProperties = new BamboraProperties();
3232
bamboraProperties.setHostedProfileServiceVersion(PROFILE_SERVICE_VERSION);
3333
bamboraProperties.setHostedProfileUrl(HOSTED_PROFILE_URL);
34-
bamboraProperties.setKey(KEY);
34+
bamboraProperties.setHashKey(KEY);
3535
bamboraProperties.setMerchantId(MERCHANT_ID);
3636
bamboraProperties.setMinutesToExpiry(MINUTES_TO_EXPIRY);
3737

0 commit comments

Comments
 (0)